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

(mail-yank-clear-headers): Do nothing if

mail-yank-ignored-headers is nil.
parent 6c714afe
...@@ -893,19 +893,20 @@ and don't delete any header fields." ...@@ -893,19 +893,20 @@ and don't delete any header fields."
(if (not (eolp)) (insert ?\n))))) (if (not (eolp)) (insert ?\n)))))
(defun mail-yank-clear-headers (start end) (defun mail-yank-clear-headers (start end)
(save-excursion (if mail-yank-ignored-headers
(goto-char start) (save-excursion
(if (search-forward "\n\n" end t) (goto-char start)
(save-restriction (if (search-forward "\n\n" end t)
(narrow-to-region start (point)) (save-restriction
(goto-char start) (narrow-to-region start (point))
(while (let ((case-fold-search t)) (goto-char start)
(re-search-forward mail-yank-ignored-headers nil t)) (while (let ((case-fold-search t))
(beginning-of-line) (re-search-forward mail-yank-ignored-headers nil t))
(delete-region (point) (beginning-of-line)
(progn (re-search-forward "\n[^ \t]") (delete-region (point)
(forward-char -1) (progn (re-search-forward "\n[^ \t]")
(point)))))))) (forward-char -1)
(point)))))))))
;; Put these last, to reduce chance of lossage from quitting in middle of loading the file. ;; Put these last, to reduce chance of lossage from quitting in middle of loading the file.
......
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