xref.el: Ensure that the return value is the buffer
authorDmitry Gutov <dmitry@gutov.dev>
Sat, 2 Sep 2023 01:59:20 +0000 (04:59 +0300)
committerDmitry Gutov <dmitry@gutov.dev>
Sat, 2 Sep 2023 01:59:20 +0000 (04:59 +0300)
* lisp/progmodes/xref.el (xref--show-xrefs, xref--show-defs):
Ensure the return value of the funcall is returned (bug#65631).

lisp/progmodes/xref.el

index 9b64ef4de108b6f6c8d3797b55a5b5fc740b6d01..b7bfb192d87f228120f357952b81ceddc87143de 100644 (file)
@@ -1480,20 +1480,22 @@ The meanings of both arguments are the same as documented in
                   (setq xrefs 'called-already)))))))
   (let ((cb (current-buffer))
         (pt (point)))
-    (funcall xref-show-xrefs-function fetcher
-             `((window . ,(selected-window))
-               (display-action . ,display-action)
-               (auto-jump . ,xref-auto-jump-to-first-xref)))
-    (xref--push-markers cb pt)))
+    (prog1
+        (funcall xref-show-xrefs-function fetcher
+                 `((window . ,(selected-window))
+                   (display-action . ,display-action)
+                   (auto-jump . ,xref-auto-jump-to-first-xref)))
+      (xref--push-markers cb pt))))
 
 (defun xref--show-defs (xrefs display-action)
   (let ((cb (current-buffer))
         (pt (point)))
-    (funcall xref-show-definitions-function xrefs
-             `((window . ,(selected-window))
-               (display-action . ,display-action)
-               (auto-jump . ,xref-auto-jump-to-first-definition)))
-    (xref--push-markers cb pt)))
+    (prog1
+        (funcall xref-show-definitions-function xrefs
+                 `((window . ,(selected-window))
+                   (display-action . ,display-action)
+                   (auto-jump . ,xref-auto-jump-to-first-definition)))
+      (xref--push-markers cb pt))))
 
 (defun xref--push-markers (buf pt)
   (when (buffer-live-p buf)