From: Juri Linkov <juri@linkov.net>
To: Drew Adams <drew.adams@oracle.com>
Cc: Eli Zaretskii <eliz@gnu.org>,
Stefan Kangas <stefankangas@gmail.com>,
"emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re: [External] : Re: master 927b885 1/3: Disable filtering of commands in M-x completion
Date: Thu, 18 Feb 2021 11:33:57 +0200 [thread overview]
Message-ID: <87sg5toh2y.fsf@mail.linkov.net> (raw)
In-Reply-To: <SA2PR10MB4474594B3C7157F60795E284F3869@SA2PR10MB4474.namprd10.prod.outlook.com> (Drew Adams's message of "Wed, 17 Feb 2021 22:18:00 +0000")
>> Also maybe a key to toggle filtering in the already active completion
>> (and a key to toggle sorting).
>
> For filtering, why toggle instead of cycle, or
> completion-choose a sort order? I.e., why allow
> for only two choices?
I agree, cycling is better.
>> I'd like also to suggest to filter out
>> commands having "r" in their interactive specs - they signal
>> an error when the region is not active, so no need to show them.
>
> Are you sure they raise an error?
>
> (defun foo (&optional beg end)
> (interactive "r")
> (message "FOO"))
Yes, I'm sure. 'M-x foo RET' without an active region raises an error:
command-execute: The mark is not active now
> I also think it's misleading to base filtering on
> an `interactive' form that uses a string. That's
> inherently fragile/limiting. It won't apply to a
> form that evaluates a sexp to provide the args.
> The resulting incoherence will confuse users.
This means that more complex interactive specs need
manual tagging using a new tag:
(declare (predicate (use-region-p)))
>> Also filter out commands with "*" in read-only buffers.
>
> Same problem. Relying on a string arg to `interactive'
> is not a great idea, I think.
Same tag:
(declare (predicate (not buffer-read-only)))
>> `describe-command' is a very good idea for searching
>> and discovering commands.
>
> I mentioned that I defined that long ago. But I'll
> also mention that `describe-function' with a prefix
> arg already gives you that behavior. Oops! Nope,
> that too is something I defined long ago in
> `help-fns+.el'.
>
> Similarly, I defined `describe-option', and a prefix
> arg to (my definition of) `describe-variable' limits
> choices to user options (like `describe-option').
Using a prefix arg for 'C-h f' and 'C-h v' to limit the list
of completions would be nice.
But I guess M-x can't use a prefix arg to limit completions?
next prev parent reply other threads:[~2021-02-18 9:33 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210217165944.26910.26583@vcs0.savannah.gnu.org>
[not found] ` <20210217165946.030D420DFC@vcs0.savannah.gnu.org>
2021-02-17 19:27 ` master 927b885 1/3: Disable filtering of commands in M-x completion Stefan Kangas
2021-02-17 20:01 ` Juri Linkov
2021-02-17 22:18 ` [External] : " Drew Adams
2021-02-18 9:33 ` Juri Linkov [this message]
2021-02-18 16:25 ` Drew Adams
2021-02-18 17:22 ` Juri Linkov
2021-02-18 18:24 ` Drew Adams
2021-02-18 19:03 ` Juri Linkov
2021-02-18 19:18 ` Drew Adams
2021-02-18 19:35 ` Eli Zaretskii
2021-02-18 19:47 ` Drew Adams
2021-02-18 19:58 ` Eli Zaretskii
2021-02-18 20:11 ` Drew Adams
2021-02-18 20:22 ` Drew Adams
2021-02-18 20:25 ` Eli Zaretskii
2021-02-18 20:45 ` Drew Adams
2021-02-19 13:17 ` Eli Zaretskii
2021-02-19 17:53 ` Drew Adams
2021-02-19 18:38 ` Eli Zaretskii
2021-02-18 23:15 ` martin rudalics
2021-02-18 23:32 ` Drew Adams
2021-02-19 8:37 ` Eli Zaretskii
2021-02-19 17:42 ` Drew Adams
2021-02-18 19:38 ` Eli Zaretskii
2021-02-18 19:49 ` Drew Adams
2021-02-18 19:58 ` Eli Zaretskii
2021-02-18 20:26 ` Drew Adams
2021-02-17 20:04 ` Eli Zaretskii
2021-02-17 20:31 ` Stefan Kangas
2021-02-17 20:12 ` [External] : " Drew Adams
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sg5toh2y.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=drew.adams@oracle.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=stefankangas@gmail.com \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).