emacs-devel
[Top][All Lists]
Advanced

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

Limit what M-x TAB lists?


From: Stephen J. Turnbull
Subject: Limit what M-x TAB lists?
Date: Fri, 27 Dec 2013 16:29:13 +0900

Lars Ingebrigtsen writes:
 > Here's today's unrealistic idea: Wouldn't it be nice if `M-x fooTAB' was
 > more useful?
 > 
 > For instance, if I type `M-x vc-dTAB' in this buffer, I get the
 > following: 
 > 
 > Possible completions are:
 > vc-default-check-headers     vc-default-mark-resolved
 > vc-default-revision-completion-table         vc-delete-file
 > vc-diff      vc-dir
 > vc-dir-delete-file   vc-dir-find-file
 > vc-dir-find-file-other-window        vc-dir-hide-state
 > vc-dir-hide-up-to-date       vc-dir-ignore
 > vc-dir-isearch       vc-dir-isearch-regexp
 > vc-dir-kill-dir-status-process       vc-dir-kill-line
 > vc-dir-mark  vc-dir-mark-all-files
 > vc-dir-menu  vc-dir-mode
 > vc-dir-next-directory        vc-dir-next-line
 > vc-dir-previous-directory    vc-dir-previous-line
 > vc-dir-query-replace-regexp  vc-dir-refresh
 > vc-dir-search        vc-dir-show-fileentry
 > vc-dir-toggle-mark   vc-dir-unmark
 > vc-dir-unmark-all-files      vc-dir-unmark-file-up

vc-default-...
vc-delete-file
vc-diff
vc-dir
vc-dir-...

is simple to compute algorithmically (string processing).  It doesn't
do what you want, obviously, but it sure reduces the visual clutter.

Another algorithmic approach would be to mark each symbol defined in a
keymap with the property 'completion-keymap and the keymap (list of
keymaps).  If none of the keymaps in which a symbol is defined are
currently active, filter the symbol out.  Heck, maybe the property is
a premature optimization; perhaps which keymaps bind the function and
whether they are active can be done sufficiently quickly.




reply via email to

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