[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Key bindings proposal
From: |
Uday S Reddy |
Subject: |
Re: Key bindings proposal |
Date: |
Mon, 2 Aug 2010 11:58:20 +0100 |
Stuart Hacking writes:
> To me, this sounds a lot like personal preference. I already have an
> emacs-lisp file full of global and mode specific keybindings and
> another with some convenience defaliases. These make sense for the way
> I work, but I'm sure they would be completely inappropriate for
> certain other users.
Excellent. The only "personal" thing I see about it is that you might
have picked aliases based on personal preference. But there is no
reason why the concept of giving such aliases is personal. That is a
generally useful idea.
> Is your suggestion to automatically alias functions by the current
> major mode? (by, for example, removing the prefix? (dired-do-isearch
> -> isearch))
Indeed, that is one part of the suggestion. The part 2 of the
suggestion is to allow key bindings for such aliases, which would then
be widely applicable across several modes.
> Or, do you want a simple method of aliasing commands across modes? How
> would this work?
>
> (define-multi-alias 'isearch
> ('dired-mode 'dired-do-isearch)
> ...
> ...
> (t 'isearch))
Do you mean you already have such an aliasing scheme? I suppose one
can dispatch on the major mode. That is neat!
It is not a general solution, of course, since it is based on a closed
world assumption about what modes one needs to deal with. But it is a
good starting point.
> the 'architecture' that I use is a combination of `defalias',
> `add-hook', and `define-key' in my personal init files. Am I doing
> something wrong?
So, I suppose you will let dired-mode do all its self-righteous key
bindings and then use a hook to overwrite all of them with your own
key bindings? I think I am beginning to like this
software-as-the-enemy principle!
Cheers,
Uday