From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Keymap initialization Date: Mon, 26 Jun 2017 13:41:50 -0400 Message-ID: References: <20170615210438.18512.16715@vcs0.savannah.gnu.org> <20170615210440.2D57C206CD@vcs0.savannah.gnu.org> <20170626163957.GB2471@acm> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1498498963 17064 195.159.176.226 (26 Jun 2017 17:42:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 26 Jun 2017 17:42:43 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 26 19:42:39 2017 Return-path: Envelope-to: ged-emacs-devel@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 1dPY21-0004AD-OR for ged-emacs-devel@m.gmane.org; Mon, 26 Jun 2017 19:42:37 +0200 Original-Received: from localhost ([::1]:47829 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPY26-0001I5-Jf for ged-emacs-devel@m.gmane.org; Mon, 26 Jun 2017 13:42:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42537) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPY1Q-0001Hz-0c for emacs-devel@gnu.org; Mon, 26 Jun 2017 13:42:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dPY1L-0006wC-5t for emacs-devel@gnu.org; Mon, 26 Jun 2017 13:42:00 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:33973) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPY1K-0006vp-Uy for emacs-devel@gnu.org; Mon, 26 Jun 2017 13:41:55 -0400 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id v5QHfoFq030872; Mon, 26 Jun 2017 13:41:52 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 10EE66627F; Mon, 26 Jun 2017 13:41:50 -0400 (EDT) In-Reply-To: <20170626163957.GB2471@acm> (Alan Mackenzie's message of "Mon, 26 Jun 2017 16:39:57 +0000") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6056=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6056> : inlines <5950> : streams <1751620> : uri <2451262> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:216004 Archived-At: >> This is anti-idiomatic: Emacs's own code has been making the >> opposite change over the years in most/all bundled packages. > I got sick and tired of having to do M-: (makunbound 'foo-map) before > loading files with changed keymaps. As a developer yourself, you should > welcome such changes. C-M-x on the (defvar foo-map ...) takes care of it as well. Or using `defconst` instead of `defvar` would do the trick also (although that's also less idiomatic). Or write a new M-x reload-file which causes all the defvars to be re-evaluated. >> I consider indispensable, but I really don't see why CC-mode's keymaps >> need to behave differently from all other major modes. > They don't. Obviously they do, which is why you made the change. > Precisely how these keymaps are constructed and loaded is of > lesser importance. It seems important enough for you to change from the idiomatic form to a non-idiomatic one. But yes, I do think it's of lesser importance, which is why I think it's more important that the downsides (e.g. the need to C-M-x or (makunbound 'foo-map), or the need to re-run your .emacs after reloading cc-mode.el, ...) be standardized. IOW, rather than make CC-mode yet-a-bit-more different from the rest of Emacs, I wish you would try to find a way to solve your problem globally. If this annoyance affects you, there's a good chance it affects many other developers, so finding a general solution would be a lot better. Stefan