emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 5a5e4eb: Strip most headers when forwarding message


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 5a5e4eb: Strip most headers when forwarding messages
Date: Thu, 26 Apr 2018 13:48:00 -0400 (EDT)

branch: master
commit 5a5e4eb76a3e9bfc7d4eeec06f874b524d4df450
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Strip most headers when forwarding messages
    
    * lisp/gnus/message.el (message-forward-included-headers): Change
    the default to exclude most messages.
    (message-remove-ignored-headers): Make
    message-forward-included-headers actually work -- it's a list of
    regexps, not a list of strings.
---
 doc/misc/message.texi | 2 +-
 etc/NEWS              | 5 +++++
 lisp/gnus/message.el  | 8 +++++---
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/doc/misc/message.texi b/doc/misc/message.texi
index 1d27ff1..671a521 100644
--- a/doc/misc/message.texi
+++ b/doc/misc/message.texi
@@ -316,7 +316,7 @@ when forwarding a message.
 @item message-forward-included-headers
 @vindex message-forward-included-headers
 In address@hidden, only headers that match this regexp will be kept
-when forwarding a message.
+when forwarding a message.  This can also be a list of regexps.
 
 @item message-make-forward-subject-function
 @vindex message-make-forward-subject-function
diff --git a/etc/NEWS b/etc/NEWS
index 5416cb7..ca46c88 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -425,10 +425,15 @@ achieve this, add 
'message-sign-encrypt-if-all-keys-available' to
 '"address@hidden" <address@hidden>', Message will elide the repeated "name"
 from the address field in the response.
 
+---
 *** The default of 'message-forward-as-mime' has changed from t to nil
 as it has been reported that many recipients can't read forwards that
 are formatted as MIME digests.
 
++++
+*** `message-forward-included-headers' has changed its default to
+exclude most headers when forwarding.
+
 * New Modes and Packages in Emacs 27.1
 
 +++
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 33c5e2c..867c3d2 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -625,11 +625,12 @@ This may also be a list of regexps."
                              (widget-editable-list-match widget value)))
                 regexp))
 
-(defcustom message-forward-included-headers nil
+(defcustom message-forward-included-headers
+  '("^From:" "^Subject:" "^Date:")
   "If non-nil, delete non-matching headers when forwarding a message.
 Only headers that match this regexp will be included.  This
 variable should be a regexp or a list of regexps."
-  :version "25.1"
+  :version "27.1"
   :group 'message-forwarding
   :type '(repeat :value-to-internal (lambda (widget value)
                                      (custom-split-regexp-maybe value))
@@ -7436,7 +7437,8 @@ Optional DIGEST will use digest to forward."
       (when message-forward-included-headers
        (message-remove-header
         (if (listp message-forward-included-headers)
-            (regexp-opt message-forward-included-headers)
+            (mapconcat #'identity (cons "^$" message-forward-included-headers)
+                       "\\|")
           message-forward-included-headers)
         t nil t)))))
 



reply via email to

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