]> code.delx.au - gnu-emacs/commitdiff
Use save-excursion in xref-location-marker more
authorDmitry Gutov <dgutov@yandex.ru>
Thu, 5 May 2016 01:28:14 +0000 (04:28 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Thu, 5 May 2016 01:28:14 +0000 (04:28 +0300)
* lisp/progmodes/elisp-mode.el (xref-location-marker): Use
save-excursion, in order not to alter the value of point if the
buffer is currently open in the background (problem reported by
Robert Weiner).

* lisp/progmodes/etags.el (xref-location-marker): Same.

lisp/progmodes/elisp-mode.el
lisp/progmodes/etags.el

index fc4501d0cbeb83173786a2d30d151dc1ece615d1..6c6c3803f9e3ba48df6e87a9993d94eb6cbe0354 100644 (file)
@@ -826,8 +826,9 @@ non-nil result supercedes the xrefs produced by
   (pcase-let (((cl-struct xref-elisp-location symbol type file) l))
     (let ((buffer-point (find-function-search-for-symbol symbol type file)))
       (with-current-buffer (car buffer-point)
-        (goto-char (or (cdr buffer-point) (point-min)))
-        (point-marker)))))
+        (save-excursion
+          (goto-char (or (cdr buffer-point) (point-min)))
+          (point-marker))))))
 
 (cl-defmethod xref-location-group ((l xref-elisp-location))
   (xref-elisp-location-file l))
index a2a0df2d6e1aee8b2ab8027de34d5069bad4527a..890d55294cfdd9b82949d4deaa23c6500bab7e46 100644 (file)
@@ -2146,8 +2146,9 @@ for \\[find-tag] (which see)."
   (with-slots (tag-info file) l
     (let ((buffer (find-file-noselect file)))
       (with-current-buffer buffer
-        (etags-goto-tag-location tag-info)
-        (point-marker)))))
+        (save-excursion
+          (etags-goto-tag-location tag-info)
+          (point-marker))))))
 
 (cl-defmethod xref-location-line ((l xref-etags-location))
   (with-slots (tag-info) l