From: Dmitry Gutov Date: Sat, 23 Jan 2021 00:53:12 +0000 (+0200) Subject: Erase the buffer only after fetching the new contents X-Git-Tag: emacs-28.0.90~4147 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5821dee0949b2913c07970d6e4b8bb8e8a35f036;p=emacs.git Erase the buffer only after fetching the new contents * lisp/progmodes/xref.el (xref-revert-buffer): Erase the buffer only after fetching the new contents (bug#46042). --- diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index aecb30a0ad4..abaa0dc5e8b 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -967,10 +967,10 @@ Return an alist of the form ((FILENAME . (XREF ...)) ...)." (let ((inhibit-read-only t) (buffer-undo-list t)) (save-excursion - (erase-buffer) (condition-case err - (xref--insert-xrefs - (xref--analyze (funcall xref--fetcher))) + (let ((alist (xref--analyze (funcall xref--fetcher)))) + (erase-buffer) + (xref--insert-xrefs alist)) (user-error (insert (propertize