1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Rename multifile.el to fileloop.el

* lisp/multifile.el: Rename to fileloop.el as discussed in
https://lists.gnu.org/archive/html/emacs-devel/2018-12/msg00475.html.
Update symbol prefixes and all callers
This commit is contained in:
Dmitry Gutov 2019-02-07 12:20:09 +03:00
parent 1289ae999b
commit 5e627fa5f5
8 changed files with 87 additions and 87 deletions

View file

@ -1990,7 +1990,7 @@ table.
@item M-x tags-query-replace @key{RET} @var{regexp} @key{RET} @var{replacement} @key{RET} @item M-x tags-query-replace @key{RET} @var{regexp} @key{RET} @var{replacement} @key{RET}
Perform a @code{query-replace-regexp} on each file in the selected tags table. Perform a @code{query-replace-regexp} on each file in the selected tags table.
@item M-x multifile-continue @item M-x fileloop-continue
Restart one of the last 2 commands above, from the current location of point. Restart one of the last 2 commands above, from the current location of point.
@end table @end table
@ -2026,9 +2026,9 @@ you can follow its progress. As soon as it finds an occurrence,
@code{tags-search} returns. This command requires tags tables to be @code{tags-search} returns. This command requires tags tables to be
available (@pxref{Tags Tables}). available (@pxref{Tags Tables}).
@findex multifile-continue @findex fileloop-continue
Having found one match with @code{tags-search}, you probably want to Having found one match with @code{tags-search}, you probably want to
find all the rest. @kbd{M-x multifile-continue} resumes the find all the rest. @kbd{M-x fileloop-continue} resumes the
@code{tags-search}, finding one more match. This searches the rest of @code{tags-search}, finding one more match. This searches the rest of
the current buffer, followed by the remaining files of the tags table. the current buffer, followed by the remaining files of the tags table.
@ -2051,10 +2051,10 @@ default is to use the same setting as the value of
single invocation of @kbd{M-x tags-query-replace}. But often it is single invocation of @kbd{M-x tags-query-replace}. But often it is
useful to exit temporarily, which you can do with any input event that useful to exit temporarily, which you can do with any input event that
has no special query replace meaning. You can resume the query has no special query replace meaning. You can resume the query
replace subsequently by typing @kbd{M-x multifile-continue}; this replace subsequently by typing @kbd{M-x fileloop-continue}; this
command resumes the last tags search or replace command that you did. command resumes the last tags search or replace command that you did.
For instance, to skip the rest of the current file, you can type For instance, to skip the rest of the current file, you can type
@w{@kbd{M-> M-x multifile-continue}}. @w{@kbd{M-> M-x fileloop-continue}}.
Note that the commands described above carry out much broader Note that the commands described above carry out much broader
searches than the @code{xref-find-definitions} family. The searches than the @code{xref-find-definitions} family. The

View file

@ -394,11 +394,11 @@ The mode is automatically enabled in files that start with the
*** 'next-file' is now an obsolete alias of 'tags-next-file'. *** 'next-file' is now an obsolete alias of 'tags-next-file'.
*** 'tags-loop-revert-buffers' is an obsolete alias of *** 'tags-loop-revert-buffers' is an obsolete alias of
'multifile-revert-buffers'. 'fileloop-revert-buffers'.
*** The 'tags-loop-continue' function along with the *** The 'tags-loop-continue' function along with the
'tags-loop-operate' and 'tags-loop-scan' variables are now obsolete; 'tags-loop-operate' and 'tags-loop-scan' variables are now obsolete;
use the new 'multifile-initialize' and 'multifile-continue' functions use the new 'fileloop-initialize' and 'fileloop-continue' functions
instead. instead.
** bibtex ** bibtex
@ -1085,7 +1085,7 @@ indicator instead of just the indicator (which is sometimes cryptic).
* New Modes and Packages in Emacs 27.1 * New Modes and Packages in Emacs 27.1
** multifile.el lets one setup multifile operations like search&replace. ** fileloop.el lets one setup multifile operations like search&replace.
+++ +++
** Emacs can now visit files in archives as if they were directories. ** Emacs can now visit files in archives as if they were directories.

View file

