all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* xref and leaving "temporary" buffers open
@ 2015-07-25  0:47 Dmitry Gutov
  2015-07-25  7:27 ` Eli Zaretskii
  2015-07-25  8:28 ` martin rudalics
  0 siblings, 2 replies; 49+ messages in thread
From: Dmitry Gutov @ 2015-07-25  0:47 UTC (permalink / raw)
  To: emacs-devel

Hi all,

The original implementation, by Helmut, didn't worry about that, and, 
for instance, used xref-buffer-location for the results of "find 
definitions" operation in the Elisp backend.

I was concerned about having opening lots of buffers, the user being 
surprised at seeing a querying operation make that change in their Emacs 
session. Then switch-to-buffer, as one example, might become more 
troublesome, for having too many options to choose from. Some Emacs 
features might slow down for having to deal with too many buffers (like 
auto-revert?). Anyway, a neat freak like yours truly might get annoyed. 
So I made the current implementations always clean up after themselves.

However, that causes a performance hit: opening a buffer takes time, 
especially when you need to syntax-propertize it (which is a requirement 
for xref--collect-match). So now even if I repeatedly search for the 
same thing, each search incurs the same performance penalty. Or, more 
practically, if a do a search and then press `r' to call 
`xref-query-replace', the latter has to reopen the killed buffers again. 
Which could be implemented, with certain amount of effort, in a deferred 
way so the user doesn't suffer too much, but even that would break if 
some xrefs from the same file appear separately in the list (and that 
might happen, for example, if etags--xref-find-definitions splits the 
results into groups by tag order).

Should we disregard this issue and say that xref doesn't have to close 
the buffers it needed to open during operation?

Another problem with that might be the contents getting out of date: 
what if the user doesn't have global-auto-revert-mode on? Then an xref 
search might get erroneous results from those buffers. Would it be 
allowed to call `revert-buffer' anywhere, as long as the buffer doesn't 
have unsaved changes?

Certain other programs might have a project and all its files loaded, 
but still display only a few of them as the ones the user is editing 
(probably using tabs). Should Emacs have a similar distinction, between 
loaded and open buffers?



^ permalink raw reply	[flat|nested] 49+ messages in thread

end of thread, other threads:[~2015-08-03 10:50 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-25  0:47 xref and leaving "temporary" buffers open Dmitry Gutov
2015-07-25  7:27 ` Eli Zaretskii
2015-07-25 13:26   ` Dmitry Gutov
2015-07-25 14:07     ` Eli Zaretskii
2015-07-25 14:24       ` Dmitry Gutov
2015-07-25 14:36         ` Eli Zaretskii
2015-07-25 15:09           ` Dmitry Gutov
2015-07-25 15:27             ` Eli Zaretskii
2015-07-25 16:07               ` Dmitry Gutov
2015-07-25 16:15                 ` Eli Zaretskii
2015-07-25 16:28                   ` Dmitry Gutov
2015-07-25 16:38                     ` Eli Zaretskii
2015-07-25 17:03                       ` Dmitry Gutov
2015-07-25 18:17                         ` martin rudalics
2015-07-25 18:30                           ` Dmitry Gutov
2015-07-27 17:34                             ` Nix
2015-07-28 13:30                               ` Dmitry Gutov
2015-07-29 15:02                                 ` Nix
2015-07-25  8:28 ` martin rudalics
2015-07-25 13:36   ` Dmitry Gutov
2015-07-25 14:12     ` martin rudalics
2015-07-25 14:44       ` Dmitry Gutov
2015-07-25 15:53         ` martin rudalics
2015-07-25 20:12           ` Dmitry Gutov
2015-07-26 11:27             ` martin rudalics
2015-07-26 13:50               ` Dmitry Gutov
2015-07-27 16:02                 ` martin rudalics
2015-07-28 12:57                   ` Dmitry Gutov
2015-07-28 13:16                     ` martin rudalics
2015-07-28 13:35                       ` Dmitry Gutov
2015-07-28 15:10                         ` martin rudalics
2015-07-28 15:18                           ` Dmitry Gutov
2015-07-28 15:40                             ` martin rudalics
2015-07-28 19:13                               ` Dmitry Gutov
2015-07-28 23:48                     ` Stefan Monnier
2015-07-29  1:42                       ` Dmitry Gutov
2015-07-30 21:41                         ` Stefan Monnier
2015-08-03  2:12                           ` Dmitry Gutov
2015-08-03  6:47                             ` martin rudalics
2015-08-03 10:10                               ` Dmitry Gutov
2015-08-03 10:45                                 ` martin rudalics
2015-08-03 10:50                             ` Stefan Monnier
2015-07-26 19:00             ` Stephen Leake
2015-07-26 19:11               ` Dmitry Gutov
2015-07-27 16:02               ` martin rudalics
2015-07-28  1:32                 ` Stephen Leake
2015-07-25 13:47   ` Stephen Leake
2015-07-25 14:19     ` martin rudalics
2015-07-25 15:51     ` Dmitry Gutov

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.