GNU bug report logs - #33140
27.0.50; `gnus-posting-styles' sees nil ‘message-reply-headers’ variable

Previous Next

Package: emacs;

Reported by: "N. Jackson" <nljlistbox2 <at> gmail.com>

Date: Wed, 24 Oct 2018 16:20:01 UTC

Severity: normal

Tags: fixed

Found in version 27.0.50

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 33140 in the body.
You can then email your comments to 33140 AT debbugs.gnu.org in the normal way.

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:
bug#33140; Package emacs. (Wed, 24 Oct 2018 16:20:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "N. Jackson" <nljlistbox2 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 24 Oct 2018 16:20:02 GMT) Full text and rfc822 format available.

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

From: "N. Jackson" <nljlistbox2 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; `gnus-posting-styles' sees nil ‘message-reply-headers’ variable
Date: Wed, 24 Oct 2018 12:03:03 -0400
I'm trying to set up a Gnus posting style that makes use of the
‘message-reply-headers’ variable, but the behaviour I see indicates that
this variable is always nil (in the context where the posting styles are
evaluated).

It seems (this is a wild guess) that the function
`gnus-configure-posting-styles' that applies the posting styles that
match, and which is called from `message-mode-hook' (I believe), is
called before `message-reply-headers' is set.

Either that, or `gnus-configure-posting-styles' is evaluated in the
context of the wrong buffer (`message-reply-headers' is buffer local to
the *unsent reply...* buffer).

In (info "(gnus)Posting Styles") it says:

   The attribute value can be a string, a function with zero arguments
  (the return value will be used), a variable (its value will be used)
  or a list (it will be ‘eval’ed and the return value will be used). The
  functions and sexps are called/‘eval’ed in the message buffer that is
  being set up. The headers of the current article are available through
  the ‘message-reply-headers’ variable, which is a vector of the
  following headers: number subject from date id references chars lines
  xref extra.

If I am understanding this documentation correctly,
`message-reply-headers' should be available when posting styles are
evaluated.

===

For example, with the following test setting for `gnus-posting-styles',

  (setq gnus-posting-styles
    '((""		; Catch all posting style.
       (eval (if message-reply-headers
		(message "`message-reply-headers' is set.")
		(message "`message-reply-headers' is not set."))
       )
      )
     )
  )

If I reply to a message in the Gnus summary buffer

  R		; `gnus-summary-reply-with-original'.

the following message is printed in the echo area:

  `message-reply-headers' is not set.

. But if I then do

  C-h v message-reply-headers RET

(in the new *unsent reply...* buffer), I'm told

  message-reply-headers is a variable defined in `message.el'.
  Its value is
  [0 "Re: Packing of union fields and bool_bf" "Eli Zaretskii <eliz <at> gnu.org>" "Sat, 13 Oct 2018 18:15:25 +0300" "<838t31vpwy.fsf <at> gnu.org>" nil 0 0 ""]
  Local in buffer *unsent reply to Eli Zaretskii*; global value is nil

  Documentation:
  The headers of the current replied article.
  It is a vector of the following headers:
  [number subject from date id references chars lines xref extra].

  [back]

Am I missing something here, or is the Gnus posting styles functionality broken?

Note: To be fair, the paragraph quoted above from the Gnus manual only
says that `message-reply-headers' can be used for the attribute value;
it doesn't say that it can be used when the "attribute" is `eval'.
However, the following does not work either (no "Cc" header is inserted
in the new message):

  (setq gnus-posting-styles
    '((""		; Catch all posting style.
       ;; Set the "Cc" header of the new message to the "From"
       ;; address of the replied-to message.
       (Cc (elt message-reply-headers 2))
       )
      )
     )
  )