@ -2859,11 +2859,11 @@ is part of a file name (i.e., has the text property `dired-filename')."
Stops when a match is found. Stops when a match is found.
To continue searching for next match, use command \\[tags-loop-continue]." To continue searching for next match, use command \\[tags-loop-continue]."
(interactive "sSearch marked files (regexp): ") (interactive "sSearch marked files (regexp): ")
(multifile-initialize-search (fileloop-initialize-search
regexp regexp
(dired-get-marked-files nil nil #'dired-nondirectory-p) (dired-get-marked-files nil nil #'dired-nondirectory-p)
'default) 'default)
(multifile-continue)) (fileloop-continue))
;;;###autoload ;;;###autoload
(defun dired-do-query-replace-regexp (from to &optional delimited) (defun dired-do-query-replace-regexp (from to &optional delimited)
@ -2881,11 +2881,11 @@ with the command \\[tags-loop-continue]."
(if (and buffer (with-current-buffer buffer (if (and buffer (with-current-buffer buffer
buffer-read-only)) buffer-read-only))
(error "File `%s' is visited read-only" file)))) (error "File `%s' is visited read-only" file))))
(multifile-initialize-replace (fileloop-initialize-replace
from to (dired-get-marked-files nil nil #'dired-nondirectory-p) from to (dired-get-marked-files nil nil #'dired-nondirectory-p)
(if (equal from (downcase from)) nil 'default) (if (equal from (downcase from)) nil 'default)
delimited) delimited)
(multifile-continue)) (fileloop-continue))
(declare-function xref--show-xrefs "xref") (declare-function xref--show-xrefs "xref")
(declare-function xref-query-replace-in-results "xref") (declare-function xref-query-replace-in-results "xref")

View file

