* Are there exist any registry for reserved key binding?
@ 2011-11-11 23:33 Oleksandr Gavenko
2011-11-11 23:45 ` Drew Adams
0 siblings, 1 reply; 5+ messages in thread
From: Oleksandr Gavenko @ 2011-11-11 23:33 UTC (permalink / raw)
To: help-gnu-emacs
Some of key binding reserved by Emacs distribution (like C-x ..., C-c ...).
Some of key binding reserved by external packages (like C-x C-j ... for
jabber or C-c , ... by semantic).
Some key binding recommended on emacswiki (like C-c r for org-remember).
When I make own mode I would like to select key bindings that does not
interference with most other packages/modes.
What are the best practice/recommendations to archive this goal?
--
Best regards!
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: Are there exist any registry for reserved key binding?
2011-11-11 23:33 Are there exist any registry for reserved key binding? Oleksandr Gavenko
@ 2011-11-11 23:45 ` Drew Adams
2011-11-12 0:03 ` Drew Adams
2011-11-12 12:00 ` Oleksandr Gavenko
0 siblings, 2 replies; 5+ messages in thread
From: Drew Adams @ 2011-11-11 23:45 UTC (permalink / raw)
To: 'Oleksandr Gavenko', help-gnu-emacs
> When I make own mode I would like to select key bindings that does not
> interference with most other packages/modes.
> What are the best practice/recommendations to archive this goal?
(elisp) `Key Binding Conventions'
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: Are there exist any registry for reserved key binding?
2011-11-11 23:45 ` Drew Adams
@ 2011-11-12 0:03 ` Drew Adams
2011-11-12 12:00 ` Oleksandr Gavenko
1 sibling, 0 replies; 5+ messages in thread
From: Drew Adams @ 2011-11-12 0:03 UTC (permalink / raw)
To: 'Oleksandr Gavenko', help-gnu-emacs
> > When I make own mode I would like to select key bindings
> > that does not interference with most other packages/modes.
> > What are the best practice/recommendations to archive this goal?
>
> (elisp) `Key Binding Conventions'
BTW, in Info, `i' is your friend. It looks things up in the index, providing
completion. You could have found this information yourself by:
1. Guessing that it was in the Elisp manual somewhere.
2. Using `i' in that manual, then typing `key TAB'.
For #2 you would have seen "key binding, conventions for" as one of the
completion candidates. Simple.
---
Even easier -
If you used Icicles, you could have just typed `convention' or `key' and hit
`S-TAB' for apropos completion. And you could have typed either `key S-SPC
convention' or `convention S-SPC key' to get the right candidate directly.
`S-SPC' means "Narrow the set of current completion candidates to those that
also match...". You can combine as many completion patterns as you like this
way, progressively narrowing the set of candidates. That's much, much easier
than trying to come up with a fancy pattern (e.g. a single regexp) that matches
only the same small set of candidates.
http://www.emacswiki.org/emacs/Icicles_-_Progressive_Completion
You can also use `C-~' to subtract a set of matches - another way to narrow the
set of candidates.
http://www.emacswiki.org/emacs/Icicles_-_Nutshell_View#ChippingAway
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Are there exist any registry for reserved key binding?
2011-11-11 23:45 ` Drew Adams
2011-11-12 0:03 ` Drew Adams
@ 2011-11-12 12:00 ` Oleksandr Gavenko
2011-11-12 14:51 ` Drew Adams
1 sibling, 1 reply; 5+ messages in thread
From: Oleksandr Gavenko @ 2011-11-12 12:00 UTC (permalink / raw)
To: help-gnu-emacs
On 2011-11-12, Drew Adams wrote:
>> When I make own mode I would like to select key bindings that does not
>> interference with most other packages/modes.
>> What are the best practice/recommendations to archive this goal?
>
> (elisp) `Key Binding Conventions'
>
Thanks for reference.
So any major/minor mode designer MUST follow this rules.
I look to 'jabber-keymap.el':
(defvar jabber-global-keymap
...
"Global Jabber keymap (usually under C-x C-j)")
(define-key ctl-x-map "\C-j" jabber-global-keymap)
So this package define 'C-x C-j' globally. If another package use this key
binding user must resolve conflict manually?
Are there any guide to avoid conflicts?
My suggestion is to check most popular packages and make some thing different
key bindings. But globally maintained key binding registry make life much
easy...
--
Best regards!
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: Are there exist any registry for reserved key binding?
2011-11-12 12:00 ` Oleksandr Gavenko
@ 2011-11-12 14:51 ` Drew Adams
0 siblings, 0 replies; 5+ messages in thread
From: Drew Adams @ 2011-11-12 14:51 UTC (permalink / raw)
To: 'Oleksandr Gavenko', help-gnu-emacs
> > (elisp) `Key Binding Conventions'
>
> So any major/minor mode designer MUST follow this rules.
No, there is no MUST. There is no code-convention police.
Judgment is by code users, not tribunal. Users include individuals and other
code (e.g. libraries).
The reason for such conventions is to help make it easier for different bits of
code to get along together peacefully. And to make it easier for users to use
such code.
> 'jabber-keymap.el': So this package define 'C-x C-j' globally.
Did you see any guideline at (elisp) `Key Binding Conventions' that says please
do not bind a key in the `C-x' keymap? AFAIK, that is not proscribed.
> If another package use this key binding user must resolve
> conflict manually?
Guess so.
If you find what you think to be a mismatch wrt the suggested coding conventions
(they are guidelines, not enforced laws), consider reporting it to the code's
author/maintainer as a possible bug. S?he will most likely appreciate it, if it
truly goes against the guidelines.
> Are there any guide to avoid conflicts?
Just the suggested conventions, AFAIK.
> My suggestion is to check most popular packages and make some
> thing different key bindings. But globally maintained key
> binding registry make life much easy...
Consider sending your suggestion as an Emacs enhancement request, via `M-x
report-emacs-bug' (that is for enhancement requests, in addition to bugs). Or
bring up your suggestion on the Emacs development list, emacs-devel@gnu.org.
(help-gnu-emacs@gnu.org is for help with GNU Emacs.)
But keep this in mind, if it helps: Emacs has been around for 35 years or so.
This kind of thing has been dealt with by thousands of users and code libraries
over the decades. That's not to say that you might not have a better idea, but
it might give you some perspective on the problem you feel you've discovered.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-11-12 14:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-11 23:33 Are there exist any registry for reserved key binding? Oleksandr Gavenko
2011-11-11 23:45 ` Drew Adams
2011-11-12 0:03 ` Drew Adams
2011-11-12 12:00 ` Oleksandr Gavenko
2011-11-12 14:51 ` Drew Adams
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).