From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Christoph Scholtes <cschol2112@googlemail.com>
Cc: emacs-devel@gnu.org
Subject: Re: completion-list-mode-map
Date: Wed, 06 Jul 2011 08:49:56 -0400 [thread overview]
Message-ID: <jwvwrfvtwci.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <4E13BC5A.2070007@gmail.com> (Christoph Scholtes's message of "Tue, 05 Jul 2011 19:37:30 -0600")
>>> or is there implicit inheritance of the keymap when deriving from
>>> special mode?
>> Yes, that inheritance is implicit (it's set up when the mode is
>> activated) unless the keymap already has a parent.
> I started looking into this and it looks like it is more complicated than
> I thought. I grepped for `'mode-class 'special' and got a pageful of
> hits. Some of these modes are already derived from special modes, some are
> not. Looking at the ones that are not, I am wondering if they should be.
Note: if a mode derives from special-mode, then it does not need the
(put 'foo-mode 'mode-class 'special).
> - arc-mode's mode-class is special. However, arc-mode is not derived from
> special-mode. Should it be?
The general rule should be that it is, but check that it's compatible.
Basically special-mode has a read-only buffer and some standard
key-bindings, so as long as there's no deep conflict in the key-bindings
and the mode is read-only, it should derive.
For this reason I think arc-mode should derive from special-mode.
> - comint-mode is derived from fundamental-mode, but it's mode-class is also
> special. Should it be derived from special-mode instead?
Here on the other hand, we have some clear conflicts: comint-mode is not
read-only and can't bind `q' to quit-window and `g' to revert-buffer.
So I don't think it should inherit from special-mode.
> In other cases modes derive from special-mode already, but the key map
> parent is not set to special-mode map. For example, tar-mode. Should the key
> map parent always be special-mode-map?
define-derived-mode will set the keymap parent to special-mode-map if
the mode's keymap doesn't already have a parent.
> What prompted me to look into this in the first place was the inconsistent
> behavior of `q'/`z' when trying to quit/kill buffers. special-mode map
> defines `q' as quit-window and `z' as kill-this-buffer, but some keymaps
> define `q' as, for example, thumbs-kill-buffer. How do we handle
> these cases?
(One of) the purposes of special-mode is to standardize key bindings, so
I think that thumbs-kill-buffer will have to go: it does something
similar to quit-window, and the differences are just an annoyance.
In other cases, the key-binding conflicts may need to be resolved by finding
new keys, rather than just ditching the old binding.
Stefan
next prev parent reply other threads:[~2011-07-06 12:49 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-04 14:20 completion-list-mode-map Christoph Scholtes
2011-06-06 15:31 ` completion-list-mode-map Stefan Monnier
2011-06-26 23:00 ` completion-list-mode-map Christoph Scholtes
2011-06-29 3:04 ` completion-list-mode-map Stefan Monnier
2011-07-02 16:00 ` completion-list-mode-map Christoph Scholtes
2011-07-02 22:30 ` completion-list-mode-map Stefan Monnier
2011-07-03 0:18 ` completion-list-mode-map Christoph Scholtes
2011-07-03 5:38 ` completion-list-mode-map Stefan Monnier
2011-07-06 1:37 ` completion-list-mode-map Christoph Scholtes
2011-07-06 12:49 ` Stefan Monnier [this message]
2011-07-10 2:41 ` completion-list-mode-map Christoph Scholtes
2011-07-12 3:20 ` completion-list-mode-map Stefan Monnier
2011-07-12 4:20 ` completion-list-mode-map Christoph Scholtes
2011-07-14 2:19 ` completion-list-mode-map Christoph Scholtes
2011-07-12 11:29 ` completion-list-mode-map Juanma Barranquero
2011-07-13 3:57 ` completion-list-mode-map Stefan Monnier
2011-08-02 1:59 ` completion-list-mode-map Christoph Scholtes
2011-08-14 17:34 ` completion-list-mode-map Chong Yidong
2011-08-15 2:11 ` completion-list-mode-map Stefan Monnier
2011-08-15 4:48 ` completion-list-mode-map Thierry Volpiatto
2011-08-15 15:12 ` completion-list-mode-map Chong Yidong
2011-08-16 16:54 ` completion-list-mode-map Stefan Monnier
2011-08-16 18:53 ` completion-list-mode-map martin rudalics
2011-08-16 20:29 ` completion-list-mode-map Stefan Monnier
2011-08-16 20:54 ` completion-list-mode-map martin rudalics
2011-08-16 22:06 ` completion-list-mode-map Chong Yidong
2011-08-17 9:06 ` completion-list-mode-map martin rudalics
2011-08-17 20:39 ` completion-list-mode-map Chong Yidong
2011-08-18 6:57 ` completion-list-mode-map martin rudalics
2011-08-18 22:46 ` completion-list-mode-map Chong Yidong
2011-08-19 7:13 ` completion-list-mode-map martin rudalics
2011-08-20 19:20 ` completion-list-mode-map Chong Yidong
2011-08-21 8:45 ` completion-list-mode-map martin rudalics
2011-08-21 20:26 ` completion-list-mode-map Chong Yidong
2011-08-22 9:00 ` completion-list-mode-map Juri Linkov
2011-08-22 10:05 ` completion-list-mode-map Štěpán Němec
2011-08-22 19:52 ` completion-list-mode-map Stefan Monnier
2011-08-22 15:00 ` completion-list-mode-map Chong Yidong
2011-08-23 9:44 ` completion-list-mode-map martin rudalics
2011-09-03 17:19 ` completion-list-mode-map Christoph Scholtes
2011-09-03 18:33 ` completion-list-mode-map Chong Yidong
2011-09-03 20:01 ` completion-list-mode-map Christoph Scholtes
2011-09-05 14:40 ` completion-list-mode-map Chong Yidong
2011-09-05 18:02 ` completion-list-mode-map Andreas Schwab
2011-08-17 1:19 ` completion-list-mode-map Stefan Monnier
2011-08-17 9:06 ` completion-list-mode-map martin rudalics
-- strict thread matches above, loose matches on Subject: below --
2011-03-16 22:46 completion-list-mode-map Christoph Scholtes
2011-03-17 2:22 ` completion-list-mode-map Stefan Monnier
2011-03-17 5:00 ` completion-list-mode-map Christoph Scholtes
2011-03-17 12:53 ` completion-list-mode-map Wojciech Meyer
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvwrfvtwci.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=cschol2112@googlemail.com \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.