all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* adding xref-find-definitions support for cl-defmethods
@ 2015-08-09 13:12 Stephen Leake
  2015-08-09 13:18 ` Stephen Leake
  2015-08-09 16:24 ` Stefan Monnier
  0 siblings, 2 replies; 4+ messages in thread
From: Stephen Leake @ 2015-08-09 13:12 UTC (permalink / raw
  To: emacs-devel

I'd like xref-find-definitions to show all loaded cl-defmethods, as
describe-function does.

So I'm adding a function cl-generic--xref-locs to return a list of xref
locations, in cl-generic.el.

That will be called from elisp--xref-identifier-location for a new
'defgeneric type.

Can elisp-mode.el have (require 'cl-generic')? I remember some
discussion about limits on what elisp-mode.el can require, related to
preloading things. But there's nothing in the header comments about that.

If not, should I put cl-generic--xref-locs in elisp-mode (or xref?)

On the other hand, there may be other types that could be added to
xref-find-definitions, possibly by ELPA packges. So perhaps an alist of
(type . loc-function), processed in elisp--xref-find-definitions, would
be appropriate.

Actually, there's no need for the type symbol; it's only used by
elisp--xref-find-definitions and elisp--xref-identifier-location. So
that could be eliminated, and the current code restructured around a
list of loc-functions, as describe-function is with the hook
help-fns-describe-function-functions.

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: adding xref-find-definitions support for cl-defmethods
  2015-08-09 13:12 adding xref-find-definitions support for cl-defmethods Stephen Leake
@ 2015-08-09 13:18 ` Stephen Leake
  2015-08-09 16:36   ` Stephen Leake
  2015-08-09 16:24 ` Stefan Monnier
  1 sibling, 1 reply; 4+ messages in thread
From: Stephen Leake @ 2015-08-09 13:18 UTC (permalink / raw
  To: emacs-devel

Stephen Leake <stephen_leake@stephe-leake.org> writes:

> I'd like xref-find-definitions to show all loaded cl-defmethods, as
> describe-function does.
>
> So I'm adding a function cl-generic--xref-locs to return a list of xref
> locations, in cl-generic.el.
>
> That will be called from elisp--xref-identifier-location for a new
> 'defgeneric type.
>
> Can elisp-mode.el have (require 'cl-generic')? I remember some
> discussion about limits on what elisp-mode.el can require, related to
> preloading things. But there's nothing in the header comments about that.
>
> If not, should I put cl-generic--xref-locs in elisp-mode (or xref?)
>
> On the other hand, there may be other types that could be added to
> xref-find-definitions, possibly by ELPA packges. So perhaps an alist of
> (type . loc-function), processed in elisp--xref-find-definitions, would
> be appropriate.
>
> Actually, there's no need for the type symbol; it's only used by
> elisp--xref-find-definitions and elisp--xref-identifier-location. So
> that could be eliminated, and the current code restructured around a
> list of loc-functions, as describe-function is with the hook
> help-fns-describe-function-functions.

On further thought, it's pretty clear that anything describe-function
can handle, xref-find-definition should handle. So both should have
similar lists.

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: adding xref-find-definitions support for cl-defmethods
  2015-08-09 13:12 adding xref-find-definitions support for cl-defmethods Stephen Leake
  2015-08-09 13:18 ` Stephen Leake
@ 2015-08-09 16:24 ` Stefan Monnier
  1 sibling, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2015-08-09 16:24 UTC (permalink / raw
  To: Stephen Leake; +Cc: emacs-devel

> Can elisp-mode.el have (require 'cl-generic')? I remember some

In "master", cl-generic is preloaded nowadays,


        Stefan



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: adding xref-find-definitions support for cl-defmethods
  2015-08-09 13:18 ` Stephen Leake
@ 2015-08-09 16:36   ` Stephen Leake
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Leake @ 2015-08-09 16:36 UTC (permalink / raw
  To: emacs-devel

Stephen Leake <stephen_leake@stephe-leake.org> writes:

> Stephen Leake <stephen_leake@stephe-leake.org> writes:
>
>> I'd like xref-find-definitions to show all loaded cl-defmethods, as
>> describe-function does.
>>
>
> On further thought, it's pretty clear that anything describe-function
> can handle, xref-find-definition should handle. So both should have
> similar lists.

I reviewed the list of help-fns-describe-function-functions, and the
'cond' in describe-function-1. The only things we need to add to
xref-find-definitions are those that produce useful locations; that
reduces to:

    defgeneric; list of defmethods
    advised function; list of advice functions

So I'll start with the current structure, adding 'defgeneric and
'advised to the list. That may change ...

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-08-09 16:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-09 13:12 adding xref-find-definitions support for cl-defmethods Stephen Leake
2015-08-09 13:18 ` Stephen Leake
2015-08-09 16:36   ` Stephen Leake
2015-08-09 16:24 ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.