[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master a583c72: Respect message-forward-ignored-headers more

From: Lars Ingebrigtsen
Subject: master a583c72: Respect message-forward-ignored-headers more
Date: Sun, 10 Jan 2021 10:17:05 -0500 (EST)

branch: master
commit a583c72305530f7d3ecc9ba50eefa70b6ddecdd9
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Respect message-forward-ignored-headers more
    * lisp/gnus/message.el (message-forward-ignored-headers): Clarify
    doc string once again.
    (message-forward-make-body-mime): Remove headers when not
    encrypted (bug#45631).
    (message-forward-make-body): Pass in correct values.
 etc/NEWS             |  7 +++++++
 lisp/gnus/message.el | 12 ++++++++----
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 13ef7d8..1a1f76d 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -701,6 +701,13 @@ not.
 ** Message
+*** Respect 'message-forward-ignored-headers' more.
+Previously, this variable would not be consulted if
+'message-forward-show-mml' was nil.  It's now always used, except if
+'message-forward-show-mml' is 'best', and we're forwarding an
+encrypted/signed message.
 *** Message now supports the OpenPGP header.
 To generate these headers, add the new function
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 3ff3d29..50e0218 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -620,8 +620,8 @@ Done before generating the new subject of a forward."
 (defcustom message-forward-ignored-headers 
   "All headers that match this regexp will be deleted when forwarding a 
-This variable is only consulted when forwarding \"normally\", not
-when forwarding as MIME or the like.
+This variable is not consulted when forwarding encrypted messages
+and `message-forward-show-mml' is `best'.
 This may also be a list of regexps."
   :version "21.1"
@@ -7638,7 +7638,8 @@ Optional DIGEST will use digest to forward."
         t nil t)))))
-(defun message-forward-make-body-mime (forward-buffer &optional beg end)
+(defun message-forward-make-body-mime (forward-buffer &optional beg end
+                                                     remove-headers)
   (let ((b (point)))
     (insert "\n\n<#part type=message/rfc822 disposition=inline raw=t>\n")
@@ -7648,6 +7649,8 @@ Optional DIGEST will use digest to forward."
       (goto-char (point-min))
       (when (looking-at "From ")
        (replace-match "X-From-Line: "))
+      (when remove-headers
+       (message-remove-ignored-headers (point-min) (point-max)))
       (goto-char (point-max)))
     (insert "<#/part>\n")
     ;; Consider there is no illegible text.
@@ -7786,7 +7789,8 @@ is for the internal use."
                               (error t))))))
            (message-forward-make-body-mml forward-buffer)
-         (message-forward-make-body-mime forward-buffer))
+         (message-forward-make-body-mime
+          forward-buffer nil nil (not (eq message-forward-show-mml 'best))))
       (message-forward-make-body-plain forward-buffer)))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]