From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#67520: 29.1; Mention headers Date: Fri, 08 Dec 2023 09:42:10 -0800 Message-ID: <878r64oakt.fsf@ericabrahamsen.net> References: <87ttp5z0ap.7.fsf@jidanni.org> <83o7fc7m6u.fsf@gnu.org> <87edg8o9tp.fsf@ericabrahamsen.net> <87ttp3eq36.5.fsf@jidanni.org> <87v89eu4nn.fsf@ericabrahamsen.net> <8a532628a05193a12e475af79a1a9934@jidanni.org> <87bkb5qnpi.fsf@ericabrahamsen.net> <87bkb5jl07.5.fsf@jidanni.org> <87o7f3pdv7.fsf@ericabrahamsen.net> <871qbxnui9.7.fsf@jidanni.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33243"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 67520@debbugs.gnu.org To: Dan Jacobson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 08 18:43:14 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rBesb-0008Ql-SF for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Dec 2023 18:43:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBesO-0000JK-NX; Fri, 08 Dec 2023 12:43:00 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rBesE-0000Fk-A4 for bug-gnu-emacs@gnu.org; Fri, 08 Dec 2023 12:42:51 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rBesE-0001iX-1b for bug-gnu-emacs@gnu.org; Fri, 08 Dec 2023 12:42:50 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rBesQ-0000Xr-O9; Fri, 08 Dec 2023 12:43:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Fri, 08 Dec 2023 17:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67520 X-GNU-PR-Package: emacs,gnus Original-Received: via spool by 67520-submit@debbugs.gnu.org id=B67520.17020573532032 (code B ref 67520); Fri, 08 Dec 2023 17:43:02 +0000 Original-Received: (at 67520) by debbugs.gnu.org; 8 Dec 2023 17:42:33 +0000 Original-Received: from localhost ([127.0.0.1]:46009 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rBerw-0000Wi-EX for submit@debbugs.gnu.org; Fri, 08 Dec 2023 12:42:32 -0500 Original-Received: from mail.ericabrahamsen.net ([52.70.2.18]:36610) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rBeru-0000WK-Rp for 67520@debbugs.gnu.org; Fri, 08 Dec 2023 12:42:31 -0500 Original-Received: from localhost (71-212-21-65.tukw.qwest.net [71.212.21.65]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id B43E5FA09E; Fri, 8 Dec 2023 17:42:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1702057332; bh=2HRtan9t+/IYg2W4rmuW+A9lsJPeHHWABeRwDkVWU+M=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=DNIY90r4dakfWkWydrbV5h27NzHI7SmzKNRJ/ksJE9kaNWwEvbA43tuZNmlmCZp+Z 8o/zsX6w4n841R11R8K0w2XQDDQ6qLs1cVOvjIeCu9W9m2ngoiLEjNwEN1dPZiI8rB IRJMAb7WxWLBr13J7rZnHrvSb472X+DSI6mFGsBc= In-Reply-To: <871qbxnui9.7.fsf@jidanni.org> (Dan Jacobson's message of "Fri, 08 Dec 2023 13:17:02 +0800") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:275797 Archived-At: --=-=-= Content-Type: text/plain On 12/08/23 13:17 PM, Dan Jacobson wrote: > OK, great. Now all that needs to be done is when the user types C-h C-c C-f > they should see at the bottom: > ----- > To include ALL headers in your forwarded message, use > > M-i a C-c C-f > ------ > And of course C-c C-f runs the command gnus-summary-mail-forward needs > to be changed to accept the prefix. (info "(gnus) Symbolic Prefixes") Here's what I've got so far. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Provide-option-to-forward-Gnus-messages-with-all-mos.patch >From ef86e3be364cbdee3ff5d83d2d37bb31c1a9ba6b Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Fri, 8 Dec 2023 09:39:58 -0800 Subject: [PATCH] Provide option to forward Gnus messages with all (most) headers * 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. --- doc/misc/gnus.texi | 26 +++++++++++++++++--------- 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 @@ Summary Mail Commands @findex gnus-summary-mail-forward @c @icon{gnus-summary-mail-forward} Forward the current article to some other person -(@code{gnus-summary-mail-forward}). If no prefix is given, the message -is forwarded according to the value of (@code{message-forward-as-mime}) -and (@code{message-forward-show-mml}); if the prefix is 1, decode the -message and forward directly inline; if the prefix is 2, forward message -as an rfc822 @acronym{MIME} section; if the prefix is 3, decode message and -forward as an rfc822 @acronym{MIME} section; if the prefix is 4, forward message -directly inline; otherwise, the message is forwarded as no prefix given -but use the flipped value of (@code{message-forward-as-mime}). By -default, the forwarded message is inlined into the mail. +(@code{gnus-summary-mail-forward}). If no prefix is given, the +message is forwarded according to the value of +(@code{message-forward-as-mime}) and +(@code{message-forward-show-mml}); if the prefix is 1, decode the +message and forward directly inline; if the prefix is 2, forward +message as an rfc822 @acronym{MIME} section; if the prefix is 3, +decode message and forward as an rfc822 @acronym{MIME} section; if the +prefix is 4, forward message directly inline; otherwise, the message +is forwarded as no prefix given but use the negated value of +(@code{message-forward-as-mime}). By default, the forwarded message +is inlined into the mail. + +Which headers from the original message are included in the forwarded +message is determined by options specific to @code{message-mode}, +@pxref{Forwarding,,, message}. In addition, this command can be given +the symbolic prefix @samp{a}, using @kbd{M-i a}, to include most original +headers. @item S m @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 @@ gnus-summary-very-wide-reply-with-original (gnus-summary-reply (gnus-summary-work-articles n) t (gnus-summary-work-articles n))) -(defun gnus-summary-mail-forward (&optional arg post) +(defun gnus-summary-mail-forward (&optional arg all-headers post) "Forward the current message(s) to another user. If process marks exist, forward all marked messages; if ARG is nil, see `message-forward-as-mime' and `message-forward-show-mml'; @@ -1217,17 +1217,25 @@ gnus-summary-mail-forward if ARG is 2, forward message as an rfc822 MIME section; if ARG is 3, decode message and forward as an rfc822 MIME section; if ARG is 4, forward message directly inline; -otherwise, use flipped `message-forward-as-mime'. +otherwise, use negated `message-forward-as-mime'. If POST, post instead of mail. -For the \"inline\" alternatives, also see the variable -`message-forward-ignored-headers'." - (interactive "P" gnus-summary-mode) +If symbolic prefix ALL-HEADERS is the symbol `a', include all +original headers in the forwarded message, except those matching +`message-forward-ignored-headers'. Otherwise, include headers +based on the options `message-forward-included-headers', +`message-forward-ignored-headers', and potentially +`message-forward-included-mime-headers'." + (interactive (gnus-interactive "P\ny") gnus-summary-mode) (if (cdr (gnus-summary-work-articles nil)) ;; Process marks are given. (gnus-uu-digest-mail-forward nil post) ;; No process marks. (let ((message-forward-as-mime message-forward-as-mime) - (message-forward-show-mml message-forward-show-mml)) + (message-forward-show-mml message-forward-show-mml) + (message-forward-included-headers + (if (eq all-headers 'a) + nil + message-forward-included-headers))) (cond ((null arg)) ((eq arg 1) @@ -1380,11 +1388,11 @@ gnus-summary-resend-message-edit (forward-char 1)) (widen))))) -(defun gnus-summary-post-forward (&optional arg) +(defun gnus-summary-post-forward (&optional arg all-headers) "Forward the current article to a newsgroup. See `gnus-summary-mail-forward' for ARG." - (interactive "P" gnus-summary-mode) - (gnus-summary-mail-forward arg t)) + (interactive (gnus-interactive "P\ny") gnus-summary-mode) + (gnus-summary-mail-forward arg all-headers t)) (defun gnus-summary-mail-crosspost-complaint (n) "Send a complaint about crossposting to the current article(s)." -- 2.43.0 --=-=-=--