[Top][All Lists]

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

Re: Do shorthands break basic tooling (tags, grep, etc)? (was Re: Shorth

From: João Távora
Subject: Re: Do shorthands break basic tooling (tags, grep, etc)? (was Re: Shorthands have landed on master)
Date: Fri, 08 Oct 2021 15:16:16 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux)

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

>>> An implementation of this idea is awaiting comments over at bug#50959.
>> I think you should install that.
> I'm not sure if he may be referring to another patch (I haven't checked
> the whole thread), but the patch I saw in there implements it with an
> ad-hoc `completion-style`.

Yup, that is the one (it's the only patch there so far).

> I consider this as an abuse of the notion of completion style (which
> are supposed to be orthogonal to the actual completion data), so I'd
> strongly recommend not to use this patch.

What do you mean a style being orthogonal to the completion data? A
substring style will complete "oo" to "foobar" because it knows that
"oo" belongs in "foobar" according to the notion of substring, and
likewise flex will complete "fb" to "foobar" because that belonging is
also there, according to a certain "flex" notion.

So the "shorthand" style makes "x-bar" complete to "string-library-foo"
according to a certain notion of abbreviation based on "shorthands".

How is this not "orthogonal to the data".

> I could agree to the use of a new completion-style for it, but then the
> code of the completion style should not be specific to
> `read-symbol-shorthands`.  Instead it should offer a generic feature
> usable by other completion tables (and the part specific to
> `read-symbol-shorthands` would be in the completion table of `C-x o`
> rather than in the completion style code).

In practice, does this change anything in terms of behavior?

If not, then I suggest we push that patch and then augment it with this
generalization, in case we do really come to the conclusion that this
more generic scheme really is useful.

Currently, the `C-x o` table (and other using
help--symbol-completion-table) declares that it is of the 'symbol'
category.  Up to here I'd say you agree.

Then, a shorthand-considering completion style is associated with the
'symbol' category.  I think this is pretty clean.

Obviously you disagree.  So if your suggestion is to make a an "abbrev"
completion style which consults the table for the specific source of
abbreviations (which happens to be read-symbol-shorthands in the case of
help--symbol-completion-table), than I have no strong points against, in
principle.  It's a question of adding something else to the metadata I

But isn't this a bit of overengineering?  And can't it be left for
'master', as it's kind of a new feature?


reply via email to

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