xref-revert-buffer: Make inhibit-modification-hooks binding a bit safer
authorDmitry Gutov <dmitry@gutov.dev>
Sat, 25 May 2024 21:58:57 +0000 (00:58 +0300)
committerDmitry Gutov <dmitry@gutov.dev>
Sat, 25 May 2024 23:03:13 +0000 (02:03 +0300)
* lisp/progmodes/xref.el (xref-revert-buffer): Make sure that the
inhibit-modification-hooks binding does not cover xref--fetcher
funcall.  Only the printing step (issue mentioned in bug#53749).

lisp/progmodes/xref.el

index 534bd930e1399221e8bd16f0682dd0e4d1975ec8..af77e8600207975f93f5e6765a39410e9e92966a 100644 (file)
@@ -1277,11 +1277,11 @@ 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)
-        (inhibit-modification-hooks t))
+        (buffer-undo-list t))
     (save-excursion
       (condition-case err
-          (let ((alist (xref--analyze (funcall xref--fetcher))))
+          (let ((alist (xref--analyze (funcall xref--fetcher)))
+                (inhibit-modification-hooks t))
             (erase-buffer)
             (xref--insert-xrefs alist))
         (user-error