emacs-devel
[Top][All Lists]
Advanced

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

Re: [External] : Re: command mode-specificity [was: scratch/command 064f


From: Dmitry Gutov
Subject: Re: [External] : Re: command mode-specificity [was: scratch/command 064f146 1/2: Change...]
Date: Wed, 17 Feb 2021 17:59:26 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 17.02.2021 17:47, Eli Zaretskii wrote:
If the implementation were to change, such that it didn't actually
remove commands from the list of completion candidate, then perhaps we
could make this the default (but even then I'm not sure).

What if we remove them from the list of completions, but still allow them if the user typed one out explicitly and pressed RET?

Like this:

diff --git a/lisp/simple.el b/lisp/simple.el
index 215f4399f4..b2ae560c45 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1967,7 +1967,9 @@ read-extended-command
             '(metadata
               (affixation-function . read-extended-command--affixation)
               (category . command))
-           (complete-with-action action obarray string pred)))
+           (complete-with-action action obarray string
+                                 (unless (eq action 'lambda)
+                                   pred))))
        (lambda (sym)
          (and (commandp sym)
               (funcall read-extended-command-predicate sym buffer)))



reply via email to

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