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

From: martin rudalics <[email-masked]>
Date: Fri, 16 Jan 2015 08:47:55 +0100

> The alternative implementation was pushed to scratch/xref, and it's waiting for Martin's comments (bug#19468).

Sorry, I didn't have time yet to give it a through testing.  Anyway,
Eli's concern

   "... if I switch to the window where that candidate is displayed, the
    window switches buffers on me ..."

is IMHO more serious than your

   "I want the user to be able to easily return to the window
    configuration that was before xref-find-definitions was called."

so I think you should push the `quit-window' based solution to trunk
(which, from the few testing I gave it, seems to handle this case well).

One thing that has annoyed me ever since is the buffers that pile up
while browsing tags.  I always dreamt of a good heuristic to get rid of
them.  Maybe you could try making provisions like

(1) this buffer is killable because it has been probably visited
     exclusively by and only accidentally during xrefing, and

(2) have the command that quits the *xref* buffer optionally kill the
     buffers marked in (1).

A heuristic for (1) could go as follows:

   The buffer was created during xrefing, the window was never selected
   while it showed that buffer and either its buffer was "immediately"
   replaced by another xrefed one or `xref--quit' was invoked.

You might also consider setting `other-window-scroll-buffer' to the
window used by `xref-show-location-at-point'.

martin, who'd prefer (user-error "No reference at point")