Function: rmail-delete-headers

rmail-delete-headers is a byte-compiled function defined in rmail.el.gz.

Signature

(rmail-delete-headers REGEXP)

Documentation

Delete any mail headers matching REGEXP.

The message should be narrowed to just the headers.

Source Code

;; Defined in /usr/src/emacs/lisp/mail/rmail.el.gz
;; This is a cut-down version of rmail-clear-headers from Emacs 22.
;; It doesn't have the same functionality, hence the name change.
(defun rmail-delete-headers (regexp)
  "Delete any mail headers matching REGEXP.
The message should be narrowed to just the headers."
  (when regexp
    (goto-char (point-min))
    (while (re-search-forward regexp nil t)
      (beginning-of-line)
      ;; This code from Emacs 22 doesn't seem right, since r-n-h is
      ;; just for display.
;;;      (if (looking-at rmail-nonignored-headers)
;;;	  (forward-line 1)
      (delete-region (point)
		     (save-excursion
		       (if (re-search-forward "\n[^ \t]" nil t)
			   (1- (point))
			 (point-max)))))))