GNU bug report logs - #62345
27.1; Composing mail from secondary frame does not generate Gcc: header

Previous Next

Packages: gnus, emacs;

Reported by: Felix Natter <fnatter <at> gmx.net>

Date: Tue, 21 Mar 2023 15:37:05 UTC

Severity: normal

Found in version 27.1

Done: Robert Pluim <rpluim <at> gmail.com>

To reply to this bug, email your comments to 62345 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#62345; Package emacs,gnus. (Tue, 21 Mar 2023 15:37:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Felix Natter <fnatter <at> gmx.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org. (Tue, 21 Mar 2023 15:37:05 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Felix Natter <fnatter <at> gmx.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.1; Composing mail from secondary frame does not generate Gcc:
 header
Date: Tue, 21 Mar 2023 16:17:45 +0100
Dear emacs/gnus maintainers,

I start Gnus (M-x gnus) and compose mail in a new frame by either:
(a) C-x 5 m
(b) C-x 5 2, then m

=> The Gcc: header (i.e. Gcc: nnfolder+sent:sent-mail.2023-03) is not added
to the buffer, thus the mail will be sent but not archived.

It does work fine if I start composing from the primary frame.

BTW: M-x gnus-bug also did not add that header ;-)

My "Gcc" customization is as follows:

;; archiving sent mail/news:
(setq gnus-message-archive-method
      '(nnfolder "sent"
                 (nnfolder-inhibit-expiry t)
                 (nnfolder-directory "~/Mail/sent/")
                 (nnfolder-active-file "~/Mail/sent/active")))
(setq gnus-message-archive-group
      '((if (message-news-p)
            "sent-news"
          (concat "sent-mail." (format-time-string "%Y-%m")))))

Note that this is a standard config from the manual:
  https://www.gnus.org/manual/gnus_75.html

In GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)
 of 2023-02-23, modified by Debian built on x86-conova-01
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Debian GNU/Linux 11 (bullseye)

Recent messages:
Making completion list...
completing-read-default: Command attempted to use minibuffer while in minibuffer
No more unseen articles
scroll-up-command: End of buffer
Saving file /home/felix/src/gnus-Cx5m-bug.txt...
Wrote /home/felix/src/gnus-Cx5m-bug.txt
(No changes need to be saved) [3 times]
Making completion list...
Quit [3 times]
Type C-x 1 to delete the help window.

Configured using:
 'configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --enable-libsystemd --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/27.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/27.1/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils --build
 x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
 --libexecdir=/usr/lib --localstatedir=/var/lib
 --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd
 --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/27.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/27.1/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils --with-cairo
 --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars
 'CFLAGS=-g -O2
 -ffile-prefix-map=/build/emacs-Yfydrl/emacs-27.1+1=. -fstack-protector-strong
 -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time
 -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro'

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY
INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF
ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD
JSON PDUMPER LCMS2 GMP

Important settings:
  value of $LANG: de_DE.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Group

Minor modes in effect:
  cursor-sensor-mode: t
  gnus-undo-mode: t
  show-paren-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/usr/share/emacs/site-lisp/elpa/po-mode-0.21/po-mode-pkg hides /usr/share/emacs/site-lisp/elpa-src/po-mode-0.21/po-mode-pkg
