emacs-devel
[Top][All Lists]
Advanced

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

Re: Helpful in Emacs?


From: Arthur Miller
Subject: Re: Helpful in Emacs?
Date: Thu, 09 Sep 2021 22:23:08 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Daniel Martín <mardani29@yahoo.es> writes:

> Showing references to a symbol is an interesting feature (for example,
> to learn how to use an ELisp API by looking at examples).  I see that
> Helpful provides this feature via the separate package elisp-refs
> (https://github.com/Wilfred/elisp-refs).  The closest package I know
> that actually understands ELisp is el-search from ELPA, but elisp-refs
> is a more specific package for the concrete use case of searching for
> references.

About elisp-refs, I have looked at that library this evening, after your
mail, and I think it does the right thing.

It uses read function to parse lisp files to find defs. I wrote a blog post just
yesterday about doing similar, but it was about collecting autoloads since I am
unhappy with built-in funcionality in autoload.el. I don't use
package-quickstart.el but build my own autoloads file that suits my use pattern
better. This request for helpful in Emacs started as I realized that helpful
lookups functions in source code rather than using docs stuffed in autoloads, so
I can have the cake and eat it too. Built in help can't show docs for a
autoloaded function that is not loaded yet.

My blog post is here: http://www.nextpoint.se/?p=890 (if you are interested and
have time :))

What do you need to build  xref backend you mention? As mentioned on elisp-refs
gh page:

"xref-find-references: This command is included in Emacs 25.1, but it's based on
a text search. It is confused by comments and strings, and cannot distinguish
between functions and variables."

Would rebuilding this command to use read instead of text search do the thing?

I have never looked at xref code, so I have no idea how much work it is to
re-build it though.

Otherwise, about the read function and reading stuff from lisp files, two days
ago I have built a small program to extract all defined symbols (defvars,
defcustoms, defuns and defmacros) from all lisp files in a directory tree, and I
save them in above mentioned database. I thought it would be slow, but it really
is fast. All symbols in Emacs lisp subdirectory are indexed in like 2 seconds
and my entire elpa dir with ~200+ packages takes about 0.5 secs. 






reply via email to

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