@ -1,4 +1,4 @@
;;; multifile.el --- Operations on multiple files -*- lexical-binding: t; -*- ;;; fileloop.el --- Operations on multiple files -*- lexical-binding: t; -*-
;; Copyright (C) 2018-2019 Free Software Foundation, Inc. ;; Copyright (C) 2018-2019 Free Software Foundation, Inc.
@ -24,11 +24,11 @@
;; version of etags.el. ;; version of etags.el.
;; TODO: ;; TODO:
;; - Maybe it would make sense to replace the multifile--* vars with a single ;; - Maybe it would make sense to replace the fileloop--* vars with a single
;; global var holding a struct, and then stash those structs into a history ;; global var holding a struct, and then stash those structs into a history
;; of past operations, so you can perform a multifile-search while in the ;; of past operations, so you can perform a fileloop-search while in the
;; middle of a multifile-replace and later go back to that ;; middle of a fileloop-replace and later go back to that
;; multifile-replace. ;; fileloop-replace.
;; - Make multi-isearch work on top of this library (might require changes ;; - Make multi-isearch work on top of this library (might require changes
;; to this library, of course). ;; to this library, of course).
@ -36,12 +36,12 @@
(require 'generator) (require 'generator)
(defgroup multifile nil (defgroup fileloop nil
"Operations on multiple files." "Operations on multiple files."
:group 'tools) :group 'tools)
(defcustom multifile-revert-buffers 'silent (defcustom fileloop-revert-buffers 'silent
"Whether to revert files during multifile operation. "Whether to revert files during fileloop operation.
`silent' means to only do it if `revert-without-query' is applicable; `silent' means to only do it if `revert-without-query' is applicable;
t means to offer to do it for all applicable files; t means to offer to do it for all applicable files;
nil means never to do it" nil means never to do it"
@ -49,17 +49,17 @@
;; FIXME: This already exists in GNU ELPA's iterator.el. Maybe it should move ;; FIXME: This already exists in GNU ELPA's iterator.el. Maybe it should move
;; to generator.el? ;; to generator.el?
(iter-defun multifile--list-to-iterator (list) (iter-defun fileloop--list-to-iterator (list)
(while list (iter-yield (pop list)))) (while list (iter-yield (pop list))))
(defvar multifile--iterator iter-empty) (defvar fileloop--iterator iter-empty)
(defvar multifile--scan-function (defvar fileloop--scan-function
(lambda () (user-error "No operation in progress"))) (lambda () (user-error "No operation in progress")))
(defvar multifile--operate-function #'ignore) (defvar fileloop--operate-function #'ignore)
(defvar multifile--freshly-initialized nil) (defvar fileloop--freshly-initialized nil)
;;;###autoload ;;;###autoload
(defun multifile-initialize (files scan-function operate-function) (defun fileloop-initialize (files scan-function operate-function)
"Initialize a new round of operation on several files. "Initialize a new round of operation on several files.
FILES can be either a list of file names, or an iterator (used with `iter-next') FILES can be either a list of file names, or an iterator (used with `iter-next')
which returns a file name at each step. which returns a file name at each step.
@ -69,18 +69,18 @@ OPERATE-FUNCTION is a function called with no argument; it is expected
to perform the operation on the current file buffer and when done to perform the operation on the current file buffer and when done
should return non-nil to mean that we should immediately continue should return non-nil to mean that we should immediately continue
operating on the next file and nil otherwise." operating on the next file and nil otherwise."
(setq multifile--iterator (setq fileloop--iterator
(if (and (listp files) (not (functionp files))) (if (and (listp files) (not (functionp files)))
(multifile--list-to-iterator files) (fileloop--list-to-iterator files)
files)) files))
(setq multifile--scan-function scan-function) (setq fileloop--scan-function scan-function)
(setq multifile--operate-function operate-function) (setq fileloop--operate-function operate-function)
(setq multifile--freshly-initialized t)) (setq fileloop--freshly-initialized t))
(defun multifile-next-file (&optional novisit) (defun fileloop-next-file (&optional novisit)
;; FIXME: Should we provide an interactive command, like tags-next-file? ;; FIXME: Should we provide an interactive command, like tags-next-file?
(let ((next (condition-case nil (let ((next (condition-case nil
(iter-next multifile--iterator) (iter-next fileloop--iterator)
(iter-end-of-sequence nil)))) (iter-end-of-sequence nil))))
(unless next (unless next
(and novisit (and novisit
@ -91,9 +91,9 @@ operating on the next file and nil otherwise."
(new (not buffer))) (new (not buffer)))
;; Optionally offer to revert buffers ;; Optionally offer to revert buffers
;; if the files have changed on disk. ;; if the files have changed on disk.
(and buffer multifile-revert-buffers (and buffer fileloop-revert-buffers
(not (verify-visited-file-modtime buffer)) (not (verify-visited-file-modtime buffer))
(if (eq multifile-revert-buffers 'silent) (if (eq fileloop-revert-buffers 'silent)
(and (not (buffer-modified-p buffer)) (and (not (buffer-modified-p buffer))
(let ((revertible nil)) (let ((revertible nil))
(dolist (re revert-without-query) (dolist (re revert-without-query)
@ -118,7 +118,7 @@ operating on the next file and nil otherwise."
(insert-file-contents new nil)) (insert-file-contents new nil))
new))) new)))
(defun multifile-continue () (defun fileloop-continue ()
"Continue last multi-file operation." "Continue last multi-file operation."
(interactive) (interactive)
(let (new (let (new
@ -131,10 +131,10 @@ operating on the next file and nil otherwise."
(progn (progn
;; Scan files quickly for the first or next interesting one. ;; Scan files quickly for the first or next interesting one.
;; This starts at point in the current buffer. ;; This starts at point in the current buffer.
(while (or multifile--freshly-initialized file-finished (while (or fileloop--freshly-initialized file-finished
(save-restriction (save-restriction
(widen) (widen)
(not (funcall multifile--scan-function)))) (not (funcall fileloop--scan-function))))
;; If nothing was found in the previous file, and ;; If nothing was found in the previous file, and
;; that file isn't in a temp buffer, restore point to ;; that file isn't in a temp buffer, restore point to
;; where it was. ;; where it was.
@ -142,17 +142,17 @@ operating on the next file and nil otherwise."
(goto-char original-point)) (goto-char original-point))
(setq file-finished nil) (setq file-finished nil)
(setq new (multifile-next-file t)) (setq new (fileloop-next-file t))
;; If NEW is non-nil, we got a temp buffer, ;; If NEW is non-nil, we got a temp buffer,
;; and NEW is the file name. ;; and NEW is the file name.
(when (or messaged (when (or messaged
(and (not multifile--freshly-initialized) (and (not fileloop--freshly-initialized)
(> baud-rate search-slow-speed) (> baud-rate search-slow-speed)
(setq messaged t))) (setq messaged t)))
(message "Scanning file %s..." (or new buffer-file-name))) (message "Scanning file %s..." (or new buffer-file-name)))
(setq multifile--freshly-initialized nil) (setq fileloop--freshly-initialized nil)
(setq original-point (if new nil (point))) (setq original-point (if new nil (point)))
(goto-char (point-min))) (goto-char (point-min)))
@ -172,13 +172,13 @@ operating on the next file and nil otherwise."
;; If value is non-nil, continue to scan the next file. ;; If value is non-nil, continue to scan the next file.
(save-restriction (save-restriction
(widen) (widen)
(funcall multifile--operate-function))) (funcall fileloop--operate-function)))
(setq file-finished t)))) (setq file-finished t))))
;;;###autoload ;;;###autoload
(defun multifile-initialize-search (regexp files case-fold) (defun fileloop-initialize-search (regexp files case-fold)
(let ((last-buffer (current-buffer))) (let ((last-buffer (current-buffer)))
(multifile-initialize (fileloop-initialize
files files
(lambda () (lambda ()
(let ((case-fold-search (let ((case-fold-search
@ -191,16 +191,16 @@ operating on the next file and nil otherwise."
nil)))) nil))))
;;;###autoload ;;;###autoload
(defun multifile-initialize-replace (from to files case-fold &optional delimited) (defun fileloop-initialize-replace (from to files case-fold &optional delimited)
"Initialize a new round of query&replace on several files. "Initialize a new round of query&replace on several files.
FROM is a regexp and TO is the replacement to use. FROM is a regexp and TO is the replacement to use.
FILES describes the file, as in `multifile-initialize'. FILES describes the file, as in `fileloop-initialize'.
CASE-FOLD can be t, nil, or `default', the latter one meaning to obey CASE-FOLD can be t, nil, or `default', the latter one meaning to obey
the default setting of `case-fold-search'. the default setting of `case-fold-search'.
DELIMITED if non-nil means replace only word-delimited matches." DELIMITED if non-nil means replace only word-delimited matches."
;; FIXME: Not sure how the delimited-flag interacts with the regexp-flag in ;; FIXME: Not sure how the delimited-flag interacts with the regexp-flag in
;; `perform-replace', so I just try to mimic the old code. ;; `perform-replace', so I just try to mimic the old code.
(multifile-initialize (fileloop-initialize
files files
(lambda () (lambda ()
(let ((case-fold-search (let ((case-fold-search
@ -213,5 +213,5 @@ DELIMITED if non-nil means replace only word-delimited matches."
(lambda () (lambda ()
(perform-replace from to t t delimited nil multi-query-replace-map)))) (perform-replace from to t t delimited nil multi-query-replace-map))))
(provide 'multifile) (provide 'fileloop)
;;; multifile.el ends here ;;; fileloop.el ends here

View file

@ -11493,7 +11493,7 @@ argument is passed to `next-file', which see).
\(fn &optional FIRST-TIME)" t nil) \(fn &optional FIRST-TIME)" t nil)
(make-obsolete 'tags-loop-continue 'multifile-continue '"27.1") (make-obsolete 'tags-loop-continue 'fileloop-continue '"27.1")
(autoload 'tags-search "etags" "\ (autoload 'tags-search "etags" "\
Search through all files listed in tags table for match for REGEXP. Search through all files listed in tags table for match for REGEXP.
@ -11512,7 +11512,7 @@ Do `query-replace-regexp' of FROM with TO on all files listed in tags table.
Third arg DELIMITED (prefix arg) means replace only word-delimited matches. Third arg DELIMITED (prefix arg) means replace only word-delimited matches.
If you exit (\\[keyboard-quit], RET or q), you can resume the query replace If you exit (\\[keyboard-quit], RET or q), you can resume the query replace
with the command \\[tags-loop-continue]. with the command \\[tags-loop-continue].
For non-interactive use, superceded by `multifile-initialize-replace'. For non-interactive use, superceded by `fileloop-initialize-replace'.
\(fn FROM TO &optional DELIMITED FILES)" t nil) \(fn FROM TO &optional DELIMITED FILES)" t nil)
@ -22298,10 +22298,10 @@ QUALITY can be:
;;;*** ;;;***
;;;### (autoloads nil "multifile" "multifile.el" (0 0 0 0)) ;;;### (autoloads nil "fileloop" "fileloop.el" (0 0 0 0))
;;; Generated autoloads from multifile.el ;;; Generated autoloads from fileloop.el
(autoload 'multifile-initialize "multifile" "\ (autoload 'fileloop-initialize "fileloop" "\
Initialize a new round of operation on several files. Initialize a new round of operation on several files.
FILES can be either a list of file names, or an iterator (used with `iter-next') FILES can be either a list of file names, or an iterator (used with `iter-next')
which returns a file name at each step. which returns a file name at each step.
@ -22314,22 +22314,22 @@ operating on the next file and nil otherwise.
\(fn FILES SCAN-FUNCTION OPERATE-FUNCTION)" nil nil) \(fn FILES SCAN-FUNCTION OPERATE-FUNCTION)" nil nil)
(autoload 'multifile-initialize-search "multifile" "\ (autoload 'fileloop-initialize-search "fileloop" "\
\(fn REGEXP FILES CASE-FOLD)" nil nil) \(fn REGEXP FILES CASE-FOLD)" nil nil)
(autoload 'multifile-initialize-replace "multifile" "\ (autoload 'fileloop-initialize-replace "fileloop" "\
Initialize a new round of query&replace on several files. Initialize a new round of query&replace on several files.
FROM is a regexp and TO is the replacement to use. FROM is a regexp and TO is the replacement to use.
FILES describes the file, as in `multifile-initialize'. FILES describes the file, as in `fileloop-initialize'.
CASE-FOLD can be t, nil, or `default', the latter one meaning to obey CASE-FOLD can be t, nil, or `default', the latter one meaning to obey
the default setting of `case-fold-search'. the default setting of `case-fold-search'.
DELIMITED if non-nil means replace only word-delimited matches. DELIMITED if non-nil means replace only word-delimited matches.
\(fn FROM TO FILES CASE-FOLD &optional DELIMITED)" nil nil) \(fn FROM TO FILES CASE-FOLD &optional DELIMITED)" nil nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "multifile" '("multifile-"))) (if (fboundp 'register-definition-prefixes) (register-definition-prefixes "fileloop" '("fileloop-")))
;;;*** ;;;***
@ -26455,14 +26455,14 @@ recognized.
(autoload 'project-search "project" "\ (autoload 'project-search "project" "\
Search for REGEXP in all the files of the project. Search for REGEXP in all the files of the project.
Stops when a match is found. Stops when a match is found.
To continue searching for next match, use command \\[multifile-continue]. To continue searching for next match, use command \\[fileloop-continue].
\(fn REGEXP)" t nil) \(fn REGEXP)" t nil)
(autoload 'project-query-replace "project" "\ (autoload 'project-query-replace "project" "\
Search for REGEXP in all the files of the project. Search for REGEXP in all the files of the project.
Stops when a match is found. Stops when a match is found.
To continue searching for next match, use command \\[multifile-continue]. To continue searching for next match, use command \\[fileloop-continue].
\(fn FROM TO)" t nil) \(fn FROM TO)" t nil)

View file

@ -309,7 +309,7 @@
menu-bar-separator) menu-bar-separator)
(bindings--define-key menu [tags-continue] (bindings--define-key menu [tags-continue]
'(menu-item "Continue Tags Search" multifile-continue '(menu-item "Continue Tags Search" fileloop-continue
:help "Continue last tags search operation")) :help "Continue last tags search operation"))
(bindings--define-key menu [tags-srch] (bindings--define-key menu [tags-srch]
'(menu-item "Search Tagged Files..." tags-search '(menu-item "Search Tagged Files..." tags-search
@ -358,7 +358,7 @@
(defvar menu-bar-replace-menu (defvar menu-bar-replace-menu
(let ((menu (make-sparse-keymap "Replace"))) (let ((menu (make-sparse-keymap "Replace")))
(bindings--define-key menu [tags-repl-continue] (bindings--define-key menu [tags-repl-continue]
'(menu-item "Continue Replace" multifile-continue '(menu-item "Continue Replace" fileloop-continue
:help "Continue last tags replace operation")) :help "Continue last tags replace operation"))
(bindings--define-key menu [tags-repl] (bindings--define-key menu [tags-repl]
'(menu-item "Replace in Tagged Files..." tags-query-replace '(menu-item "Replace in Tagged Files..." tags-query-replace

View file

@ -36,7 +36,7 @@
(require 'ring) (require 'ring)
(require 'button) (require 'button)
(require 'xref) (require 'xref)
(require 'multifile) (require 'fileloop)
;;;###autoload ;;;###autoload
(defvar tags-file-name nil (defvar tags-file-name nil
@ -1693,12 +1693,12 @@ Point should be just after a string that matches TAG."
(let ((bol (point))) (let ((bol (point)))
(and (search-forward "\177" (line-end-position) t) (and (search-forward "\177" (line-end-position) t)
(re-search-backward re bol t))))) (re-search-backward re bol t)))))
(define-obsolete-variable-alias 'tags-loop-revert-buffers 'multifile-revert-buffers "27.1") (define-obsolete-variable-alias 'tags-loop-revert-buffers 'fileloop-revert-buffers "27.1")
;;;###autoload ;;;###autoload
(defalias 'next-file 'tags-next-file) (defalias 'next-file 'tags-next-file)
(make-obsolete 'next-file (make-obsolete 'next-file
"use tags-next-file or multifile-initialize and multifile-next-file instead" "27.1") "use tags-next-file or fileloop-initialize and fileloop-next-file instead" "27.1")
;;;###autoload ;;;###autoload
(defun tags-next-file (&optional initialize novisit) (defun tags-next-file (&optional initialize novisit)
"Select next file among files in current tags table. "Select next file among files in current tags table.
@ -1716,7 +1716,7 @@ if the file was newly read in, the value is the filename."
(interactive (list (if current-prefix-arg t))) (interactive (list (if current-prefix-arg t)))
(when initialize ;; Not the first run. (when initialize ;; Not the first run.
(tags--compat-initialize initialize)) (tags--compat-initialize initialize))
(multifile-next-file novisit) (fileloop-next-file novisit)
(switch-to-buffer (current-buffer))) (switch-to-buffer (current-buffer)))
(defun tags--all-files () (defun tags--all-files ()
@ -1742,11 +1742,11 @@ if the file was newly read in, the value is the filename."
(mapcar #'expand-file-name (tags-table-files))))) (mapcar #'expand-file-name (tags-table-files)))))
files))) files)))
(make-obsolete-variable 'tags-loop-operate 'multifile-initialize "27.1") (make-obsolete-variable 'tags-loop-operate 'fileloop-initialize "27.1")
(defvar tags-loop-operate nil (defvar tags-loop-operate nil
"Form for `tags-loop-continue' to eval to change one file.") "Form for `tags-loop-continue' to eval to change one file.")
(make-obsolete-variable 'tags-loop-scan 'multifile-initialize "27.1") (make-obsolete-variable 'tags-loop-scan 'fileloop-initialize "27.1")
(defvar tags-loop-scan (defvar tags-loop-scan
'(user-error "%s" '(user-error "%s"
(substitute-command-keys (substitute-command-keys
@ -1775,7 +1775,7 @@ Bind `case-fold-search' during the evaluation, depending on the value of
(eval files)))) (eval files))))
(defun tags--compat-initialize (initialize) (defun tags--compat-initialize (initialize)
(multifile-initialize (fileloop-initialize
(tags--compat-files initialize) (tags--compat-files initialize)
(if tags-loop-operate (if tags-loop-operate
(lambda () (tags-loop-eval tags-loop-operate)) (lambda () (tags-loop-eval tags-loop-operate))
@ -1792,11 +1792,11 @@ argument is passed to `next-file', which see)."
;; interesting (it returns non-nil if so) and `tags-loop-operate' is a form to ;; interesting (it returns non-nil if so) and `tags-loop-operate' is a form to
;; evaluate to operate on an interesting file. If the latter evaluates to ;; evaluate to operate on an interesting file. If the latter evaluates to
;; nil, we exit; otherwise we scan the next file. ;; nil, we exit; otherwise we scan the next file.
(declare (obsolete multifile-continue "27.1")) (declare (obsolete fileloop-continue "27.1"))
(interactive) (interactive)
(when first-time ;; Backward compatibility. (when first-time ;; Backward compatibility.
(tags--compat-initialize first-time)) (tags--compat-initialize first-time))
(multifile-continue)) (fileloop-continue))
;; We use it to detect when the last loop was a tags-search. ;; We use it to detect when the last loop was a tags-search.
(defvar tags--last-search-operate-function nil) (defvar tags--last-search-operate-function nil)
@ -1813,18 +1813,18 @@ The search will be restricted to these files.
Also see the documentation of the `tags-file-name' variable." Also see the documentation of the `tags-file-name' variable."
(interactive "sTags search (regexp): ") (interactive "sTags search (regexp): ")
(unless (and (equal regexp "") (unless (and (equal regexp "")
;; FIXME: If some other multifile operation took place, ;; FIXME: If some other fileloop operation took place,
;; rather than search for "", we should repeat the last search! ;; rather than search for "", we should repeat the last search!
(eq multifile--operate-function (eq fileloop--operate-function
tags--last-search-operate-function)) tags--last-search-operate-function))
(multifile-initialize-search (fileloop-initialize-search
regexp regexp
(tags--compat-files (or files t)) (tags--compat-files (or files t))
tags-case-fold-search) tags-case-fold-search)
;; Store it, so we can detect if some other multifile operation took ;; Store it, so we can detect if some other fileloop operation took
;; place since the last search! ;; place since the last search!
(setq tags--last-search-operate-function multifile--operate-function)) (setq tags--last-search-operate-function fileloop--operate-function))
(multifile-continue)) (fileloop-continue))
;;;###autoload ;;;###autoload
(defun tags-query-replace (from to &optional delimited files) (defun tags-query-replace (from to &optional delimited files)
@ -1832,15 +1832,15 @@ Also see the documentation of the `tags-file-name' variable."
Third arg DELIMITED (prefix arg) means replace only word-delimited matches. Third arg DELIMITED (prefix arg) means replace only word-delimited matches.
If you exit (\\[keyboard-quit], RET or q), you can resume the query replace If you exit (\\[keyboard-quit], RET or q), you can resume the query replace
with the command \\[tags-loop-continue]. with the command \\[tags-loop-continue].
For non-interactive use, superceded by `multifile-initialize-replace'." For non-interactive use, superceded by `fileloop-initialize-replace'."
(declare (advertised-calling-convention (from to &optional delimited) "27.1")) (declare (advertised-calling-convention (from to &optional delimited) "27.1"))
(interactive (query-replace-read-args "Tags query replace (regexp)" t t)) (interactive (query-replace-read-args "Tags query replace (regexp)" t t))
(multifile-initialize-replace (fileloop-initialize-replace
from to from to
(tags--compat-files (or files t)) (tags--compat-files (or files t))
(if (equal from (downcase from)) nil 'default) (if (equal from (downcase from)) nil 'default)
delimited) delimited)
(multifile-continue)) (fileloop-continue))
(defun tags-complete-tags-table-file (string predicate what) ; Doc string? (defun tags-complete-tags-table-file (string predicate what) ; Doc string?
(save-excursion (save-excursion

View file

@ -511,30 +511,30 @@ recognized."
inherit-input-method))) inherit-input-method)))
(concat common-parent-directory res))) (concat common-parent-directory res)))
(declare-function multifile-continue "multifile" ()) (declare-function fileloop-continue "fileloop" ())
;;;###autoload ;;;###autoload
(defun project-search (regexp) (defun project-search (regexp)
"Search for REGEXP in all the files of the project. "Search for REGEXP in all the files of the project.
Stops when a match is found. Stops when a match is found.
To continue searching for next match, use command \\[multifile-continue]." To continue searching for next match, use command \\[fileloop-continue]."
(interactive "sSearch (regexp): ") (interactive "sSearch (regexp): ")
(multifile-initialize-search (fileloop-initialize-search
regexp (project-files (project-current t)) 'default) regexp (project-files (project-current t)) 'default)
(multifile-continue)) (fileloop-continue))
;;;###autoload ;;;###autoload
(defun project-query-replace (from to) (defun project-query-replace (from to)
"Search for REGEXP in all the files of the project. "Search for REGEXP in all the files of the project.
Stops when a match is found. Stops when a match is found.
To continue searching for next match, use command \\[multifile-continue]." To continue searching for next match, use command \\[fileloop-continue]."
(interactive (interactive
(pcase-let ((`(,from ,to) (pcase-let ((`(,from ,to)
(query-replace-read-args "Query replace (regexp)" t t))) (query-replace-read-args "Query replace (regexp)" t t)))
(list from to))) (list from to)))
(multifile-initialize-replace (fileloop-initialize-replace
from to (project-files (project-current t)) 'default) from to (project-files (project-current t)) 'default)
(multifile-continue)) (fileloop-continue))
(provide 'project) (provide 'project)
;;; project.el ends here ;;; project.el ends here