diff options
| author | Eric Abrahamsen | 2023-12-08 09:39:58 -0800 |
|---|---|---|
| committer | Eric Abrahamsen | 2023-12-12 10:01:31 -0800 |
| commit | 75fd7550ed6cede6c9e8224f1f2d62637c43fdd4 (patch) | |
| tree | eb2c3569390edeedb784525b79a8c83230718583 | |
| parent | 67654fe96577823e6fcbd3e88b9779653f8b6201 (diff) | |
| download | emacs-75fd7550ed6cede6c9e8224f1f2d62637c43fdd4.tar.gz emacs-75fd7550ed6cede6c9e8224f1f2d62637c43fdd4.zip | |
Provide option to forward Gnus messages with all (most) headers
Bug#67520
* lisp/gnus/gnus-msg.el (gnus-summary-mail-forward): Accept symbolic
prefix to let-bind message-forward-included-headers to nil, which will
include most original message headers in the forwarded copy.
(gnus-summary-post-forward): Corresponding arglist update.
| -rw-r--r-- | doc/misc/gnus.texi | 26 | ||||
| -rw-r--r-- | lisp/gnus/gnus-msg.el | 26 |
2 files changed, 34 insertions, 18 deletions
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 586e4b94ba1..ead5954a96e 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi | |||
| @@ -5868,15 +5868,23 @@ original message but ignore the @code{Reply-To} field | |||
| 5868 | @findex gnus-summary-mail-forward | 5868 | @findex gnus-summary-mail-forward |
| 5869 | @c @icon{gnus-summary-mail-forward} | 5869 | @c @icon{gnus-summary-mail-forward} |
| 5870 | Forward the current article to some other person | 5870 | Forward the current article to some other person |
| 5871 | (@code{gnus-summary-mail-forward}). If no prefix is given, the message | 5871 | (@code{gnus-summary-mail-forward}). If no prefix is given, the |
| 5872 | is forwarded according to the value of (@code{message-forward-as-mime}) | 5872 | message is forwarded according to the value of |
| 5873 | and (@code{message-forward-show-mml}); if the prefix is 1, decode the | 5873 | (@code{message-forward-as-mime}) and |
| 5874 | message and forward directly inline; if the prefix is 2, forward message | 5874 | (@code{message-forward-show-mml}); if the prefix is 1, decode the |
| 5875 | as an rfc822 @acronym{MIME} section; if the prefix is 3, decode message and | 5875 | message and forward directly inline; if the prefix is 2, forward |
| 5876 | forward as an rfc822 @acronym{MIME} section; if the prefix is 4, forward message | 5876 | message as an rfc822 @acronym{MIME} section; if the prefix is 3, |
| 5877 | directly inline; otherwise, the message is forwarded as no prefix given | 5877 | decode message and forward as an rfc822 @acronym{MIME} section; if the |
| 5878 | but use the flipped value of (@code{message-forward-as-mime}). By | 5878 | prefix is 4, forward message directly inline; otherwise, the message |
| 5879 | default, the forwarded message is inlined into the mail. | 5879 | is forwarded as no prefix given but use the negated value of |
| 5880 | (@code{message-forward-as-mime}). By default, the forwarded message | ||
| 5881 | is inlined into the mail. | ||
| 5882 | |||
| 5883 | Which headers from the original message are included in the forwarded | ||
| 5884 | message is determined by options specific to @code{message-mode}, | ||
| 5885 | @pxref{Forwarding,,, message}. In addition, this command can be given | ||
| 5886 | the symbolic prefix @samp{a}, using @kbd{M-i a}, to include most original | ||
| 5887 | headers. | ||
| 5880 | 5888 | ||
| 5881 | @item S m | 5889 | @item S m |
| 5882 | @itemx m | 5890 | @itemx m |
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index b065ae34851..e503ccae00f 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el | |||
| @@ -1209,7 +1209,7 @@ The original article(s) will be yanked." | |||
| 1209 | (gnus-summary-reply | 1209 | (gnus-summary-reply |
| 1210 | (gnus-summary-work-articles n) t (gnus-summary-work-articles n))) | 1210 | (gnus-summary-work-articles n) t (gnus-summary-work-articles n))) |
| 1211 | 1211 | ||
| 1212 | (defun gnus-summary-mail-forward (&optional arg post) | 1212 | (defun gnus-summary-mail-forward (&optional arg all-headers post) |
| 1213 | "Forward the current message(s) to another user. | 1213 | "Forward the current message(s) to another user. |
| 1214 | If process marks exist, forward all marked messages; | 1214 | If process marks exist, forward all marked messages; |
| 1215 | if ARG is nil, see `message-forward-as-mime' and `message-forward-show-mml'; | 1215 | if ARG is nil, see `message-forward-as-mime' and `message-forward-show-mml'; |
| @@ -1217,17 +1217,25 @@ if ARG is 1, decode the message and forward directly inline; | |||
| 1217 | if ARG is 2, forward message as an rfc822 MIME section; | 1217 | if ARG is 2, forward message as an rfc822 MIME section; |
| 1218 | if ARG is 3, decode message and forward as an rfc822 MIME section; | 1218 | if ARG is 3, decode message and forward as an rfc822 MIME section; |
| 1219 | if ARG is 4, forward message directly inline; | 1219 | if ARG is 4, forward message directly inline; |
| 1220 | otherwise, use flipped `message-forward-as-mime'. | 1220 | otherwise, use negated `message-forward-as-mime'. |
| 1221 | If POST, post instead of mail. | 1221 | If POST, post instead of mail. |
| 1222 | For the \"inline\" alternatives, also see the variable | 1222 | If symbolic prefix ALL-HEADERS is the symbol `a', include all |
| 1223 | `message-forward-ignored-headers'." | 1223 | original headers in the forwarded message, except those matching |
| 1224 | (interactive "P" gnus-summary-mode) | 1224 | `message-forward-ignored-headers'. Otherwise, include headers |
| 1225 | based on the options `message-forward-included-headers', | ||
| 1226 | `message-forward-ignored-headers', and potentially | ||
| 1227 | `message-forward-included-mime-headers'." | ||
| 1228 | (interactive (gnus-interactive "P\ny") gnus-summary-mode) | ||
| 1225 | (if (cdr (gnus-summary-work-articles nil)) | 1229 | (if (cdr (gnus-summary-work-articles nil)) |
| 1226 | ;; Process marks are given. | 1230 | ;; Process marks are given. |
| 1227 | (gnus-uu-digest-mail-forward nil post) | 1231 | (gnus-uu-digest-mail-forward nil post) |
| 1228 | ;; No process marks. | 1232 | ;; No process marks. |
| 1229 | (let ((message-forward-as-mime message-forward-as-mime) | 1233 | (let ((message-forward-as-mime message-forward-as-mime) |
| 1230 | (message-forward-show-mml message-forward-show-mml)) | 1234 | (message-forward-show-mml message-forward-show-mml) |
| 1235 | (message-forward-included-headers | ||
| 1236 | (if (eq all-headers 'a) | ||
| 1237 | nil | ||
| 1238 | message-forward-included-headers))) | ||
| 1231 | (cond | 1239 | (cond |
| 1232 | ((null arg)) | 1240 | ((null arg)) |
| 1233 | ((eq arg 1) | 1241 | ((eq arg 1) |
| @@ -1380,11 +1388,11 @@ composing a new message." | |||
| 1380 | (forward-char 1)) | 1388 | (forward-char 1)) |
| 1381 | (widen))))) | 1389 | (widen))))) |
| 1382 | 1390 | ||
| 1383 | (defun gnus-summary-post-forward (&optional arg) | 1391 | (defun gnus-summary-post-forward (&optional arg all-headers) |
| 1384 | "Forward the current article to a newsgroup. | 1392 | "Forward the current article to a newsgroup. |
| 1385 | See `gnus-summary-mail-forward' for ARG." | 1393 | See `gnus-summary-mail-forward' for ARG." |
| 1386 | (interactive "P" gnus-summary-mode) | 1394 | (interactive (gnus-interactive "P\ny") gnus-summary-mode) |
| 1387 | (gnus-summary-mail-forward arg t)) | 1395 | (gnus-summary-mail-forward arg all-headers t)) |
| 1388 | 1396 | ||
| 1389 | (defun gnus-summary-mail-crosspost-complaint (n) | 1397 | (defun gnus-summary-mail-crosspost-complaint (n) |
| 1390 | "Send a complaint about crossposting to the current article(s)." | 1398 | "Send a complaint about crossposting to the current article(s)." |