/usr/share/emacs/site-lisp/elpa/po-mode-0.21/po-mode-autoloads hides /usr/share/emacs/site-lisp/elpa-src/po-mode-0.21/po-mode-autoloads
/usr/share/emacs/site-lisp/elpa/po-mode-0.21/po-mode hides /usr/share/emacs/site-lisp/elpa-src/po-mode-0.21/po-mode
/usr/share/emacs/site-lisp/flim/sasl hides /usr/share/emacs/27.1/lisp/net/sasl
/usr/share/emacs/site-lisp/erc/erc-ezbounce hides /usr/share/emacs/27.1/lisp/erc/erc-ezbounce
/usr/share/emacs/site-lisp/erc/erc-stamp hides /usr/share/emacs/27.1/lisp/erc/erc-stamp
/usr/share/emacs/site-lisp/erc/erc-autoaway hides /usr/share/emacs/27.1/lisp/erc/erc-autoaway
/usr/share/emacs/site-lisp/erc/erc-track hides /usr/share/emacs/27.1/lisp/erc/erc-track
/usr/share/emacs/site-lisp/erc/erc-menu hides /usr/share/emacs/27.1/lisp/erc/erc-menu
/usr/share/emacs/site-lisp/erc/erc-networks hides /usr/share/emacs/27.1/lisp/erc/erc-networks
/usr/share/emacs/site-lisp/erc/erc-imenu hides /usr/share/emacs/27.1/lisp/erc/erc-imenu
/usr/share/emacs/site-lisp/erc/erc-pcomplete hides /usr/share/emacs/27.1/lisp/erc/erc-pcomplete
/usr/share/emacs/site-lisp/erc/erc-xdcc hides /usr/share/emacs/27.1/lisp/erc/erc-xdcc
/usr/share/emacs/site-lisp/erc/erc-fill hides /usr/share/emacs/27.1/lisp/erc/erc-fill
/usr/share/emacs/site-lisp/erc/erc hides /usr/share/emacs/27.1/lisp/erc/erc
/usr/share/emacs/site-lisp/erc/erc-services hides /usr/share/emacs/27.1/lisp/erc/erc-services
/usr/share/emacs/site-lisp/erc/erc-button hides /usr/share/emacs/27.1/lisp/erc/erc-button
/usr/share/emacs/site-lisp/erc/erc-goodies hides /usr/share/emacs/27.1/lisp/erc/erc-goodies
/usr/share/emacs/site-lisp/erc/erc-join hides /usr/share/emacs/27.1/lisp/erc/erc-join
/usr/share/emacs/site-lisp/erc/erc-notify hides /usr/share/emacs/27.1/lisp/erc/erc-notify
/usr/share/emacs/site-lisp/erc/erc-dcc hides /usr/share/emacs/27.1/lisp/erc/erc-dcc
/usr/share/emacs/site-lisp/erc/erc-backend hides /usr/share/emacs/27.1/lisp/erc/erc-backend
/usr/share/emacs/site-lisp/erc/erc-compat hides /usr/share/emacs/27.1/lisp/erc/erc-compat
/usr/share/emacs/site-lisp/erc/erc-ring hides /usr/share/emacs/27.1/lisp/erc/erc-ring
/usr/share/emacs/site-lisp/erc/erc-page hides /usr/share/emacs/27.1/lisp/erc/erc-page
/usr/share/emacs/site-lisp/erc/erc-log hides /usr/share/emacs/27.1/lisp/erc/erc-log
/usr/share/emacs/site-lisp/erc/erc-ibuffer hides /usr/share/emacs/27.1/lisp/erc/erc-ibuffer
/usr/share/emacs/site-lisp/erc/erc-identd hides /usr/share/emacs/27.1/lisp/erc/erc-identd
/usr/share/emacs/site-lisp/erc/erc-capab hides /usr/share/emacs/27.1/lisp/erc/erc-capab
/usr/share/emacs/site-lisp/erc/erc-truncate hides /usr/share/emacs/27.1/lisp/erc/erc-truncate
/usr/share/emacs/site-lisp/erc/erc-lang hides /usr/share/emacs/27.1/lisp/erc/erc-lang
/usr/share/emacs/site-lisp/erc/erc-match hides /usr/share/emacs/27.1/lisp/erc/erc-match
/usr/share/emacs/site-lisp/erc/erc-sound hides /usr/share/emacs/27.1/lisp/erc/erc-sound
/usr/share/emacs/site-lisp/erc/erc-spelling hides /usr/share/emacs/27.1/lisp/erc/erc-spelling
/usr/share/emacs/site-lisp/erc/erc-netsplit hides /usr/share/emacs/27.1/lisp/erc/erc-netsplit
/usr/share/emacs/site-lisp/erc/erc-replace hides /usr/share/emacs/27.1/lisp/erc/erc-replace
/usr/share/emacs/site-lisp/erc/erc-list hides /usr/share/emacs/27.1/lisp/erc/erc-list
/usr/share/emacs/site-lisp/erc/erc-speedbar hides /usr/share/emacs/27.1/lisp/erc/erc-speedbar
/usr/share/emacs/site-lisp/erc/erc-hecomplete hides /usr/share/emacs/27.1/lisp/obsolete/erc-hecomplete

