emacs-devel
[Top][All Lists]
Advanced

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

Re: force initialization of a datatype?


From: Dmitry Gutov
Subject: Re: force initialization of a datatype?
Date: Sat, 7 Nov 2015 18:27:34 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Thunderbird/42.0

On 11/07/2015 09:05 AM, Stephen Leake wrote:

I don't follow.

`elisp-xref-find-def-functions' is a hook that is called from
`elisp--xref-find-definitions'; why should it be in find-func?

It would have a different name, of course, and maybe used indirectly through calling some of the find-func functions. But like you mentioned, we already have find-function-regexp-alist.

The only file that currently puts a function on that hook is
cedet/mode-local.el; it adds similar functionality to
`help-fns-describe-function-functions' and `find-function-regexp-alist'.

Why can't we reuse the contents of those variables?

I think the meat of the code that knows how to find Elisp entities should be in one place.

find-func seems to be the natural place for it. And elisp-xref should strive to provide a minimal interface over it, until we come to the conclusion that the info provided by find-func is definitely not rich enough (what we do in that case, it most likely out of scope for Emacs 25).

That code has a FIXME about moving it to
`elisp-xref-find-def-functions'; there is already code in cl-generic
that puts similar functionality on
`help-fns-describe-function-functions' and `find-function-regexp-alist'.

What if some new third-party facility adds a relevant element to elisp-xref-find-def-funtcions, but not find-function-regexp-alist? Or vice versa?

I don't think we should deprecate find-func just yet, and it would
make sense for M-x find-function to support defstruct functions and
generics.

It does; I just tried it on some of the ones defined in
elisp-mode-tests.el.

All right, thanks (I haven't checked, actually). My main concern is about the code organization.



reply via email to

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