emacs-devel
[Top][All Lists]
Advanced

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

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


From: João Távora
Subject: 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: Thu, 30 Sep 2021 23:22:38 +0100

On Thu, Sep 30, 2021 at 11:11 PM Michael Heerdegen
<michael_heerdegen@web.de> wrote:
>
> Drew Adams <drew.adams@oracle.com> writes:
>
> > > Tools that understand the symbolic nature of the Lisp
> > > family of languages. For the example you have since,
> > > Tools that rely on way or the other really on the
> > > 'read' Lisp primitive.
> >
> > https://github.com/emacsmirror/el-search
>
> Yes, thanks Drew.  Indeed I was wondering whether shorthands would break
> el-search, but it was trivial to add support for them because el-search
> is (solely) based on `read'ing.  Therefore it's slower than grepping of
> course, but it's still acceptable (~ 10 seconds for the entire Emacs
> Lisp code base)

The "searching for symbols" problem is one of those embarrassingly parallel
ones, right?

Also, I can of course imaging that the `read' ing sexps is lower than reading
lines, but once you fill up an obarray with all the symbols you read, you don't
pay for the string comparison, since matching symbols to the search pattern
(presumably also a symbol) should be much faster since you can just use
the hashing of the obarray.

I haven't read or tried your code yet, I'm just speculating on possible
approaches.

João



reply via email to

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