Commit f92f70bc authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(rmail-clear-headers): Make sure an empty line

still separates the headers from the body.
parent 1fa01bcd
...@@ -1657,35 +1657,36 @@ delete all header fields whose names match that regexp. ...@@ -1657,35 +1657,36 @@ delete all header fields whose names match that regexp.
Otherwise, if `rmail-displayed-headers' is non-nil, Otherwise, if `rmail-displayed-headers' is non-nil,
delete all header fields *except* those whose names match that regexp. delete all header fields *except* those whose names match that regexp.
Otherwise, delete all header fields whose names match `rmail-ignored-headers'." Otherwise, delete all header fields whose names match `rmail-ignored-headers'."
(if (search-forward "\n\n" nil t) (when (search-forward "\n\n" nil t)
(let ((case-fold-search t) (forward-char -1)
(buffer-read-only nil)) (let ((case-fold-search t)
(if (and rmail-displayed-headers (null ignored-headers)) (buffer-read-only nil))
(save-restriction (if (and rmail-displayed-headers (null ignored-headers))
(narrow-to-region (point-min) (point)) (save-restriction
(let (lim next) (narrow-to-region (point-min) (point))
(goto-char (point-min)) (let (lim next)
(while (and (not (eobp)) (goto-char (point-min))
(save-excursion (while (and (not (eobp))
(if (re-search-forward "\n[^ \t]" nil t) (save-excursion
(setq lim (match-beginning 0) (if (re-search-forward "\n[^ \t]" nil t)
next (1+ lim)) (setq lim (match-beginning 0)
(setq lim nil next (point-max))))) next (1+ lim))
(if (save-excursion (setq lim nil next (point-max)))))
(re-search-forward rmail-displayed-headers lim t)) (if (save-excursion
(goto-char next) (re-search-forward rmail-displayed-headers lim t))
(delete-region (point) next)))) (goto-char next)
(goto-char (point-min))) (delete-region (point) next))))
(or ignored-headers (setq ignored-headers rmail-ignored-headers)) (goto-char (point-min)))
(save-restriction (or ignored-headers (setq ignored-headers rmail-ignored-headers))
(narrow-to-region (point-min) (point)) (save-restriction
(while (progn (narrow-to-region (point-min) (point))
(goto-char (point-min)) (while (progn
(re-search-forward ignored-headers nil t)) (goto-char (point-min))
(beginning-of-line) (re-search-forward ignored-headers nil t))
(delete-region (point) (beginning-of-line)
(progn (re-search-forward "\n[^ \t]") (delete-region (point)
(1- (point)))))))))) (progn (re-search-forward "\n[^ \t]")
(1- (point))))))))))
(defun rmail-msg-is-pruned () (defun rmail-msg-is-pruned ()
(rmail-maybe-set-message-counters) (rmail-maybe-set-message-counters)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment