aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2021-06-06 15:29:18 +0300
committerEli Zaretskii2021-06-06 15:29:18 +0300
commitfc37483617e09fb901c075dd20cfb7b2c2a165fe (patch)
tree921d3fbbb5bd39e550a845a05a23a931afaa833e
parent0f9d8c9381f12a5ddcbf749a8e8238d7f9080497 (diff)
downloademacs-fc37483617e09fb901c075dd20cfb7b2c2a165fe.tar.gz
emacs-fc37483617e09fb901c075dd20cfb7b2c2a165fe.zip
Fix a problem with restarting 'tags-search'
* lisp/progmodes/etags.el (tags-search, tags-query-replace): Link to 'fileloop-continue' instead of 'tags-loop-continue', for continuing TAGS-based search/replace commands. * lisp/fileloop.el (fileloop-continue): Reset 'switch-to-buffer-preserve-window-point' to nil when switching to another buffer, so as to make sure a new search always restarts from point-min in each buffer it searches. (Bug#48628)
-rw-r--r--lisp/fileloop.el3
-rw-r--r--lisp/progmodes/etags.el4
2 files changed, 4 insertions, 3 deletions
diff --git a/lisp/fileloop.el b/lisp/fileloop.el
index cb9fe8f7769..8a2755d69a5 100644
--- a/lisp/fileloop.el
+++ b/lisp/fileloop.el
@@ -171,7 +171,8 @@ operating on the next file and nil otherwise."
171 (goto-char pos)) 171 (goto-char pos))
172 (push-mark original-point t)) 172 (push-mark original-point t))
173 173
174 (switch-to-buffer (current-buffer)) 174 (let (switch-to-buffer-preserve-window-point)
175 (switch-to-buffer (current-buffer)))
175 176
176 ;; Now operate on the file. 177 ;; Now operate on the file.
177 ;; If value is non-nil, continue to scan the next file. 178 ;; If value is non-nil, continue to scan the next file.
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 13717b1b894..f0180ceeeca 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -1808,7 +1808,7 @@ argument is passed to `next-file', which see)."
1808(defun tags-search (regexp &optional files) 1808(defun tags-search (regexp &optional files)
1809 "Search through all files listed in tags table for match for REGEXP. 1809 "Search through all files listed in tags table for match for REGEXP.
1810Stops when a match is found. 1810Stops when a match is found.
1811To continue searching for next match, use command \\[tags-loop-continue]. 1811To continue searching for next match, use the command \\[fileloop-continue].
1812 1812
1813If FILES if non-nil should be a list or an iterator returning the 1813If FILES if non-nil should be a list or an iterator returning the
1814files to search. The search will be restricted to these files. 1814files to search. The search will be restricted to these files.
@@ -1834,7 +1834,7 @@ Also see the documentation of the `tags-file-name' variable."
1834 "Do `query-replace-regexp' of FROM with TO on all files listed in tags table. 1834 "Do `query-replace-regexp' of FROM with TO on all files listed in tags table.
1835Third arg DELIMITED (prefix arg) means replace only word-delimited matches. 1835Third arg DELIMITED (prefix arg) means replace only word-delimited matches.
1836If you exit (\\[keyboard-quit], RET or q), you can resume the query replace 1836If you exit (\\[keyboard-quit], RET or q), you can resume the query replace
1837with the command \\[tags-loop-continue]. 1837with the command \\[fileloop-continue].
1838For non-interactive use, superseded by `fileloop-initialize-replace'." 1838For non-interactive use, superseded by `fileloop-initialize-replace'."
1839 (declare (advertised-calling-convention (from to &optional delimited) "27.1")) 1839 (declare (advertised-calling-convention (from to &optional delimited) "27.1"))
1840 (interactive (query-replace-read-args "Tags query replace (regexp)" t t)) 1840 (interactive (query-replace-read-args "Tags query replace (regexp)" t t))