Features:
(shadow emacsbug misearch multi-isearch eieio-opt speedbar sb-image
ezimage dframe find-func thingatpt help-fns radix-tree shr-color color
mailalias bbdb-message nnir mm-archive sort smiley ansi-color gnus-cite
mail-extr gnus-async gnus-bcklg qp gnus-ml disp-table cursor-sensor pop3
nndraft nnmh nndoc nnml nnfolder cl-extra help-mode bbdb-gnus gnutls
network-stream nsm gnus-agent gnus-srvr gnus-score score-mode nnvirtual
gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig nntp
gnus-cache gnus-sum url url-proxy url-privacy url-expand url-methods
url-history mailcap shr url-cookie url-domsuf url-util svg xml dom
gnus-group gnus-undo edmacro kmacro smtpmail sendmail gnus-start
gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo parse-time iso8601
gnus-spec gnus-int gnus-range message rmc puny dired dired-loaddefs
format-spec rfc822 mml mml-sec epa epg epg-config mm-decode mm-bodies
mm-encode mail-parse rfc2231 gmm-utils mailheader gnus-win gnus nnheader
gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums
text-property-search time-date mail-utils mm-util mail-prsvr wid-edit
bbdb-mua bbdb-com pcase crm mailabbrev bbdb derived bbdb-site timezone
battery cus-start cus-load paren cl w3m-load erc-auto bbdb-loaddefs
package easymenu browse-url url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map
url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
timer select scroll-bar mouse jit-lock font-lock syntax facemenu
font-core term/tty-colors frame minibuffer cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 339737 42964)
 (symbols 48 20018 1)
 (strings 32 94808 7244)
 (string-bytes 1 3147518)
 (vectors 16 27130)
 (vector-slots 8 597938 51908)
 (floats 8 425 258)
 (intervals 56 13103 2504)
 (buffers 1000 34))

Many Thanks in Advance!
Best Regards,
Felix
--
Felix Natter





Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#62345; Package emacs,gnus. (Sat, 19 Apr 2025 18:27:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Felix Natter <fnatter <at> gmx.net>
To: ding <at> gnus.org, bug-gnu-emacs <at> gnu.org
Subject: bug#62345: [workaround] Composing mail from secondary frame does
 not generate Gcc: header
Date: Sat, 19 Apr 2025 20:26:26 +0200
Dear Emacs / Gnus experts,

with regard to this:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62345
(TL;DR: "C-x 5 m" / "C-x 5 2, then m" fail to add a Gcc: header)

I am using (standard config from the manual):

(setq gnus-message-archive-group
      '((if (message-news-p)
            "sent-news"
          (concat "sent-mail." (format-time-string "%Y-%m")))))

Here is my analysis of the problem (Emacs 30.1, Gnus 5.13) (below I
analyzed C-x 5 m, but C-x 5 2, then m works as well, so it seems to be
similar):

- gnus-inews-insert-gcc is responsible for adding the Gcc: header
- C-x 5 m (compose-mail-other-frame) differs substantially from m
  (gnus-group-mail):
  - m (OK case): gnus-group-mail calls
    (gnus-setup-message 'message (message-mail))
    at the very end
  - C-x 5 m (FAIL case): compose-mail-other-frame also calls (message-mail)
    (according to edebug backtrace) in some way I don't understand but does NOT
    call gnus-setup-message
- gnus-setup-message creates the Gcc: creation hook:
  (add-hook 'message-header-setup-hook (lambda ()
	      (gnus-inews-insert-gcc ,group)))
