From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 33665@debbugs.gnu.org
Subject: bug#33665: 27.0.50; Variables not set up in Gnus when hooks are run
Date: Fri, 07 Dec 2018 10:36:18 -0800 [thread overview]
Message-ID: <87pnudw5el.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <m3efattdrc.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 07 Dec 2018 19:04:07 +0100")
[-- Attachment #1: Type: text/plain, Size: 1026 bytes --]
Lars Ingebrigtsen <larsi@gnus.org> writes:
> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Lars Ingebrigtsen <larsi@gnus.org> writes:
>>
>>> It looks like gnus-newsgroup-name (and friends?) are no longer set when
>>> the summary mode hooks are run, so hooks that rely on that are now
>>> broken.
>>
>> Yes, since `gnus-summary-mode' is now a real mode, it clears local
>> variables before running the hook. The right place for that sort of hook
>> is now `gnus-summary-prepared-hook'. I tried to change all the relevant
>> hooks I could within the codebase, but I guess gnus-mdrtn.el isn't
>> publicly available? I can change the Moderation section of the manual to
>> update the installation instructions.
>
> No, you can't break third-party software that way. You have to set the
> variables the hooks expect to exist before calling the hook.
Okay. This patch should restore that behavior. I don't see any other
buffer-local variables that were being set to a specific value, other
than `gnus-newsgroup-name'.
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1581 bytes --]
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 4baf4bc826..58605826f6 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -3064,6 +3064,7 @@ gnus-summary-mode
(let ((gnus-summary-local-variables gnus-newsgroup-variables))
(gnus-summary-make-local-variables))
(gnus-summary-make-local-variables)
+ (setq gnus-newsgroup-name gnus-summary-mode-group)
(when (gnus-visual-p 'summary-menu 'menu)
(gnus-summary-make-menu-bar)
(gnus-summary-make-tool-bar))
@@ -3457,6 +3458,11 @@ gnus-summary-set-article-display-arrow
(point)
(current-buffer))))))
+(defvar gnus-summary-mode-group nil
+ "Variable for communication with `gnus-summary-mode'.
+Allows the `gnus-newsgroup-name' local variable to be set before
+the summary mode hooks are run.")
+
(defun gnus-summary-setup-buffer (group)
"Initialize summary buffer for GROUP.
This function does all setup work that relies on the specific
@@ -3476,10 +3482,11 @@ gnus-summary-setup-buffer
(not gnus-newsgroup-prepared))
(set-buffer (gnus-get-buffer-create buffer))
(setq gnus-summary-buffer (current-buffer))
- (gnus-summary-mode)
+ (let ((gnus-summary-mode-group group))
+ (gnus-summary-mode))
(when (gnus-group-quit-config group)
(set (make-local-variable 'gnus-single-article-buffer) nil))
- (setq gnus-newsgroup-name group)
+; (setq gnus-newsgroup-name group)
(turn-on-gnus-mailing-list-mode)
;; These functions don't currently depend on GROUP, but might in
;; the future.
next prev parent reply other threads:[~2018-12-07 18:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-07 16:37 bug#33665: 27.0.50; Variables not set up in Gnus when hooks are run Lars Ingebrigtsen
2018-12-07 17:25 ` Eric Abrahamsen
2018-12-07 17:52 ` Eric Abrahamsen
2018-12-07 18:04 ` Lars Ingebrigtsen
2018-12-07 18:36 ` Eric Abrahamsen [this message]
2018-12-12 14:36 ` Lars Ingebrigtsen
2018-12-12 19:52 ` Eric Abrahamsen
2018-12-19 21:57 ` Lars Ingebrigtsen
2018-12-19 22:14 ` Eric Abrahamsen
2018-12-19 22:17 ` Lars Ingebrigtsen
2018-12-19 22:30 ` Eric Abrahamsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87pnudw5el.fsf@ericabrahamsen.net \
--to=eric@ericabrahamsen.net \
--cc=33665@debbugs.gnu.org \
--cc=larsi@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).