From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "N. Jackson" Newsgroups: gmane.emacs.bugs Subject: bug#33140: 27.0.50; `gnus-posting-styles' sees nil =?UTF-8?Q?=E2=80=98message-reply-headers=E2=80=99?= variable Date: Wed, 24 Oct 2018 12:03:03 -0400 Message-ID: <8736svz614.fsf@moondust.localdomain> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1540397915 22971 195.159.176.226 (24 Oct 2018 16:18:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 24 Oct 2018 16:18:35 +0000 (UTC) To: 33140@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 24 18:18:30 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gFLrZ-0005rq-RA for geb-bug-gnu-emacs@m.gmane.org; Wed, 24 Oct 2018 18:18:30 +0200 Original-Received: from localhost ([::1]:49349 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFLtg-0001PX-EE for geb-bug-gnu-emacs@m.gmane.org; Wed, 24 Oct 2018 12:20:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFLt8-00018l-Vc for bug-gnu-emacs@gnu.org; Wed, 24 Oct 2018 12:20:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gFLt4-00026i-No for bug-gnu-emacs@gnu.org; Wed, 24 Oct 2018 12:20:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36172) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gFLt4-00026U-Jq for bug-gnu-emacs@gnu.org; Wed, 24 Oct 2018 12:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gFLt4-0005lH-8J for bug-gnu-emacs@gnu.org; Wed, 24 Oct 2018 12:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "N. Jackson" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 Oct 2018 16:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 33140 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.154039797122088 (code B ref -1); Wed, 24 Oct 2018 16:20:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Oct 2018 16:19:31 +0000 Original-Received: from localhost ([127.0.0.1]:40430 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gFLsY-0005kC-Gz for submit@debbugs.gnu.org; Wed, 24 Oct 2018 12:19:30 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37539) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gFLsW-0005jx-RE for submit@debbugs.gnu.org; Wed, 24 Oct 2018 12:19:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gFLsM-00010K-4z for submit@debbugs.gnu.org; Wed, 24 Oct 2018 12:19:22 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:42338) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gFLsJ-0000wI-QX for submit@debbugs.gnu.org; Wed, 24 Oct 2018 12:19:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFLsF-0008RM-EQ for bug-gnu-emacs@gnu.org; Wed, 24 Oct 2018 12:19:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gFLch-0000ej-GR for bug-gnu-emacs@gnu.org; Wed, 24 Oct 2018 12:03:12 -0400 Original-Received: from mail-it1-x12f.google.com ([2607:f8b0:4864:20::12f]:34531) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gFLch-0000eI-6V for bug-gnu-emacs@gnu.org; Wed, 24 Oct 2018 12:03:07 -0400 Original-Received: by mail-it1-x12f.google.com with SMTP id e81-v6so4507053itc.1 for ; Wed, 24 Oct 2018 09:03:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=icFxU/73lNJ+0d3O7rQ1KNm6mh/CXyTLFYqfL+XQG/I=; b=usmCDJ1oiJiTYhNvqOL5e14yDfFso+DzJkecHqFB2C98VXD9mWT4w4dw741ABPlA0z HEFonTiuIDOJxmvy5+r/hKaXCHktiKVOg548BtbO4KcbqtlwyXPXBRLqco+34bMr351C uwN3iUbfh04zh1R2qkdhkcBbwCAfUbPh3MWM+JDc+JyO/xqWIdNEfmM0lxo/SxyRxFfd 11nLxvbTwHOjfOh60xhTUEqv/M/AkECwJi/1qWn8ks9Gx/zfD+a724MrWoLJT8dxtI1V 95zTXGBKk8mdAuy8XTT/OkbyNbMN/V7TTFCDT37ThCwiAD3loZFQio4mDk/yNKS9aZ3D AkUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=icFxU/73lNJ+0d3O7rQ1KNm6mh/CXyTLFYqfL+XQG/I=; b=UUePtIz2DcxSy471VpPf0M0gnHoQfz9PIf3wMqgAsfGWoRgy2PGkawGGAgIrbmV/D+ vIUjItFFrnsuMkWbHX9zp2WCjZfQGF0DojAcT4/EWcl35aoQpW5ZYNFKrY0VpvEbxFG+ FFAwqxUXrv+hQQj1yX0zBLYaPtH5oM7dEUHiJwDayApoB4K2ShYxJP4EJwGwawv9rDQ/ k3nvSFlcmZmO8WUxDHGKjVq/OsgOG2WWvi2WDC4UaBxsCdjNJ1Ff2c3arOmU0fioHv5r SLGIIYj5wIXIHpJqem0PigUZgKCHDgxuezr68POw5ND3R8Veqdp21PsIqWCZ0C5g8++E Kv7g== X-Gm-Message-State: AGRZ1gI6BbjuVNizzm1TlKbB/Xw9O3yACknQOUryme1OLB/LuWB0Zx9h jdq+DvyJ95p5ZcC+BEGiTb6ZdCE9 X-Google-Smtp-Source: AJdET5f3hDWryv+QAx5rBnxAAgF/VLsylCZ2t4bGfnaRtWGtsuOI28k3+cNYj3isnxqtTuPmImtKHg== X-Received: by 2002:a02:6c83:: with SMTP id w125-v6mr2059802jab.7.1540396985273; Wed, 24 Oct 2018 09:03:05 -0700 (PDT) Original-Received: from moondust.localdomain.nodomain.none (toroon474qw-lp130-08-70-26-73-61.dsl.bell.ca. [70.26.73.61]) by smtp.gmail.com with ESMTPSA id q205-v6sm8424394itc.2.2018.10.24.09.03.03 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Oct 2018 09:03:04 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:151556 Archived-At: I'm trying to set up a Gnus posting style that makes use of the =E2=80=98message-reply-headers=E2=80=99 variable, but the behaviour I see i= ndicates 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 =E2=80=98eval=E2=80=99ed and the return value will = be used). The functions and sexps are called/=E2=80=98eval=E2=80=99ed in the message bu= ffer that is being set up. The headers of the current article are available through the =E2=80=98message-reply-headers=E2=80=99 variable, which is a vector o= f 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. =3D=3D=3D 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 " "Sat, 13 Oct 2018 18:15:25 +0300" "<838t31vpwy.fsf@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 br= oken? 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@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=3D-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=3Dnone 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))