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: Keymap initialization (was: [Emacs-diffs] master 7a2038d: Create a toggle between block and line comments in CC Mode) Date: Sun, 25 Jun 2017 17:29:56 -0400 Message-ID: References: <20170615210438.18512.16715@vcs0.savannah.gnu.org> <20170615210440.2D57C206CD@vcs0.savannah.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1498426244 23313 195.159.176.226 (25 Jun 2017 21:30:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 25 Jun 2017 21:30:44 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: Alan Mackenzie To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 25 23:30:36 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 1dPF73-0005XK-KI for ged-emacs-devel@m.gmane.org; Sun, 25 Jun 2017 23:30:33 +0200 Original-Received: from localhost ([::1]:43908 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPF78-0002Vs-MS for ged-emacs-devel@m.gmane.org; Sun, 25 Jun 2017 17:30:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPF6b-0002US-Np for emacs-devel@gnu.org; Sun, 25 Jun 2017 17:30:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dPF6X-0007k3-Qk for emacs-devel@gnu.org; Sun, 25 Jun 2017 17:30:05 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:40474) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPF6X-0007jS-Lf for emacs-devel@gnu.org; Sun, 25 Jun 2017 17:30:01 -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 v5PLTuRZ001300; Sun, 25 Jun 2017 17:29:57 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 6764C66273; Sun, 25 Jun 2017 17:29:56 -0400 (EDT) In-Reply-To: <20170615210440.2D57C206CD@vcs0.savannah.gnu.org> (Alan Mackenzie's message of "Thu, 15 Jun 2017 17:04:39 -0400 (EDT)") 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, RV6055=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6055> : inlines <5949> : streams <1751500> : uri <2450627> 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:215983 Archived-At: > Create a toggle between block and line comments in CC Mode. [...] > (c-mode-map, c++-mode-map, objc-mode-map, java-mode-map, idl-mode-map) > (pike-mode-map, awk-mode-map): Make entries in these key maps each time > the mode is loaded rather than just once per Emacs session. This seems completely unrelated. > (defvar pike-mode-map > (let ((map (c-make-inherited-keymap))) > - ;; Additional bindings. > - (define-key map "\C-c\C-e" 'c-macro-expand) > map) > "Keymap used in pike-mode buffers.") > +;; Additional bindings. > +(define-key pike-mode-map "\C-c\C-e" 'c-macro-expand) This is anti-idiomatic: Emacs's own code has been making the opposite change over the years in most/all bundled packages. There are many ways to skin this cat; the two alternatives above have both advantages and disadvantages, so I think we should agree on one and stick to it. Consistency is not Emacs's forte and is not something that I consider indispensable, but I really don't see why CC-mode's keymaps need to behave differently from all other major modes. Stefan