unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: emacs-devel@gnu.org
Subject: Re: xref overrides user xref-backend-functions
Date: Tue, 01 Dec 2015 17:41:59 -0600	[thread overview]
Message-ID: <86vb8hohx4.fsf@stephe-leake.org> (raw)
In-Reply-To: <565DFE5C.4090209@yandex.ru> (Dmitry Gutov's message of "Tue, 1 Dec 2015 22:09:00 +0200")

Dmitry Gutov <dgutov@yandex.ru> 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	other threads:[~2015-12-01 23:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-01  6:15 xref overrides user xref-backend-functions Stephen Leake
2015-12-01 20:09 ` Dmitry Gutov
2015-12-01 23:41   ` Stephen Leake [this message]
2015-12-02  2:08     ` Dmitry Gutov
     [not found] <CABr8ebbkBS+45FV-3h5ZuVLMTS3DU53h4OYm9XRuLzp4gQg7BA@mail.gmail.com>
2015-12-02 12:13 ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86vb8hohx4.fsf@stephe-leake.org \
    --to=stephen_leake@stephe-leake.org \
    --cc=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).