Use read-string instead of completing-read for dired-do-touch
authorJuri Linkov <juri@linkov.net>
Tue, 21 May 2024 06:20:01 +0000 (09:20 +0300)
committerJuri Linkov <juri@linkov.net>
Tue, 21 May 2024 06:20:01 +0000 (09:20 +0300)
* lisp/dired-aux.el (dired-mark-read-string): Use read-string
when op-symbol is 'touch' (bug#70725).

lisp/dired-aux.el

index a2ce3083cfec596403a31db74590f5510f0303ae..b5eea4c74f68633c1e6fe544c393155346cbeaa6 100644 (file)
@@ -658,10 +658,13 @@ values, passed as the seventh arg to `completing-read'.
 
 Optional arg COLLECTION is a collection of possible completions,
 passed as the second arg to `completing-read'."
-  (dired-mark-pop-up nil op-symbol files
-                    'completing-read
-                    (format prompt (dired-mark-prompt arg files))
-                    collection nil nil initial nil default-value nil))
+  (apply #'dired-mark-pop-up
+         nil op-symbol files
+         (if (eq op-symbol 'touch) 'read-string 'completing-read)
+         (format prompt (dired-mark-prompt arg files))
+         (if (eq op-symbol 'touch)
+             `(,initial nil ,default-value nil)
+           `(,collection nil nil ,initial nil ,default-value nil))))
 
 \f
 ;;; Cleaning a directory: flagging some backups for deletion