Function: nnbabyl-delete-mail

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

Signature

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

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/nnbabyl.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 nnbabyl-delete-mail (&optional force leave-delim)
  ;; Delete the current X-Gnus-Newsgroup line.
  (unless force
    (delete-region (point-at-bol) (progn (forward-line 1) (point))))
  ;; Beginning of the article.
  (save-excursion
    (save-restriction
      (widen)
      (narrow-to-region
       (save-excursion
	 (unless (re-search-backward (concat "^" nnbabyl-mail-delimiter) nil t)
	   (goto-char (point-min))
	   (end-of-line))
	 (if leave-delim (progn (forward-line 1) (point))
	   (match-beginning 0)))
       (progn
	 (forward-line 1)
	 (or (and (re-search-forward (concat "^" nnbabyl-mail-delimiter)
				     nil t)
		  (match-beginning 0))
	     (point-max))))
      (goto-char (point-min))
      ;; Only delete the article if no other groups owns it as well.
      (when (or force (not (re-search-forward "^X-Gnus-Newsgroup: " nil t)))
	(delete-region (point-min) (point-max))))))