unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: emacs-devel@gnu.org
Cc: Alan Mackenzie <acm@muc.de>
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	[thread overview]
Message-ID: <jwv7ezzbw29.fsf-monnier+emacsdiffs@gnu.org> (raw)
In-Reply-To: <20170615210440.2D57C206CD@vcs0.savannah.gnu.org> (Alan Mackenzie's message of "Thu, 15 Jun 2017 17:04:39 -0400 (EDT)")

>     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



       reply	other threads:[~2017-06-25 21:29 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   ` Stefan Monnier [this message]
2017-06-26 16:39     ` Keymap initialization (was: [Emacs-diffs] master 7a2038d: Create a toggle between block and line comments in CC Mode) Alan Mackenzie
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=jwv7ezzbw29.fsf-monnier+emacsdiffs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    /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).