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-27.1.91~6 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0399cc2ab5;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). (cherry picked from commit 5821dee0949b2913c07970d6e4b8bb8e8a35f036) --- diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index e55d2958617..7f5e76c7409 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -876,10 +876,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