- message-setup-1 (called by both OK and FAIL) runs message-header-setup-hook:
  (which is null/nil in the FAIL / C-x 5 m case):
  (save-restriction
    (message-narrow-to-headers)
    (run-hooks 'message-header-setup-hook))

workaround: I changed message-setup-1 (gnus-msg.el) to:
  (save-restriction
    (message-narrow-to-headers)
    (if (null message-header-setup-hook)
	(gnus-inews-insert-gcc "")
      (run-hooks 'message-header-setup-hook)))

Which works for me so far. Is this workaround anywhere *close* to becoming a fix?
I know it is not ready, but am I anywhere on the right track, and could someone
please help?

- gnus-setup-message: what does
  (group (make-symbol "gnus-setup-message-group")) and then
  (gnus-inews-insert-gcc ,group) do?
- how do I check whether message-header-setup-hook contains a
  "gnus-inews-insert-gcc" hook instead of checking for null?
  (P.S.: rather check for existance of Gcc: after having run the hook,
   that should be easy)
- or, as an alternative solution: can we make compose-mail-other-frame
  (transitively) call gnus-setup-message (for that I would need to understand
  how compose-mail calls message-mail)?

Many Thanks and Best Regards!
Felix
-- 
Felix Natter




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#62345; Package emacs,gnus. (Sat, 26 Apr 2025 16:11:02 GMT) Full text and rfc822 format available.

Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Uwe Brauer <oub <at> mat.ucm.es>
To: bug-gnu-emacs <at> gnu.org
Cc: ding <at> gnus.org
Subject: Re: bug#62345: [workaround] Composing mail from secondary frame does
 not generate Gcc: header
Date: Sat, 26 Apr 2025 18:09:45 +0200
[Message part 1 (text/plain, inline)]
> workaround: I changed message-setup-1 (gnus-msg.el) to:
>   (save-restriction
>     (message-narrow-to-headers)
>     (if (null message-header-setup-hook)
> 	(gnus-inews-insert-gcc "")
>       (run-hooks 'message-header-setup-hook)))

This is not part of my gnus-msg.el


 message-setup-1 is supposed to a function?

I find a function of this name in message.el but not in gnus-msg.el

Can you please clarify and if you don't mind send the modified function?

I am facing a similar problem and I am a bit tired of it I wrote a small
function that I bind to key just to insert the missing Gcc field if
necessary.

Thanks 

Uwe Brauer 


-- 
I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the EU and NATO membership of Ukraine. 

[smime.p7s (application/pkcs7-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#62345; Package emacs,gnus. (Mon, 28 Apr 2025 09:02:02 GMT) Full text and rfc822 format available.

Message #14 received at 62345 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Felix Natter <fnatter <at> gmx.net>
Cc: 62345 <at> debbugs.gnu.org
Subject: Re: bug#62345: 27.1; Composing mail from secondary frame does not
 generate Gcc: header
Date: Mon, 28 Apr 2025 11:01:44 +0200
>>>>> On Tue, 21 Mar 2023 16:17:45 +0100, Felix Natter <fnatter <at> gmx.net> said:

    Felix> Dear emacs/gnus maintainers,
    Felix> I start Gnus (M-x gnus) and compose mail in a new frame by either:
    Felix> (a) C-x 5 m
    Felix> (b) C-x 5 2, then m

    Felix> => The Gcc: header (i.e. Gcc: nnfolder+sent:sent-mail.2023-03) is not added
    Felix> to the buffer, thus the mail will be sent but not archived.

    Felix> It does work fine if I start composing from the primary frame.

    Felix> BTW: M-x gnus-bug also did not add that header ;-)

    Felix> My "Gcc" customization is as follows:

    Felix> ;; archiving sent mail/news:
    Felix> (setq gnus-message-archive-method
    Felix>       '(nnfolder "sent"
    Felix>                  (nnfolder-inhibit-expiry t)
    Felix>                  (nnfolder-directory "~/Mail/sent/")
    Felix>                  (nnfolder-active-file "~/Mail/sent/active")))
    Felix> (setq gnus-message-archive-group
    Felix>       '((if (message-news-p)
    Felix>             "sent-news"
    Felix>           (concat "sent-mail." (format-time-string "%Y-%m")))))

Whatʼs your value of `mail-user-agent'? 'm' from the *Group* buffer
will use Gnus to setup the mail buffer, and thus insert the
Gnus-specific Gcc header. 'C-x 5 m' will use `compose-mail', which
obeys `mail-user-agent', which is normally set up to do only generic
email setup via `message-mode'.

C-h v mail-user-agent

    mail-user-agent is a variable defined in `simple.el'.

    Its value is `gnus-user-agent'
    Original value was 
    `message-user-agent'

    Your preference for a mail composition package.
    Various Emacs Lisp packages (e.g. Reporter) require you to compose an
    outgoing email message.  This variable lets you specify which
    mail-sending package you prefer.

    Valid values include:

      `message-user-agent'  -- use the Message package.
                               See Info node `(message)'.
      `sendmail-user-agent' -- use the Mail package.
                               See Info node `(emacs)Sending Mail'.
      `mh-e-user-agent'     -- use the Emacs interface to the MH mail system.
                               See Info node `(mh-e)'.
      `gnus-user-agent'     -- like `message-user-agent', but with Gnus
                               paraphernalia if Gnus is running, particularly
                               the Gcc: header for archiving.

Robert
-- 




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#62345; Package emacs,gnus. (Thu, 01 May 2025 15:57:01 GMT) Full text and rfc822 format available.

Message #17 received at 62345 <at> debbugs.gnu.org (full text, mbox):

From: Felix Natter <fnatter <at> gmx.net>
To: Uwe Brauer <oub <at> mat.ucm.es>
Cc: 62345 <at> debbugs.gnu.org
Subject: Re: bug#62345: 27.1; Composing mail from secondary frame does not
 generate Gcc: header
Date: Thu, 01 May 2025 17:55:53 +0200
hello Uwe, hello emacs experts,

I hope I got the email address right :)

> Can you please clarify and if you don't mind send the modified function?

> I am facing a similar problem and I am a bit tired of it I wrote a small
> function that I bind to key just to insert the missing Gcc field if
> necessary.

The following small changes are *basically* tested with emacs 30.1 /
Gnus 5.13 (I think master has no changes there [1]):

In gnus/message.el (message-setup-1) change:

from:

  (save-restriction
    (message-narrow-to-headers)
    (run-hooks 'message-header-setup-hook))

to (sorry indentation is not proper):

  (save-restriction
    (message-narrow-to-headers)
    (run-hooks 'message-header-setup-hook)
    (unless
	(save-excursion
	  (goto-char (point-min))
	  (re-search-forward "^Gcc:" nil t))
      (gnus-inews-insert-gcc "")))


[1]
https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/gnus/message.el#n6955

Should be self-explanatory:
- first run message-header-setup-hook which normally creates the header
- if that fails (RE search fails): add using gnus-inews-insert-gcc

I would be very interested to create an official patch from this
(knowing that it's not ready yet - see the "" argument to
gnus-inews-insert-gcc!)!
[How] do you call gnus-inews-insert-gcc?

I would very much welcome your feedback!

Cheers and Best Regards,
Felix
-- 
Felix Natter
debian/rules!




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#62345; Package emacs,gnus. (Fri, 02 May 2025 12:15:02 GMT) Full text and rfc822 format available.

Message #20 received at 62345 <at> debbugs.gnu.org (full text, mbox):

From: Uwe Brauer <oub <at> mat.ucm.es>
To: Felix Natter <fnatter <at> gmx.net>
Cc: Uwe Brauer <oub <at> mat.ucm.es>, 62345 <at> debbugs.gnu.org
Subject: Re: bug#62345: 27.1; Composing mail from secondary frame does not
 generate Gcc: header
Date: Fri, 02 May 2025 14:13:49 +0200
[Message part 1 (text/plain, inline)]
>>> "FN" == Felix Natter <fnatter <at> gmx.net> writes:
Hi Felix
> hello Uwe, hello emacs experts,
> I hope I got the email address right :)


> The following small changes are *basically* tested with emacs 30.1 /
> Gnus 5.13 (I think master has no changes there [1]):

> In gnus/message.el (message-setup-1) change:

> from:

>   (save-restriction
>     (message-narrow-to-headers)
>     (run-hooks 'message-header-setup-hook))

> to (sorry indentation is not proper):

>   (save-restriction
>     (message-narrow-to-headers)
>     (run-hooks 'message-header-setup-hook)
>     (unless
> 	(save-excursion
> 	  (goto-char (point-min))
> 	  (re-search-forward "^Gcc:" nil t))
>       (gnus-inews-insert-gcc "")))

a quick reply. I tried to test it. When I merged your lines into
message.el and tried to compile, the compiler complained about
gnus-inews-insert-gcc not being defined or known.

So I had the «bright» idea to add a (require gnus-msg) to message.el

But this caused an infinite loop, when I restarted emacs

So  I am curious how did you deal with this isseu.

Uwe 
-- 
I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the EU and NATO membership of Ukraine. 

[smime.p7s (application/pkcs7-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#62345; Package emacs,gnus. (Sat, 03 May 2025 11:12:01 GMT) Full text and rfc822 format available.

Message #23 received at 62345 <at> debbugs.gnu.org (full text, mbox):

From: Felix Natter <fnatter <at> gmx.net>
To: Uwe Brauer <oub <at> mat.ucm.es>
Cc: 62345 <at> debbugs.gnu.org
Subject: Re: bug#62345: 27.1; Composing mail from secondary frame does not
 generate Gcc: header
Date: Sat, 03 May 2025 13:11:49 +0200
hello Uwe,

Uwe Brauer <oub <at> mat.ucm.es> writes:
>>>> "FN" == Felix Natter <fnatter <at> gmx.net> writes:
> Hi Felix
>> hello Uwe, hello emacs experts,
>> I hope I got the email address right :)
>
>
>> The following small changes are *basically* tested with emacs 30.1 /
>> Gnus 5.13 (I think master has no changes there [1]):
>
>> In gnus/message.el (message-setup-1) change:
>
>> from:
>
>>   (save-restriction
>>     (message-narrow-to-headers)
>>     (run-hooks 'message-header-setup-hook))
>
>> to (sorry indentation is not proper):
>
>>   (save-restriction
>>     (message-narrow-to-headers)
>>     (run-hooks 'message-header-setup-hook)
>>     (unless
>> 	(save-excursion
>> 	  (goto-char (point-min))
>> 	  (re-search-forward "^Gcc:" nil t))
>>       (gnus-inews-insert-gcc "")))
>
> a quick reply. I tried to test it. When I merged your lines into
> message.el and tried to compile, the compiler complained about
> gnus-inews-insert-gcc not being defined or known.

Good catch. I did not hit this, probably because I did not byte compile
gnus/*.el. I unzipped the lisp/gnus/*.el.gz to ~/gnus and added them
to load path in ~/.emacs.el:

(add-to-list 'load-path "~/gnus")
(require 'gnus)

However, I tried to byte-compile ~/gnus/*.el, and got only a Warning
(*Warnings*), most probably like you did, but IMHO the Gcc: header was
added.

Are you using emacs 30.1 or git master or ...?

> So I had the «bright» idea to add a (require gnus-msg) to message.el
>
> But this caused an infinite loop, when I restarted emacs
>
> So  I am curious how did you deal with this isseu.

We should have a cyclic dependency between message.el and gnus-msg.el
with my change, so I need to fix it. However, I think this only occurs 
when byte compiling message.el/gnus-msg.el (see above), so you should be
able to test it already. But *maybe* I overlooked something.

Cheers and Best Regards,
Felix
-- 
Felix Natter
debian/rules!




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#62345; Package emacs,gnus. (Sat, 03 May 2025 16:11:02 GMT) Full text and rfc822 format available.

Message #26 received at 62345 <at> debbugs.gnu.org (full text, mbox):

From: Felix Natter <fnatter <at> gmx.net>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: Uwe Brauer <oub <at> mat.ucm.es>, 62345 <at> debbugs.gnu.org
Subject: Closing bug#62345: 27.1; Composing mail from secondary frame does
 not generate Gcc: header
Date: Sat, 03 May 2025 18:09:40 +0200
close 62345

hello Robert,

Robert Pluim <rpluim <at> gmail.com> writes:

>>>>>> On Tue, 21 Mar 2023 16:17:45 +0100, Felix Natter <fnatter <at> gmx.net> said:
>
>     Felix> Dear emacs/gnus maintainers,
>     Felix> I start Gnus (M-x gnus) and compose mail in a new frame by either:
>     Felix> (a) C-x 5 m
>     Felix> (b) C-x 5 2, then m
>
>     Felix> => The Gcc: header (i.e. Gcc: nnfolder+sent:sent-mail.2023-03) is not added
>     Felix> to the buffer, thus the mail will be sent but not archived.
>
>     Felix> It does work fine if I start composing from the primary frame.
>
>     Felix> BTW: M-x gnus-bug also did not add that header ;-)
>
>     Felix> My "Gcc" customization is as follows:
>
>     Felix> ;; archiving sent mail/news:
>     Felix> (setq gnus-message-archive-method
>     Felix>       '(nnfolder "sent"
>     Felix>                  (nnfolder-inhibit-expiry t)
>     Felix>                  (nnfolder-directory "~/Mail/sent/")
>     Felix>                  (nnfolder-active-file "~/Mail/sent/active")))
>     Felix> (setq gnus-message-archive-group
>     Felix>       '((if (message-news-p)
>     Felix>             "sent-news"
>     Felix>           (concat "sent-mail." (format-time-string "%Y-%m")))))
>
> Whatʼs your value of `mail-user-agent'? 'm' from the *Group* buffer
> will use Gnus to setup the mail buffer, and thus insert the
> Gnus-specific Gcc header. 'C-x 5 m' will use `compose-mail', which
> obeys `mail-user-agent', which is normally set up to do only generic
> email setup via `message-mode'.

Indeed this bug is fixed by setting mail-user-agent to 'gnus-user-agent,
thank you very much! I wondern why this is not documented at all in the
Gnus manual :(

@Uwe: so no hacking necessary (with a crying and a laughing eye!)!

Thanks again, Cheers and Best Regards,
Felix
-- 
Felix Natter
debian/rules!




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#62345; Package emacs,gnus. (Mon, 05 May 2025 09:41:01 GMT) Full text and rfc822 format available.

Message #29 received at 62345 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Felix Natter <fnatter <at> gmx.net>
Cc: Uwe Brauer <oub <at> mat.ucm.es>, 62345 <at> debbugs.gnu.org,
 62345-done <at> debbugs.gnu.org
Subject: Re: Closing bug#62345: 27.1; Composing mail from secondary frame
 does not generate Gcc: header
Date: Mon, 05 May 2025 11:40:35 +0200
>>>>> On Sat, 03 May 2025 18:09:40 +0200, Felix Natter <fnatter <at> gmx.net> said:

    Felix> close 62345

That only works when sending to the control email address. The easy
way to do it is by sending to <bugnumber>-done, which Iʼve done here.

    Felix> Indeed this bug is fixed by setting mail-user-agent to 'gnus-user-agent,
    Felix> thank you very much! I wondern why this is not documented at all in the
    Felix> Gnus manual :(

Itʼs in the Emacs manual: (info "(emacs) Mail Methods")

Robert
-- 




Reply sent to Robert Pluim <rpluim <at> gmail.com>:
You have taken responsibility. (Mon, 05 May 2025 09:41:02 GMT) Full text and rfc822 format available.

Notification sent to Felix Natter <fnatter <at> gmx.net>:
bug acknowledged by developer. (Mon, 05 May 2025 09:41:02 GMT) Full text and rfc822 format available.

This bug report was last modified 9 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.