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

(rmail-clear-headers): Handle the last header in a message correctly.

parent 6b17d756
......@@ -1636,16 +1636,18 @@ Otherwise, delete all header fields whose names match `rmail-ignored-headers'."
(if (and rmail-displayed-headers (null ignored-headers))
(narrow-to-region (point-min) (point))
(let (lim)
(let (lim next)
(goto-char (point-min))
(while (save-excursion
(re-search-forward "\n[^ \t]")
(and (not (eobp))
(setq lim (1- (point)))))
(while (and (not (eobp))
(if (re-search-forward "\n[^ \t]" nil t)
(setq lim (match-beginning 0)
next (1+ lim))
(setq lim nil next (point-max)))))
(if (save-excursion
(re-search-forward rmail-displayed-headers lim t))
(goto-char lim)
(delete-region (point) lim))))
(goto-char next)
(delete-region (point) next))))
(goto-char (point-min)))
(or ignored-headers (setq ignored-headers rmail-ignored-headers))
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