emacs-devel
[Top][All Lists]
Advanced

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

Re: Per-mode obarray for M-x


From: Scott Frazer
Subject: Re: Per-mode obarray for M-x
Date: Sun, 6 Mar 2011 10:56:54 -0500

On Sun, Mar 6, 2011 at 8:29 AM, Eli Zaretskii <address@hidden> wrote:
>> Date: Sun, 6 Mar 2011 08:04:42 -0500
>> From: Scott Frazer <address@hidden>
>>
>> Here's why I'd like this.  There are some commands I run somewhat
>> often, but they have long and/or difficult to remember names.  For
>> example auto-revert-tail-mode.  I am thinking as I type "Is it
>> auto-revert-tail-mode or auto-tail-revert-mode?"
>
> Does the problem still exist in the latest Emacs versions?  E.g., in
> Emacs 23.3, "M-x auto-tail TAB" completes to auto-revert-tail-mode
> without anything special you'd need to do.  The secret is that
> completion was lately extended, and is now much smarter.  In fact,
> there are a few non-default completion styles which will be even more
> aggressive than the above miracle.
>
> IOW, maybe your problem was already solved?
>

While the new completion modes are cool and would help in that
particular instance, in my other example of "html" there would be many
hits to sort through.  Those were just some illustrative examples
anyway, I'd still like the general mechanism.

It (naively) seems not too difficult.  There would be a buffer-local
obarray variable that gets populated during major-mode setup, a macro
that wraps creating a defun with a mode-specific prefix and interns
the defun (and the shortened version?  Should the prefixed one go in
the 'main' obarray?) in the buffer-local obarray, then when you M-x it
looks in the buffer-local obarray first.  Or something like that.

Scott



reply via email to

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