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 04:43:58 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 02.10.2021 04:30, João Távora wrote:

Or make it mandatory, thus making it possible to use the approach to
searching I've described, and more or less guarantee it working on
third-party code as well.

We could, but it's too soon for that.  Bear in mind, one thing is the
Emacs repo, another thing is what you wish to do with the language.  And
a warning would more than suitably protect the former (once we decide
what needs to be protected and from what).  For the latter, removing a
feature that works fine is almost immoral IMO.  You may as well forbid
small prefixes alltogether, or heretic symbol names, or anaphoric
macros.

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

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.

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.

But
possible, yes.  Would you like to work on that `thing-at-pt.el` front?

thing-at-pt? I'm not sure which particular task you are referring to.
thingatpt.el, sorry.  The library used by other Elisp programs when
they
want to pick some text from the buffer, at point, that represents a symbol,
a string, a list.  We could have some kind of "symbol-prefix" "symbol-suffix"
or "symbol-part" for eventually telling grep to go search only for that part.

I think you're rather looking at altering what

   (get 'emacs-lisp-mode 'find-tag-default-function)

returns.

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.

That's not the approach I was thinking of, but I hope to present a working
prototype soon, which is a better way to present ideas.
Looking forward to it.
Just realized the default xref-backend-references uses semantic and
ede...
Uses a certain minor part of Semantic and doesn't use EDE.

I wasn't criticizing btw.  Wouldn't be a problem if it used even a big
part.

It's really just find-grep under the hood. Or Global, or id-utils.



reply via email to

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