[Top][All Lists]

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

Re: A read-based grep-like for symbols (el-search?) (was Do shorthands b

From: João Távora
Subject: Re: A read-based grep-like for symbols (el-search?) (was Do shorthands break basic tooling (tags, grep, etc)? (was Re: Shorthands have landed on master))
Date: Sat, 02 Oct 2021 03:05:35 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux)

Dmitry Gutov <dgutov@yandex.ru> writes:

> Whatever search feature we end up implementing, should work on Elisp
> code anywhere, inside or outside of Emacs core.

Yes.  xref-find-references is that feature for me.

But my understanding is that you were somehow suggesting another,
simpler method of having grep search by only the suffix.  Which is a
good idea, but -- as always -- needs some assumptions in the code.

I'm just saying we shouldn't _force_ any code to be constrained to such
assumptions.  But if _some code_ happens to want to be constrained by
those assumption, then your idea is valuable and should exist alongside

>> Rather, I think we must understand what the grep-inclined want to do.

> I wasn't really describing what the users of Grep would do. If that
> was the goal, prohibiting shorthands would be the answer.

I'm not talking about what they _would_ do.  Obviously they would Grep.
But they don't grep gratutiously, they are trying to answer questions.
If you give them tools that give those answers, maybe they will start
using those tools.

>> For example it might make sense to enforce some rules for external
>> symbols (the ones that one commonly searches for across files) and
>> others for internal symbols.
> I think the "private" symbols are largely irrelevant to this
> discussion. Unless people really are (?) going to use shorthands for
> them.

I would.  In fact, I would use them _prominently_ for private symbols,
which are the vast majority of symbols I write and precisely where I
feel most pain.  eglot--this, eglot--that, eglot-test--foo.  For
definitions of external symbols, like '(defun eglot-super-important-bit
() )' I would _not_ use them, precisely to safeguard answering some
basic questions with "grep".

That would be "my rule", at least a draft version of it.  But also, like
probably most people passionately discussing this feature, I too haven't
really had time to even play around with it (I spend my Emacs hack
budget writing e-mails ;-) ).

>> What does that do?  Returns nil here.  I'd like the approach to work
>> with Leo Liu's ack.el, for example, which is the particular 'grep'
>> interface I use.  It uses 'thingatpt'.
> Yes, sorry. That one was for 'find-tag' and 'xref-find-definitions'
> with etags.
> Tools like ack-el indeed use thingatpt, though I wonder whether we
> should add a new "thing" rather than change how 'symbol' works. That
> is, consider whether any of the existing users might not like this
> change.

Yes, I also think we should add a new "thing".  For your "grep-by-parts"
idea, I mean, I hope that's understood.  For xref-find-references, the
'symbol' is the thing.


reply via email to

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