[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 71795c6 1/2: Reimplement commit 46b3db5579e57b9daf16667914205adc9
From: |
Juri Linkov |
Subject: |
master 71795c6 1/2: Reimplement commit 46b3db5579e57b9daf16667914205adc99d3f104 (bug#44294) |
Date: |
Sat, 31 Oct 2020 15:40:28 -0400 (EDT) |
branch: master
commit 71795c6c4a61817f60e001702ed01785d2da3faf
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>
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 41ed317..8879726 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