Use revert-buffer-restore-functions in xref-revert-buffer (bug#49731)
* lisp/progmodes/xref.el (xref-revert-buffer): When 'revert-buffer-restore-functions' is bound, use it in the same way as in 'revert-buffer'.
This commit is contained in:
parent
854552fd0d
commit
a2b6e18d60
1 changed files with 7 additions and 2 deletions
|
@ -1277,13 +1277,18 @@ Return an alist of the form ((GROUP . (XREF ...)) ...)."
|
|||
"Refresh the search results in the current buffer."
|
||||
(interactive)
|
||||
(let ((inhibit-read-only t)
|
||||
(buffer-undo-list t))
|
||||
(buffer-undo-list t)
|
||||
restore-functions)
|
||||
(when (boundp 'revert-buffer-restore-functions)
|
||||
(run-hook-wrapped 'revert-buffer-restore-functions
|
||||
(lambda (f) (push (funcall f) restore-functions) nil)))
|
||||
(save-excursion
|
||||
(condition-case err
|
||||
(let ((alist (xref--analyze (funcall xref--fetcher)))
|
||||
(inhibit-modification-hooks t))
|
||||
(erase-buffer)
|
||||
(xref--insert-xrefs alist))
|
||||
(prog1 (xref--insert-xrefs alist)
|
||||
(mapc #'funcall (delq nil restore-functions))))
|
||||
(user-error
|
||||
(erase-buffer)
|
||||
(insert
|
||||
|
|
Loading…
Add table
Reference in a new issue