summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2020-10-31 21:33:33 +0200
committerJuri Linkov <juri@linkov.net>2020-10-31 21:39:28 +0200
commit71795c6c4a61817f60e001702ed01785d2da3faf (patch)
tree8c92041746acc5d60c6c97b76e2a5fe07ca038c3
parentf9cac26dc1545ce7b79c68dc2294dfba8486c48b (diff)
downloademacs-71795c6c4a61817f60e001702ed01785d2da3faf.tar.gz
* lisp/progmodes/etags.el (etags-goto-tag-location): Revert change from commit 46b3db5579e57b9daf16667914205adc99d3f104. (xref-location-marker): Use the same change as was made in elisp-mode.el in commit 46b3db5579e57b9daf16667914205adc99d3f104 to widen before going to the found position.
-rw-r--r--lisp/progmodes/etags.el15
1 files changed, 6 insertions, 9 deletions
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 41ed3177660..8879726ad59 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -1406,13 +1406,8 @@ hits the start of file."
offset (* 3 offset))) ; expand search window
(or found
(re-search-forward pat nil t)
- (if (and (buffer-narrowed-p) widen-automatically)
- (progn
- ;; Rerun after removing narrowing
- (widen)
- (etags-goto-tag-location tag-info))
- (user-error "Rerun etags: `%s' not found in %s"
- pat buffer-file-name))))
+ (user-error "Rerun etags: `%s' not found in %s"
+ pat buffer-file-name)))
;; Position point at the right place
;; if the search string matched an extra Ctrl-m at the beginning.
(and (eq selective-display t)
@@ -2140,8 +2135,10 @@ file name, add `tag-partial-file-name-match-p' to the list value.")
(let ((buffer (find-file-noselect file)))
(with-current-buffer buffer
(save-excursion
- (etags-goto-tag-location tag-info)
- (point-marker))))))
+ (save-restriction
+ (widen)
+ (etags-goto-tag-location tag-info)
+ (point-marker)))))))
(cl-defmethod xref-location-line ((l xref-etags-location))
(with-slots (tag-info) l