[Top][All Lists]

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

Re: xref overrides user xref-backend-functions

From: Stephen Leake
Subject: Re: xref overrides user xref-backend-functions
Date: Tue, 01 Dec 2015 17:41:59 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (windows-nt)

Dmitry Gutov <address@hidden> writes:

> On 12/01/2015 08:15 AM, Stephen Leake wrote:
>>      (progn
>>       (setq xref-backend-functions (lambda () 'my-xref-backend))
>>       (require 'xref)
>>       xref-backend-functions)
> I don't think we've ever discussed being able to override the backend
> from the init file like that.

Yes, we did settle on a globalized minor mode. That's what I'm
actually doing.

Ah; the code that defines the minor mode does not have "(require
'xref)"; it should. Then this issue is moot.

> How about this, though?
> diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
> index 8a69b07..cddb017 100644
> --- a/lisp/progmodes/xref.el
> +++ b/lisp/progmodes/xref.el
> @@ -210,7 +210,7 @@ xref-backend-functions
>  ;; We make the etags backend the default for now, until something
>  ;; better comes along.
> -(add-hook 'xref-backend-functions #'etags--xref-backend)
> +(add-hook 'xref-backend-functions #'etags--xref-backend t)

So etags--xref-backend is appended rather than prepended. That's a
little better, but I'd prefer to have complete control. I think (require
'xref) is acceptable.

-- Stephe

reply via email to

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