Use save-excursion in xref-location-marker more
* 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.
This commit is contained in:
parent
ab3ba912fc
commit
1a4127dbd6
2 changed files with 6 additions and 4 deletions
|
@ -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)
|
||||
(save-excursion
|
||||
(goto-char (or (cdr buffer-point) (point-min)))
|
||||
(point-marker)))))
|
||||
(point-marker))))))
|
||||
|
||||
(cl-defmethod xref-location-group ((l xref-elisp-location))
|
||||
(xref-elisp-location-file l))
|
||||
|
|
|
@ -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
|
||||
(save-excursion
|
||||
(etags-goto-tag-location tag-info)
|
||||
(point-marker)))))
|
||||
(point-marker))))))
|
||||
|
||||
(cl-defmethod xref-location-line ((l xref-etags-location))
|
||||
(with-slots (tag-info) l
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue