[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Ordering of command completions
From: |
Lars Magne Ingebrigtsen |
Subject: |
Re: Ordering of command completions |
Date: |
Sun, 07 Dec 2014 22:47:48 +0100 |
User-agent: |
Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux) |
I've done ten minutes of exploratory hacking to see whether it would be
a lot of work to get this to work. The `declare' solution turns out to
be rather trivial, apparently.
The patch below is all that's needed to add a new `declare' form. And
then, after marking some stuff up, we just have to make the `M-x'
completion function examine the `mode' `function-get' value, and compare
it to the current modes in effect.
So if we decide to do something like this, getting the framework in
place is very little work. Annotating all of Emacs is a bit larger
(ahem), but it can be done gradually, and `M-x TAB' would work a bit
better each week...
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index 8bf63ea..098f1c4 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -105,6 +105,11 @@ The return value of this function is not used."
''pure (list 'quote val)))
"If non-nil, the compiler can replace calls with their return value.
This may shift errors from run-time to compile-time.")
+ (list 'mode
+ #'(lambda (f _args val)
+ (list 'function-put (list 'quote f)
+ ''mode (list 'quote val)))
+ "If non-nil, this command belongs in a specific mode, or a list of
modes.")
(list 'side-effect-free
#'(lambda (f _args val)
(list 'function-put (list 'quote f)
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
- Ordering of command completions, Tom, 2014/12/07
- Re: Ordering of command completions, Lars Magne Ingebrigtsen, 2014/12/07
- Re: Ordering of command completions, Andreas Schwab, 2014/12/07
- Re: Ordering of command completions, Lars Magne Ingebrigtsen, 2014/12/07
- Re: Ordering of command completions, Lars Magne Ingebrigtsen, 2014/12/07
- Re: Ordering of command completions, Lars Magne Ingebrigtsen, 2014/12/07
- Re: Ordering of command completions,
Lars Magne Ingebrigtsen <=
- Autoload cookies (was: Ordering of command completions), Lars Magne Ingebrigtsen, 2014/12/07
- Re: Autoload cookies, Daniel Colascione, 2014/12/07
- Re: Autoload cookies, Lars Magne Ingebrigtsen, 2014/12/07
- Re: Autoload cookies, Andreas Schwab, 2014/12/07
- Re: Autoload cookies (was: Ordering of command completions), Artur Malabarba, 2014/12/07
- Re: Ordering of command completions, Óscar Fuentes, 2014/12/07
- Re: Ordering of command completions, Lars Magne Ingebrigtsen, 2014/12/07
- Re: Ordering of command completions, Artur Malabarba, 2014/12/07
- Re: Ordering of command completions, Artur Malabarba, 2014/12/07
Re: Ordering of command completions, Óscar Fuentes, 2014/12/07