emacs-devel
[Top][All Lists]
Advanced

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

Re: Current mode command discovery


From: Óscar Fuentes
Subject: Re: Current mode command discovery
Date: Sun, 14 Feb 2021 21:49:46 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Dmitry Gutov <dgutov@yandex.ru> writes:

> On 14.02.2021 22:00, Óscar Fuentes wrote:
>> That only works with major modes, which IMO is enough to disqualify it,
>
> Extending the implementation to minor modes should be straightforward.
>
>> but on addition it uses crude heuristics for detecting the commands
>> related to the major mode.
>
> It's fairly crude, but do you imagine any frequent cases where it
> would lead to false positives?

AFAIU it fails for commands that are defined outside of the source file
that `provide's the feature. This happens with large packages, which
incidentally are the ones that define more commands. So the heuristics
fails precisely where the filtering is most needed.

> Any false negatives can be augmented
> with special (declare ...) instructions. But if we take that approach
> as a basis, fewer commands might such annotations.

Yes, it would save many annotations, but not enough to use it as a basis
(see above). Also, commands within a feature that are intended as
generally applicable require an annotation too (to leave them out of the
filtering.)

The approach has its merits, but it looks a bit too fragile to me.




reply via email to

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