Subject: bug#19466: 25.0.50; xref-find-def doesn't find C functions

From: Dmitry Gutov <[email-masked]>
Date: Mon, 05 Jan 2015 01:14:29 +0300

On 01/04/2015 11:10 PM, Stefan Monnier wrote:

> Right, I think we should definitely start with just a way to use TAGS
> *instead* of the major mode's own system.

I've posted a tiny minor mode in the previous message that does this. 
Does it work well for everyone?

We probably don't even need a minor mode. A function might suffice:

(defun xref-reset-backend ()
   (kill-local-variable 'xref-find-function)
   (kill-local-variable 'xref-identifier-completion-table-function))

(defun elisp-maybe-reset-xref ()
   (when (and buffer-file-name
              (string-prefix-p source-directory buffer-file-name))
     (xref-reset-backend)))

(add-hook 'emacs-lisp-mode-hook 'elisp-maybe-reset-xref)

But please, someone else should make the choice: I rarely ever use tag 
files, and never with Emacs Lisp.