unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: emacs-devel@gnu.org
Subject: Re: Keymap initialization (was: [Emacs-diffs] master 7a2038d: Create a toggle between block and line comments in CC Mode)
Date: Mon, 26 Jun 2017 16:39:57 +0000	[thread overview]
Message-ID: <20170626163957.GB2471@acm> (raw)
In-Reply-To: <jwv7ezzbw29.fsf-monnier+emacsdiffs@gnu.org>

Hello, Stefan.

On Sun, Jun 25, 2017 at 17:29:56 -0400, Stefan Monnier wrote:
> >     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.

As the commit message (the bit you snipped) said.

> >  (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.

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.

> 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.

They don't.  You press a pertinent key combination and the key maps take
you to the matching command.  Precisely how these keymaps are
constructed and loaded is of lesser importance.

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).



  reply	other threads:[~2017-06-26 16:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170615210438.18512.16715@vcs0.savannah.gnu.org>
     [not found] ` <20170615210440.2D57C206CD@vcs0.savannah.gnu.org>
2017-06-25 21:29   ` Keymap initialization (was: [Emacs-diffs] master 7a2038d: Create a toggle between block and line comments in CC Mode) Stefan Monnier
2017-06-26 16:39     ` Alan Mackenzie [this message]
2017-06-26 17:41       ` Keymap initialization Stefan Monnier
2017-06-26 18:08         ` Alan Mackenzie
2017-06-26 20:27           ` Stefan Monnier
2017-06-26 21:13             ` Alan Mackenzie
2017-06-27  2:34               ` Stefan Monnier
2017-06-26 20:08         ` Clément Pit-Claudel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170626163957.GB2471@acm \
    --to=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).