all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Magne Ingebrigtsen <larsi@gnus.org>
To: emacs-devel@gnu.org
Subject: Re: Ordering of command completions
Date: Sun, 07 Dec 2014 22:47:48 +0100	[thread overview]
Message-ID: <m3r3wbdtdn.fsf@stories.gnus.org> (raw)
In-Reply-To: <m3vblndu0t.fsf@stories.gnus.org> (Lars Magne Ingebrigtsen's message of "Sun, 07 Dec 2014 22:33:54 +0100")

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



  reply	other threads:[~2014-12-07 21:47 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-07 16:14 Ordering of command completions Tom
2014-12-07 16:28 ` Lars Magne Ingebrigtsen
2014-12-07 17:36   ` Andreas Schwab
2014-12-07 17:42     ` Lars Magne Ingebrigtsen
2014-12-07 21:20       ` Lars Magne Ingebrigtsen
2014-12-07 21:33         ` Lars Magne Ingebrigtsen
2014-12-07 21:47           ` Lars Magne Ingebrigtsen [this message]
2014-12-07 22:00             ` Autoload cookies (was: Ordering of command completions) Lars Magne Ingebrigtsen
2014-12-07 22:03               ` Autoload cookies Daniel Colascione
2014-12-07 22:08                 ` Lars Magne Ingebrigtsen
2014-12-07 22:06               ` Andreas Schwab
2014-12-08  0:14               ` Autoload cookies (was: Ordering of command completions) Artur Malabarba
2014-12-07 22:05             ` Ordering of command completions Óscar Fuentes
2014-12-07 22:13               ` Lars Magne Ingebrigtsen
2014-12-08  0:53                 ` Artur Malabarba
2014-12-08  0:56                   ` Artur Malabarba
2014-12-07 18:33   ` Óscar Fuentes
2014-12-07 18:42     ` Drew Adams
2014-12-07 19:37       ` Óscar Fuentes
2014-12-07 20:10         ` Drew Adams
2014-12-07 20:24           ` Óscar Fuentes
2014-12-07 20:42             ` Drew Adams
2014-12-07 21:06               ` Óscar Fuentes
2014-12-07 21:26                 ` Drew Adams
2014-12-07 18:45     ` Lars Magne Ingebrigtsen
2014-12-07 18:59       ` Óscar Fuentes
2014-12-07 20:34         ` Lars Magne Ingebrigtsen
2014-12-07 20:47           ` Drew Adams
2014-12-07 21:20   ` Stefan Monnier
2014-12-07 21:25     ` Lars Magne Ingebrigtsen
2014-12-08  9:51   ` define "out-of-tree"? Stephen Leake
2014-12-08 18:04     ` Lars Magne Ingebrigtsen
2014-12-09 11:00       ` Richard Stallman
2014-12-09 20:00     ` Karl Fogel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3r3wbdtdn.fsf@stories.gnus.org \
    --to=larsi@gnus.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.