emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: defcustom :type to use for a key sequence?


From: Lennart Borgman
Subject: Re: defcustom :type to use for a key sequence?
Date: Fri, 16 Dec 2005 00:55:46 +0100
User-agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)

Kim F. Storm wrote:

address@hidden (Kim F. Storm) writes:

With my suggestion, you just write C-g -- much simpler and equally flexible.

A user must know a lot about internal representation -- with my suggestion,
he just has to do C-h c to learn how to write the keys he's interested in
and copy the output directly to the field.


There is already a :type key-sequence (defined as a restricted-sexp),
but it is only used in one place:

M-x customize-variable RET mouse-region-delete-keys RET

.. which seems to be completely broken when I try it.
E.g. if I press one of the "INS" buttons strange things happen.


I still think it would make a lot of sense to make :type key-sequence
edit a string rather than a sexp.

The actual value would still be a vector or string, but before editing
it would be passed through "key-description" to give the string to
edit, and after editing the string would be passed through "kbd" (aka
"read-kbd-macro") to make the value to save in the variable.

It would be great if there was some way to actually press the keys
to insert, rather than to have to spell them out -- is there some
way to bind a key to have a special meaning while editing such a string?
E.g. to add C-M-S-$ to the string, one could press e.g. C-u C-M-S-$
I do not think it is implemented now, but it would be rather easy to do I believe. Just add a keymap to the field where you enter the keys. But it seems a little bit more complicated to edit it, but not at all impossible.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]