ilisp keybindings in emacs
Bill Clementson <[email protected]> Wed, 16 Apr 2003 20:37:06 -0700 (PDT)
| Newsgroups | gmane.lisp.ilisp.general |
|---|---|
| Message-ID | <[email protected]> |
I am curious as to what other people do with respect
to keybindings when using ilisp in emacs. When I
originally created the CL Cookbook page on setting up
an Emacs IDE for Common Lisp, I thought that The Right
Thing was to use the fsf keybindings for ilisp.
However, in hindsight, I'm not sure if this is the
best thing to recommend to newbies. As I see it, there
are a number of different alternatives - each with
it's own pros and cons. Here are the options as I see
them:
1. Use the default keybindings that come with ilisp
(setq ilisp-*use-fsf-compliant-keybindings* nil).
Pros: Maximum number of ilisp functions have a
keybinding associated with them. Cons: The default
bindings do not conform to the standard keybindings
that are recommended for emacs packages. This means
that (although they may be good mnemonic matches to
the ilisp commands, they might confuse emacs newbies
(in the long term) as well as be harder for
experienced emacs users to become accustomed to.
2. Use the default keybindings that come with ilisp
but change the prefix from C-z to C-c (setq
ilisp-*prefix* "\C-c"). Pros: Same as #1 with closer
conformance to emacs standards. Cons: This approach
uses up keys that are supposed to be reserved for user
definition.
3. Use the fsf-recommended standard emacs mappings
with ilisp (setq ilisp-*use-fsf-compliant-keybindings*
t). Pros: Conforms to emacs standards for external
packages and leaves available the greatest number of
user-definable keys. Cons: Not all the ilisp commands
are mapped if fsf-compliant bindings are selected (I'm
not sure why not as many functions are mapped when
this option is selected - maybe someone who is aware
of the history of ilisp can comment).
4. Use a hybrid approach of #2 & #3, using fsf
keybindings where available but using the non-fsf
keybindings when no fsf keybinding has been defined.
This could be achieved by making 2 changes to ilisp:
a. Adding a custom variable that controls this
option in ilisp-def.el:
(defvar ilisp-*use-default-if-no-fsf* t)
b. Modify a function in ilisp-key.el:
(defun ilisp-safe-define-key (keymap key command
&optional fsf-key)
"In KEYMAP, bind KEY to COMMAND.
If optional fourth argument FSF-KEY is non-nil, then
iff
`ilisp-*use-fsf-compliant-keybindings*' is non-nil,
bind FSF-KEY
instead of KEY, unless FSF-KEY is a symbol, in which
case do nothing."
;; Check boundp as well as nilp -- paranoia always
pays, and this
;; code only gets run at setup time anyway:
(if (and fsf-key
(boundp
'ilisp-*use-fsf-compliant-keybindings*)
ilisp-*use-fsf-compliant-keybindings*
(boundp 'ilisp-*use-default-if-no-fsf*)
ilisp-*use-default-if-no-fsf*
(symbolp fsf-key))
(setq fsf-key key))
(if (and fsf-key
(boundp
'ilisp-*use-fsf-compliant-keybindings*)
ilisp-*use-fsf-compliant-keybindings*)
(setq key fsf-key))
(unless (symbolp key)
(define-key keymap key command)))
5. Add the missing commands to the fsf keybindings in
ilisp-key.el. Pros: Maximum number of ilisp commands
have direct keybindings set up "out of the box" and
the keybindings are (mostly) in conformance with fsf
emacs conventions. Cons: Since many of the mnemonic
keybindings will not be available, it will be
necessary to use non-mnemonic keybindings - these will
be harder for newbies to get accustomed to.
Options #1-#3 do not require any source code changes
to ilisp while options #4 & #5 do require source code
changes. As I said at the beginning, my initial
preference was to do #3. However, I no longer am
sure that is the right approach. Looking at Franz's
ELI package, they seem to use a combination of fsf &
non-fsf keybindings (generally using the keys that fsf
has defined as reserved for user-defined keybindings).
I don't like option #1. I have been playing around
with
options #2 & #4 over the last couple of weeks and my
current preference is for #2 (e.g. - just change the
prefix to C-c and use the default keybindings).
However, option #5 may also be worth doing (just
to get a complete set of keybindings that can be used
in the fsf-compatibility mode). I know that I can use
whatever I want to, however, for the CL Cookbook page,
what do other people feel is the best recommendation
to make to newbies? Also, what do you use yourself?
I don't ususally cross-post; however, I am posting
this to both c.l.l. and the ilisp mailing list so that
I can get a range of opinions. TIA.
--
Bill Clementson
__________________________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf