From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs 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 Message-ID: <87pnudw5el.fsf@ericabrahamsen.net> References: <875zw5xn9a.fsf@ericabrahamsen.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1544207713 15523 195.159.176.226 (7 Dec 2018 18:35:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 7 Dec 2018 18:35:13 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 33665@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 07 19:35:09 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 1gVKxw-0003uo-1G for geb-bug-gnu-emacs@m.gmane.org; Fri, 07 Dec 2018 19:35:08 +0100 Original-Received: from localhost ([::1]:47732 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gVL02-0000AU-HM for geb-bug-gnu-emacs@m.gmane.org; Fri, 07 Dec 2018 13:37:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58461) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gVKzq-0000AM-NT for bug-gnu-emacs@gnu.org; Fri, 07 Dec 2018 13:37:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gVKzm-0004Uz-PQ for bug-gnu-emacs@gnu.org; Fri, 07 Dec 2018 13:37:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33056) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gVKzm-0004Ur-IP for bug-gnu-emacs@gnu.org; Fri, 07 Dec 2018 13:37:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gVKzm-0004AH-EA for bug-gnu-emacs@gnu.org; Fri, 07 Dec 2018 13:37:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 07 Dec 2018 18:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33665 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33665-submit@debbugs.gnu.org id=B33665.154420779115970 (code B ref 33665); Fri, 07 Dec 2018 18:37:02 +0000 Original-Received: (at 33665) by debbugs.gnu.org; 7 Dec 2018 18:36:31 +0000 Original-Received: from localhost ([127.0.0.1]:37314 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gVKzC-00049S-8z for submit@debbugs.gnu.org; Fri, 07 Dec 2018 13:36:30 -0500 Original-Received: from mail.ericabrahamsen.net ([50.56.99.223]:57107) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gVKz6-00049E-Ep for 33665@debbugs.gnu.org; Fri, 07 Dec 2018 13:36:24 -0500 Original-Received: from localhost (71-212-20-199.tukw.qwest.net [71.212.20.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 8FDFD3FB5D; Fri, 7 Dec 2018 18:36:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ericabrahamsen.net; s=mail; t=1544207779; bh=AS+eQEaNRpnxMt5ewvtjkXZ0nayA9AZpGQHGU8B7NGc=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=q7S9ia1tG5O7MqNbsJyP41vlypiZCnOLnRtKJ1pqDw84brqkbZZ76D50BQ9vhgp8h SSr3eTrnbEEbx2Y2Zs9wJh4SCKa3+n1z8E885WQaa56wSL4Rp5oXDDEtO0ANF2dskl rMpouWjrq4/IKP/YlUgV2LhAg+52t13rgU9PncJQ= In-Reply-To: (Lars Ingebrigtsen's message of "Fri, 07 Dec 2018 19:04:07 +0100") 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:153189 Archived-At: --=-=-= Content-Type: text/plain Lars Ingebrigtsen writes: > Eric Abrahamsen writes: > >> Lars Ingebrigtsen 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'. --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=patch.txt 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. --=-=-=--