emacs-devel
[Top][All Lists]
Advanced

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

Re: master 695f679: Remove ; ; ; ###tramp-autoload cookie from Tramp def


From: Basil L. Contovounesios
Subject: Re: master 695f679: Remove ; ; ; ###tramp-autoload cookie from Tramp defcustoms (Bug#47063)
Date: Fri, 26 Mar 2021 18:18:52 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>>> Yup; if it's hoisted out of the loop, there'd be no performance impact,
>>>> but it would make it less useful, though -- as with erroring out, you'd
>>>> get no completion.
>>>
>>> It'd make more sense to just keep the current (not-filtered) completion
>>> list, so you still get completion to work.
>>
>> If we stick with the original patch, then that would mean returning
>> non-nil rather than nil if completion-predicate fails, right?
>
> I don't think whether we include the command for which the predicate
> burped is important: either way is fine.

I think including it is slightly better: say 5x5 has a
completion-predicate that burps.  If this excludes it from completions,
then typing M-x 5x5 RET will actually invoke 5x5-crack, which I think is
undesirable.

> OTOH, it would be preferable if a burping predicate wouldn't prevent
> the inclusion of other commands in the completion list.  It's probably
> tolerable to just prevent completion altogether in case of an error,
> but not to prevent `M-x` altogether.

I therefore propose we put the safety net around the call to
read-extended-command-predicate, with burps having the same effect as if
read-extended-command-predicate were nil.

This allows both M-x and M-x completion to continue to work, has no
discernible performance cost AFAICT, and does not invoke unintended
commands.

The only downside I can see is that the error message becomes visible in
the echo area only after the user has entered some text which matches
the burping command (otherwise the error message just gets printed to
*Messages*).  But that's fine AFAIC.

WDYT?

-- 
Basil



reply via email to

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