emacs-devel
[Top][All Lists]
Advanced

[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: Dmitry Gutov
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, 2 Oct 2021 05:24:35 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 02.10.2021 05:05, João Távora wrote:
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.

Assumptions that most languages with module/namespace systems satisfy.

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
xref-find-references.

Yes, I was saying the opposite.

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 makes sense. But if the goal of shorthands was to shorten internal symbols only, it would probably looked a little different.

And anyway, if multiple packages have internal symbols with the same local name, the search for is likely to require the same approach and hence the same limitations. Unless we're really going to prohibit packages from using "private" functions from other packages (thus being able to limit the search to the current file). Which is a frowned-upon but common practice.

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 ;-) ).

Hah. ;-(

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.

And then we encounter the question, what is a 'symbol', really.

Either way, yes, these are two distinct usage examples with different answers to that question.



reply via email to

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