Function: nnmbox-delete-mail

nnmbox-delete-mail is a byte-compiled function defined in nnmbox.el.gz.

Signature

(nnmbox-delete-mail &optional FORCE LEAVE-DELIM)

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/nnmbox.el.gz
;;; Internal functions.

;; If FORCE, delete article no matter how many X-Gnus-Newsgroup
;; headers there are.  If LEAVE-DELIM, don't delete the Unix mbox
;; delimiter line.
(defun nnmbox-delete-mail (&optional force leave-delim)
  ;; Delete the current X-Gnus-Newsgroup line.
  ;; First delete record of active article, unless the article is being
  ;; replaced, indicated by FORCE being non-nil.
  (if (not force)
      (nnmbox-record-deleted-article (nnmbox-article-group-number t)))
  (or force
      (gnus-delete-line))
  ;; Beginning of the article.
  (save-excursion
    (save-restriction
      (narrow-to-region
       (prog2
	   (re-search-backward (concat "^" message-unix-mail-delimiter) nil t)
	   (if leave-delim (progn (forward-line 1) (point))
	     (match-beginning 0))
	 (forward-line 1))
       (or (and (re-search-forward (concat "^" message-unix-mail-delimiter)
				   nil t)
		(match-beginning 0))
	   (point-max)))
      (goto-char (point-min))
      ;; Only delete the article if no other group owns it as well.
      (when (or force
		(not (re-search-forward "^X-Gnus-Newsgroup: " nil t))
		(search-backward "\n\n" nil t))
	(delete-region (point-min) (point-max))))))