[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 02:30:08 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux)

Dmitry Gutov <dgutov@yandex.ru> writes:

> On 01.10.2021 19:05, João Távora wrote:

> Go wasn't designed around Grep, perhaps. But you made a high-level
> statement, and I make a high-level rebuke.

Actually no.  Since you bring it up, I wrote:

>..> Language design never has been held back by the particular
>..> assumptions of a search tool, popular and ubiquitous as it may be.

I really did mean Grep, which is even more obvious from the
context.. _You_ made up another, different, statement about "usability"
and rebuked that.  So you self-rebuked, or something of the sort.  But I
agree with your point, in part, nonetheless.

> 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

Rather, I think we must understand what the grep-inclined want to do.
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.

>>>> 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'.

>>>> 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


reply via email to

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