emacs-devel
[Top][All Lists]
Advanced

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

Re: xref backends for elisp-related modes Was: Re: Bad moves with xref-f


From: Stefan Monnier
Subject: Re: xref backends for elisp-related modes Was: Re: Bad moves with xref-find-definitions
Date: Sun, 26 Apr 2015 22:20:06 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> Additionally, if `add-function' allowed `:append' for its WHERE arg,
> like Common Lisp's method combinations, it would be even cleaner to get
> the behaviour desired by Eli (and Vitalie, I think), of multiple
> backends.

>    (advice-add 'elisp-xref-find :append #'etags-xref-find)

You can get that with

     (advice-add 'elisp-xref-find :around
       (lambda (orig-fun &rest args))
         (append (apply #'etags-xref-find args)
                 (apply orig-fun args)))

tho it's obviously not as elegant.  We could add a `:append'
alternative.  We just need to add the corresponding bytecode to
advice--bytecodes.  Sadly, these typically need to be handtweaked, since
they need to use a particular layout in their constant vector.


        Stefan



reply via email to

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