but evaluating `(elt message-reply-headers 2)' in the new *unsent
reply...* buffer gives a good value, and furthermore (just to narrow
down where the problem is), the following works fine (the "Cc" header is
inserted):

  (setq gnus-posting-styles
    '((""		; Catch all posting style.
       ;; Set the "Cc" header of the new message to the "From"
       ;; address of the replied-to message.
       (Cc "john.doe <at> example.com")
       )
      )
     )
  )

.


In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.26)
 of 2018-10-24 built on moondust.localdomain
Repository revision: 00027ff9d0f646662458bdb47cc7e2214f439698
Windowing system distributor 'Fedora Project', version 11.0.11906000
System Description: Fedora 27 (Workstation Edition)

Configured using:
 'configure 'CFLAGS=-O3 -g3 -gdwarf-4''

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS GLIB NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM THREADS LCMS2 GMP

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

Major mode: Summary

Minor modes in effect:
  hl-line-mode: t
  TeX-PDF-mode: t
  diff-auto-refine-mode: t
  pdf-occur-global-minor-mode: t
  shell-dirtrack-mode: t
  recentf-mode: t
  display-battery-mode: t
  display-time-mode: t
  show-paren-mode: t
  savehist-mode: t
  save-place-mode: t
  electric-pair-mode: t
  desktop-save-mode: t
  delete-selection-mode: t
  cua-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-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
  temp-buffer-resize-mode: t
  buffer-read-only: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  global-visual-line-mode: t
  visual-line-mode: t
  transient-mark-mode: t

Features:
(shadow emacsbug misearch multi-isearch eieio-opt speedbar sb-image
ezimage dframe debug backtrace sort mm-archive gnus-bcklg gnus-cite
bbdb-message sendmail cl-print help-fns radix-tree gnus-async qp
mail-extr gnus-ml disp-table hl-line nndraft nnmh utf-7 gnutls epa-file
network-stream nnfolder bbdb-gnus nnnil 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 dired-aux preview prv-emacs tex-buf font-latex
latex latex-flymake flymake-proc flymake thingatpt tex-ispell tex-style
tex dbus tex-mode vc-git diff-mode sh-script smie executable
org-duration org-eldoc flyspell ispell org-w3m org-rmail org-mhe org-irc
org-info org-habit org-gnus nnir gnus-sum gnus-group gnus-undo
gnus-start gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo
parse-time gnus-spec gnus-int gnus-range message rfc822 mml mml-sec epa
gmm-utils mailheader gnus-win gnus nnheader gnus-util rmail
rmail-loaddefs mail-utils org-docview doc-view org-bibtex bibtex
org-bbdb pdf-occur ibuf-ext ibuffer ibuffer-loaddefs tablist
tablist-filter semantic/wisent/comp semantic/wisent
semantic/wisent/wisent semantic/util-modes semantic/util semantic
semantic/tag semantic/lex semantic/fw mode-local cedet dired-x dired
dired-loaddefs pdf-isearch pdf-misc imenu pdf-tools compile cus-edit
pdf-view bookmark pp jka-compr pdf-cache pdf-info tq pdf-util image-mode
org-agenda org-element avl-tree generator org advice org-macro
org-footnote org-pcomplete org-list org-faces org-entities time-date
noutline outline easy-mmode org-version ob-shell shell pcomplete ob-R
ob-python ob-plantuml ob-org ob-gnuplot ob-ditaa ob-calc calc-store
calc-trail calc-ext calc calc-loaddefs calc-macs ob-awk ob-dot ob-maxima
ob-latex ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table
ob-keys ob-exp ob-comint comint ansi-color ring ob-core ob-eval
org-compat org-macs org-loaddefs format-spec find-func bbdb-mua
bbdb-anniv diary-lib diary-loaddefs cal-menu calendar cal-loaddefs
bbdb-com crm mailabbrev bbdb bbdb-site timezone ido debbugs soap-client
mm-decode mm-bodies mm-encode url-http url-auth mail-parse rfc2231
rfc2047 rfc2045 mm-util ietf-drums mail-prsvr url-gw nsm rmc puny url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util mailcap warnings rng-xsd rng-dt rng-util xsd-regexp
xml edmacro kmacro recentf tree-widget wid-edit battery time
wheatgrass-theme paren savehist saveplace elec-pair desktop frameset
delsel cua-base cus-start cus-load mule-util tex-site ess-generics info
finder-inf package let-alist derived pcase cl-extra help-mode easymenu
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json map url-vars seq byte-opt gv bytecomp
byte-compile cconv epg epg-config subr-x 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 menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame 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 minibuffer 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 move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 758095 175653)
 (symbols 48 113738 1)
 (strings 32 193416 20794)
 (string-bytes 1 6153705)
 (vectors 16 90152)
 (vector-slots 8 2130710 378334)
 (floats 8 520 948)
 (intervals 56 13519 113)
 (buffers 992 90))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33140; Package emacs. (Wed, 05 Dec 2018 20:55:02 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#33140: 27.0.50; `gnus-posting-styles' sees nil
 ‘message-reply-headers’ variable
