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#33263: 27.0.50; Tidying up Gnus modes Date: Tue, 06 Nov 2018 08:21:31 -0800 Message-ID: <87k1lqw510.fsf@ericabrahamsen.net> References: <877ehs1bgq.fsf@ericabrahamsen.net> <875zxbipby.fsf@gmail.com> <87o9b3za3p.fsf@ericabrahamsen.net> <8736seibdv.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1541521208 17603 195.159.176.226 (6 Nov 2018 16:20:08 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 6 Nov 2018 16:20:08 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: 33263@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 06 17:20:04 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 1gK45D-0004UQ-LO for geb-bug-gnu-emacs@m.gmane.org; Tue, 06 Nov 2018 17:20:03 +0100 Original-Received: from localhost ([::1]:41935 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gK47J-0002ng-Im for geb-bug-gnu-emacs@m.gmane.org; Tue, 06 Nov 2018 11:22:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gK47C-0002nP-6R for bug-gnu-emacs@gnu.org; Tue, 06 Nov 2018 11:22:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gK478-0000ei-5J for bug-gnu-emacs@gnu.org; Tue, 06 Nov 2018 11:22:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33271) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gK477-0000eQ-TJ for bug-gnu-emacs@gnu.org; Tue, 06 Nov 2018 11:22:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gK477-0006by-NO for bug-gnu-emacs@gnu.org; Tue, 06 Nov 2018 11:22:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <877ehs1bgq.fsf@ericabrahamsen.net> Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 06 Nov 2018 16:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33263 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.154152132025406 (code B ref -1); Tue, 06 Nov 2018 16:22:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Nov 2018 16:22:00 +0000 Original-Received: from localhost ([127.0.0.1]:37529 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gK475-0006bi-OF for submit@debbugs.gnu.org; Tue, 06 Nov 2018 11:21:59 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:46210) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gK474-0006bV-0m for submit@debbugs.gnu.org; Tue, 06 Nov 2018 11:21:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gK46x-0000Hr-0Z for submit@debbugs.gnu.org; Tue, 06 Nov 2018 11:21:52 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:40546) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gK46w-0000Ec-Aw for submit@debbugs.gnu.org; Tue, 06 Nov 2018 11:21:50 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55815) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gK46v-0002n6-Fk for bug-gnu-emacs@gnu.org; Tue, 06 Nov 2018 11:21:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gK46r-0008JN-Bc for bug-gnu-emacs@gnu.org; Tue, 06 Nov 2018 11:21:49 -0500 Original-Received: from [195.159.176.226] (port=56672 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gK46o-00085q-Ts for bug-gnu-emacs@gnu.org; Tue, 06 Nov 2018 11:21:43 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1gK44f-0003pU-8Y for bug-gnu-emacs@gnu.org; Tue, 06 Nov 2018 17:19:29 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 36 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:6MU27KYdWXgDyQVQdnhL7hjoc+4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:152104 Archived-At: Noam Postavsky writes: > Eric Abrahamsen writes: > >> Noam Postavsky writes: >> >>> Eric Abrahamsen writes: >>> >>>> +(defvar gnus-browse-mode-map (make-keymap)) >>>> >>>> (unless gnus-browse-mode-map >>>> - (setq gnus-browse-mode-map (make-keymap)) >>>> + (defvar gnus-browse-mode-map (make-keymap)) >>> >>> This doesn't look right. >> >> Hmm, you're right, I think I got confused there. TBH I don't really know >> why these things are wrapped in `unless', but I think what should have >> happened is that `gnus-browse-mode-map' is first defvar'ed to nil, and >> later setq'ed to (make-keymap). > > The usual idiom for this is > > (defvar gnus-browse-mode-map > (let ((map (make-sparse-keymap))) > (define-key map ...) > ... > map)) > > It seems that (the expansion of) gnus-define-keys relies on dynamic > binding of the map variable (i.e., it must be called after the defvar, > not inside), so that's the reason to split in two parts. Right, I got that much, I was mostly wondering why the `unless' -- it's unlikely these files would be loaded multiple times, and even if they were, that wouldn't break anything, would it?