From 71795c6c4a61817f60e001702ed01785d2da3faf Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Sat, 31 Oct 2020 21:33:33 +0200 Subject: [PATCH] Reimplement commit 46b3db5579e57b9daf16667914205adc99d3f104 (bug#44294) * 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. --- lisp/progmodes/etags.el | 15 ++++++--------- 1 file 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 -- 2.39.2