Date: Wed, 05 Dec 2018 12:54:06 -0800
"N. Jackson" <nljlistbox2 <at> gmail.com> writes:

> I'm trying to set up a Gnus posting style that makes use of the
> ‘message-reply-headers’ variable, but the behaviour I see indicates that
> this variable is always nil (in the context where the posting styles are
> evaluated).
>
> It seems (this is a wild guess) that the function
> `gnus-configure-posting-styles' that applies the posting styles that
> match, and which is called from `message-mode-hook' (I believe), is
> called before `message-reply-headers' is set.
>
> Either that, or `gnus-configure-posting-styles' is evaluated in the
> context of the wrong buffer (`message-reply-headers' is buffer local to
> the *unsent reply...* buffer).

So far as I can tell, the problem is the former --
`gnus-configure-posting-styles' is called before `message-reply-headers'
is set.

Both `message-reply' and `message-followup' first call
`message-pop-to-buffer' (which ends up calling `message-mode' and thus
the `message-mode-hooks', and thus `gnus-configure-posting-styles').

Then they set `message-reply-headers'.

Then they call `message-setup', which calls `message-setup-1', which
runs the `message-setup-hook', which would be a spot where
`message-reply-headers' would be accessible.

I will check and see if this changed sometime recently.

I would say that posting-style configuration could be moved to the
`message-setup-hook', except that that would be guaranteed to wreck all
manner of existing configurations and get us lots of angry emails.

But... I think that's the issue.

E





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33140; Package emacs. (Wed, 05 Dec 2018 21:06:01 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 33140 <at> debbugs.gnu.org
Subject: Re: bug#33140: 27.0.50; `gnus-posting-styles' sees nil
 ‘message-reply-headers’ variable
Date: Wed, 05 Dec 2018 16:05:34 -0500
Hi, please reply-to-all else the submitter won't see your response if
they aren't subscribed to the bug list.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33140; Package emacs. (Wed, 05 Dec 2018 21:14:02 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Glenn Morris <rgm <at> gnu.org>
Cc: nljlistbox2 <at> gmail.com, 33140 <at> debbugs.gnu.org
Subject: Re: bug#33140: 27.0.50; `gnus-posting-styles' sees nil
 ‘message-reply-headers’ variable
Date: Wed, 05 Dec 2018 13:13:20 -0800
Sorry, hit the wrong key.

On 12/05/18 16:05 PM, Glenn Morris wrote:
> Hi, please reply-to-all else the submitter won't see your response if
> they aren't subscribed to the bug list.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33140; Package emacs. (Fri, 07 Dec 2018 01:58:01 GMT) Full text and rfc822 format available.

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

From: "N. Jackson" <nljlistbox2 <at> gmail.com>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 33140 <at> debbugs.gnu.org
Subject: Re: bug#33140: 27.0.50; `gnus-posting-styles' sees nil
 ‘message-reply-headers’ variable
Date: Thu, 06 Dec 2018 20:57:05 -0500
At 12:54 -0800 on Wednesday 2018-12-05, Eric Abrahamsen wrote:

> "N. Jackson" <nljlistbox2 <at> gmail.com> writes:
>
>> I'm trying to set up a Gnus posting style that makes use of the
>> ‘message-reply-headers’ variable, but the behaviour I see indicates that
>> this variable is always nil (in the context where the posting styles are
>> evaluated).
>>
>> It seems (this is a wild guess) that the function
>> `gnus-configure-posting-styles' that applies the posting styles that
>> match, and which is called from `message-mode-hook' (I believe), is
>> called before `message-reply-headers' is set.
>>
>> Either that, or `gnus-configure-posting-styles' is evaluated in the
>> context of the wrong buffer (`message-reply-headers' is buffer local to
>> the *unsent reply...* buffer).
>
> So far as I can tell, the problem is the former --
> `gnus-configure-posting-styles' is called before `message-reply-headers'
> is set.
>
> Both `message-reply' and `message-followup' first call
> `message-pop-to-buffer' (which ends up calling `message-mode' and thus
> the `message-mode-hooks', and thus `gnus-configure-posting-styles').
>
> Then they set `message-reply-headers'.
>
> Then they call `message-setup', which calls `message-setup-1', which
> runs the `message-setup-hook', which would be a spot where
> `message-reply-headers' would be accessible.
>
> I will check and see if this changed sometime recently.

I haven't been able to convince myself that `message-reply-headers' can
ever have worked properly with Gnus posting styles. 

> I would say that posting-style configuration could be moved to the
> `message-setup-hook',

That sounds right, I think. 

> except that that would be guaranteed to wreck all manner of existing
> configurations and get us lots of angry emails.

Maybe. I haven't been able to think of how it would negatively affect
existing setups, but probably I'm just lacking in imagination!






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33140; Package emacs. (Fri, 07 Dec 2018 03:18:02 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: "N. Jackson" <nljlistbox2 <at> gmail.com>
Cc: 33140 <at> debbugs.gnu.org
Subject: Re: bug#33140: 27.0.50; `gnus-posting-styles' sees nil
 ‘message-reply-headers’ variable
Date: Thu, 06 Dec 2018 19:17:09 -0800
"N. Jackson" <nljlistbox2 <at> gmail.com> writes:

> At 12:54 -0800 on Wednesday 2018-12-05, Eric Abrahamsen wrote:
>
>> "N. Jackson" <nljlistbox2 <at> gmail.com> writes:
>>

[...]

>> I will check and see if this changed sometime recently.
>
> I haven't been able to convince myself that `message-reply-headers' can
> ever have worked properly with Gnus posting styles. 
>
>> I would say that posting-style configuration could be moved to the
>> `message-setup-hook',
>
> That sounds right, I think. 

The other possibility is: `gnus-configure-posting-styles' adds all its
actions to `message-setup-hook'. Perhaps the way it's meant to work is:
g-c-p-s adds *forms* to the message-setup-hook, but those forms aren't
actually evaluated until the hook is running, at which point we should
have access to everything we need.

I would need to look more closely at it to tell if that's the case, or
if it *could* be the case, but it would be one way that this code might
once have worked.

>> except that that would be guaranteed to wreck all manner of existing
>> configurations and get us lots of angry emails.
>
> Maybe. I haven't been able to think of how it would negatively affect
> existing setups, but probably I'm just lacking in imagination!

You'd be amazed at the number of ways things can blow up!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33140; Package emacs. (Fri, 07 Dec 2018 03:23:02 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#33140: 27.0.50; `gnus-posting-styles' sees nil
 ‘message-reply-headers’ variable
Date: Thu, 06 Dec 2018 19:22:17 -0800
Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:

> "N. Jackson" <nljlistbox2 <at> gmail.com> writes:
>
>> At 12:54 -0800 on Wednesday 2018-12-05, Eric Abrahamsen wrote:
>>
>>> "N. Jackson" <nljlistbox2 <at> gmail.com> writes:
>>>
>
> [...]
>
>>> I will check and see if this changed sometime recently.
>>
>> I haven't been able to convince myself that `message-reply-headers' can
>> ever have worked properly with Gnus posting styles. 
>>
>>> I would say that posting-style configuration could be moved to the
>>> `message-setup-hook',
>>
>> That sounds right, I think. 
>
> The other possibility is: `gnus-configure-posting-styles' adds all its
> actions to `message-setup-hook'. Perhaps the way it's meant to work is:
> g-c-p-s adds *forms* to the message-setup-hook, but those forms aren't
> actually evaluated until the hook is running, at which point we should
> have access to everything we need.

Just noticed that gnus-msg.el doesn't have lexical-binding set to t. I'm
not clever enough to know, without sitting down to think, how that might
affect things, but it's something to look at. Need to go out now,
though...





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33140; Package emacs. (Thu, 10 Jan 2019 22:48:01 GMT) Full text and rfc822 format available.

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

From: Óscar Fuentes <ofv <at> wanadoo.es>
To: 33140 <at> debbugs.gnu.org
Subject: Re: bug#33140: 27.0.50; `gnus-posting-styles' sees nil
 ‘message-reply-headers’ variable
Date: Thu, 10 Jan 2019 23:47:49 +0100
I discovered this bug report after wasting some time trying to figure
out what was wrong with my code. Emacs 26.1 here.

Activating lexical binding in gnus-msg.el has no effect.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33140; Package emacs. (Mon, 13 May 2019 20:41:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 33140 <at> debbugs.gnu.org
Subject: Re: bug#33140: 27.0.50; `gnus-posting-styles' sees nil
 ‘message-reply-headers’ variable
Date: Mon, 13 May 2019 16:40:48 -0400
Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:

> Just noticed that gnus-msg.el doesn't have lexical-binding set to t. I'm
> not clever enough to know, without sitting down to think, how that might
> affect things, but it's something to look at. Need to go out now,
> though...

It shouldn't affect things in this area in one way or another -- all
these variables are defvarred and therefore have dynamic extent...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33140; Package emacs. (Thu, 16 May 2019 18:37:02 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 33140 <at> debbugs.gnu.org
Subject: Re: bug#33140: 27.0.50; `gnus-posting-styles' sees nil
 ‘message-reply-headers’ variable
Date: Thu, 16 May 2019 11:36:06 -0700
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
>
>> Just noticed that gnus-msg.el doesn't have lexical-binding set to t. I'm
>> not clever enough to know, without sitting down to think, how that might
>> affect things, but it's something to look at. Need to go out now,
>> though...
>
> It shouldn't affect things in this area in one way or another -- all
> these variables are defvarred and therefore have dynamic extent...

I'll try turning it on locally and see what happens.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33140; Package emacs. (Sat, 22 Jun 2019 13:25:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: "N. Jackson" <nljlistbox2 <at> gmail.com>, 33140 <at> debbugs.gnu.org
Subject: Re: bug#33140: 27.0.50; `gnus-posting-styles' sees nil
 ‘message-reply-headers’ variable
Date: Sat, 22 Jun 2019 15:24:10 +0200
Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:

> The other possibility is: `gnus-configure-posting-styles' adds all its
> actions to `message-setup-hook'. Perhaps the way it's meant to work is:
> g-c-p-s adds *forms* to the message-setup-hook, but those forms aren't
> actually evaluated until the hook is running, at which point we should
> have access to everything we need.
>
> I would need to look more closely at it to tell if that's the case, or
> if it *could* be the case, but it would be one way that this code might
> once have worked.

Sounds reasonable to me...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33140; Package emacs. (Sun, 22 Sep 2019 22:48:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: "N. Jackson" <nljlistbox2 <at> gmail.com>
Cc: 33140 <at> debbugs.gnu.org
Subject: Re: bug#33140: 27.0.50; `gnus-posting-styles' sees nil
 ‘message-reply-headers’ variable
Date: Mon, 23 Sep 2019 00:47:08 +0200
"N. Jackson" <nljlistbox2 <at> gmail.com> writes:

> Either that, or `gnus-configure-posting-styles' is evaluated in the
> context of the wrong buffer (`message-reply-headers' is buffer local to
> the *unsent reply...* buffer).
>
> In (info "(gnus)Posting Styles") it says:
>
>    The attribute value can be a string, a function with zero arguments
>   (the return value will be used), a variable (its value will be used)
>   or a list (it will be ‘eval’ed and the return value will be used). The
>   functions and sexps are called/‘eval’ed in the message buffer that is
>   being set up. The headers of the current article are available through
>   the ‘message-reply-headers’ variable, which is a vector of the
>   following headers: number subject from date id references chars lines
>   xref extra.

I think it's just wrong -- I don't think this has ever been possible.

message-mode makes message-reply-headers buffer-local, and
message-reply-headers is then set afterwards, which is logical.  But the
Gnus posting styles is called from message-mode-hook, and the variable
is nil at this point.

So I've just removed the faulty documentation -- you can't use the
message stuff here.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 22 Sep 2019 22:48:04 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 33140 <at> debbugs.gnu.org and "N. Jackson" <nljlistbox2 <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 22 Sep 2019 22:48:04 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 21 Oct 2019 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 161 days ago.

Previous Next


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