aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1998-03-16 18:11:20 +0000
committerRichard M. Stallman1998-03-16 18:11:20 +0000
commitf92f70bca6407744027e04b107ba390968fc84e8 (patch)
treed446461f0f742dbd133f1373000929f669bd0b2e
parent1fa01bcdd7cd0ec299f497b79b29adb317b44deb (diff)
downloademacs-f92f70bca6407744027e04b107ba390968fc84e8.tar.gz
emacs-f92f70bca6407744027e04b107ba390968fc84e8.zip
(rmail-clear-headers): Make sure an empty line
still separates the headers from the body.
-rw-r--r--lisp/mail/rmail.el59
1 files changed, 30 insertions, 29 deletions
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 5f4638426cc..03d123ce353 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -1657,35 +1657,36 @@ delete all header fields whose names match that regexp.
1657Otherwise, if `rmail-displayed-headers' is non-nil, 1657Otherwise, if `rmail-displayed-headers' is non-nil,
1658delete all header fields *except* those whose names match that regexp. 1658delete all header fields *except* those whose names match that regexp.
1659Otherwise, delete all header fields whose names match `rmail-ignored-headers'." 1659Otherwise, delete all header fields whose names match `rmail-ignored-headers'."
1660 (if (search-forward "\n\n" nil t) 1660 (when (search-forward "\n\n" nil t)
1661 (let ((case-fold-search t) 1661 (forward-char -1)
1662 (buffer-read-only nil)) 1662 (let ((case-fold-search t)
1663 (if (and rmail-displayed-headers (null ignored-headers)) 1663 (buffer-read-only nil))
1664 (save-restriction 1664 (if (and rmail-displayed-headers (null ignored-headers))
1665 (narrow-to-region (point-min) (point)) 1665 (save-restriction
1666 (let (lim next) 1666 (narrow-to-region (point-min) (point))
1667 (goto-char (point-min)) 1667 (let (lim next)
1668 (while (and (not (eobp)) 1668 (goto-char (point-min))
1669 (save-excursion 1669 (while (and (not (eobp))
1670 (if (re-search-forward "\n[^ \t]" nil t) 1670 (save-excursion
1671 (setq lim (match-beginning 0) 1671 (if (re-search-forward "\n[^ \t]" nil t)
1672 next (1+ lim)) 1672 (setq lim (match-beginning 0)
1673 (setq lim nil next (point-max))))) 1673 next (1+ lim))
1674 (if (save-excursion 1674 (setq lim nil next (point-max)))))
1675 (re-search-forward rmail-displayed-headers lim t)) 1675 (if (save-excursion
1676 (goto-char next) 1676 (re-search-forward rmail-displayed-headers lim t))
1677 (delete-region (point) next)))) 1677 (goto-char next)
1678 (goto-char (point-min))) 1678 (delete-region (point) next))))
1679 (or ignored-headers (setq ignored-headers rmail-ignored-headers)) 1679 (goto-char (point-min)))
1680 (save-restriction 1680 (or ignored-headers (setq ignored-headers rmail-ignored-headers))
1681 (narrow-to-region (point-min) (point)) 1681 (save-restriction
1682 (while (progn 1682 (narrow-to-region (point-min) (point))
1683 (goto-char (point-min)) 1683 (while (progn
1684 (re-search-forward ignored-headers nil t)) 1684 (goto-char (point-min))
1685 (beginning-of-line) 1685 (re-search-forward ignored-headers nil t))
1686 (delete-region (point) 1686 (beginning-of-line)
1687 (progn (re-search-forward "\n[^ \t]") 1687 (delete-region (point)
1688 (1- (point)))))))))) 1688 (progn (re-search-forward "\n[^ \t]")
1689 (1- (point))))))))))
1689 1690
1690(defun rmail-msg-is-pruned () 1691(defun rmail-msg-is-pruned ()
1691 (rmail-maybe-set-message-counters) 1692 (rmail-maybe-set-message-counters)