From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Keymap initialization Date: Mon, 26 Jun 2017 18:08:07 +0000 Message-ID: <20170626180807.GC2471@acm> 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; charset=us-ascii X-Trace: blaine.gmane.org 1498500692 13147 195.159.176.226 (26 Jun 2017 18:11:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 26 Jun 2017 18:11:32 +0000 (UTC) User-Agent: Mutt/1.7.2 (2016-11-26) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 26 20:11:28 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 1dPYTv-0003Bl-O8 for ged-emacs-devel@m.gmane.org; Mon, 26 Jun 2017 20:11:27 +0200 Original-Received: from localhost ([::1]:47934 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPYU1-0008Bk-1r for ged-emacs-devel@m.gmane.org; Mon, 26 Jun 2017 14:11:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPYRs-0006UW-Uu for emacs-devel@gnu.org; Mon, 26 Jun 2017 14:09:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dPYRp-00032m-OT for emacs-devel@gnu.org; Mon, 26 Jun 2017 14:09:20 -0400 Original-Received: from ocolin.muc.de ([193.149.48.4]:40947 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1dPYRp-0002za-C3 for emacs-devel@gnu.org; Mon, 26 Jun 2017 14:09:17 -0400 Original-Received: (qmail 84465 invoked by uid 3782); 26 Jun 2017 18:09:15 -0000 Original-Received: from acm.muc.de (p548C6649.dip0.t-ipconnect.de [84.140.102.73]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 26 Jun 2017 20:09:14 +0200 Original-Received: (qmail 2903 invoked by uid 1000); 26 Jun 2017 18:08:07 -0000 Content-Disposition: inline In-Reply-To: X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.4 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:216006 Archived-At: Hello, Stefan. On Mon, Jun 26, 2017 at 13:41:50 -0400, Stefan Monnier wrote: > >> 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. Workarounds, every one. > >> 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. . It's of near zero importance to the Emacs team, it's of quite some importance to the hacker who's currently changing the key maps. > 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. Why do you think things should be standardised? (Not a rhetorical question) > 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. That seems to presume that the way things are already done in Emacs is at or near some optimum, and deviating from that way is therefore sub-optimal. I don't think there's any evidence for this. I see some "standard" ways of doing things in Emacs which I don't think are good. People should feel free to try out various ways of doing things. Only this way can new ideas come forth, leading to a gradual improvement in Emacs when these ideas spread. Setting key map entries at load time could be a general solution to that particular annoyance. People, having seen it in CC Mode, will be able to adapt it for their own modes, should they see fit. > Stefan -- Alan Mackenzie (Nuremberg, Germany).