[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: help create function alias
From: |
Drew Adams |
Subject: |
RE: help create function alias |
Date: |
Thu, 9 Dec 2010 13:35:51 -0800 |
(`x' = Xah; `s' = Stefan.)
x> would it be nice to have a general mechanism to execute commands with
x> just their inits? maybe a command named
x> "execute-extended-command-by-init" with a keybinding. e.g. i have
x> lots aliases:
x> ; shortening of often used commands
x> (defalias 'rn 'wdired-change-to-wdired-mode)
x> (defalias 'dj 'dired-jump)
...
x> plus about 40 more on personal commands...
x>
x> <maybe a command named "execute-extended-command-by-init" with a
x> keybinding.>
x> humm.. actually does that exist somewhere? seems not hard to write...
s> >> (define-key minibuffer-local-completion-map
s> >> [(meta return)]
s> >> (lambda ()
s> >> (interactive)
s> >> (minibuffer-force-complete)
s> >> (minibuffer-complete-and-exit)))
s> >> and then M-x i-d M-RET
>
> > Thanks, lovely stuff, but i dash d not as intuitive as
> > my desired simplistic i d mnemonic or abbreviation.
s>
s> Of course. My suggestion is not nearly as simple as the thing you
s> asked for. Its main interest is that it's applicable to all commands
s> rather than just to insert-date.
s> Actually, without any change, you can already try M-x i-d TAB, tho
s> you'll find there are many other commands that match this pattern.
In Icicles, you can use `C-x SPC' (by default) instead of `M-x', to execute both
commands and command abbreviations, using completion. The completion is lax, so
you can even create new command abbreviations on the fly. (You can also create
or edit abbreviations using Customize.)
http://www.emacswiki.org/emacs/Icicles_-_Multi_M-x#toc6
- Re: help create function alias, (continued)
- Re: help create function alias, Adam, 2010/12/09
- Re: help create function alias, Pascal J. Bourguignon, 2010/12/08
- Re: help create function alias, Adam, 2010/12/09
- Re: help create function alias, Andreas Politz, 2010/12/08
- Re: help create function alias, Adam, 2010/12/09
- Re: help create function alias, Barry Margolin, 2010/12/08
- Re: help create function alias, Pascal J. Bourguignon, 2010/12/08
Re: help create function alias, Stefan Monnier, 2010/12/08