[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Keymap initialization (was: [Emacs-diffs] master 7a2038d: Create a toggl
From: |
Stefan Monnier |
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 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
> 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
- Keymap initialization (was: [Emacs-diffs] master 7a2038d: Create a toggle between block and line comments in CC Mode),
Stefan Monnier <=
- Re: Keymap initialization (was: [Emacs-diffs] master 7a2038d: Create a toggle between block and line comments in CC Mode), Alan Mackenzie, 2017/06/26
- Re: Keymap initialization, Stefan Monnier, 2017/06/26
- Re: Keymap initialization, Alan Mackenzie, 2017/06/26
- Re: Keymap initialization, Stefan Monnier, 2017/06/26
- Re: Keymap initialization, Alan Mackenzie, 2017/06/26
- Re: Keymap initialization, Stefan Monnier, 2017/06/26
- Re: Keymap initialization, Clément Pit-Claudel, 2017/06/26