xref: Keep track of temporary buffers
commit956b13c527dc6ac5443ea4d9706faa3a845b8562
authorDmitry Gutov <dgutov@yandex.ru>
Wed, 21 Jan 2015 06:43:39 +0000 (21 08:43 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Wed, 21 Jan 2015 06:43:39 +0000 (21 08:43 +0200)
treeea96d63734a28f3d0826a0c3caf636c974b47a08
parent9a895795e862f8082d0ea00cb33f4ca36b7d8196
xref: Keep track of temporary buffers

Fixes: debbugs:19466

xref: Keep track of temporary buffers.
* lisp/progmodes/xref.el (xref--temporary-buffers, xref--selected)
(xref--inhibit-mark-selected): New variables.
(xref--mark-selected): New function.
(xref--show-location): Maybe add the buffer to
`xref--temporary-buffers', add `xref--mark-selected' to
`buffer-list-update-hook' there.
(xref--window): Add docstring.
(xref-quit): Rename from `xref--quit'.  Update both references.
Add KILL argument.  When it's non-nil, kill the temporary buffers
that haven't been selected by the user.
(xref--show-xref-buffer): Change the second argument to alist,
extract the values for `xref--window' and
`xref--temporary-buffers' from it.  Add `xref--mark-selected' to
`buffer-list-update-hook' to each buffer in the list.
(xref--show-xrefs): Move the logic of calling `xref-find-function'
here.  Save the difference between buffer lists before and after
it's called as "temporary buffers", and `pass it to
`xref-show-xrefs-function'.
(xref--find-definitions, xref-find-references)
(xref-find-apropos): Update accordingly.
lisp/ChangeLog
lisp/progmodes/xref.el