]> git.eshelyaron.com Git - emacs.git/commitdiff
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)
committerEshel Yaron <me@eshelyaron.com>
Thu, 23 May 2024 08:29:30 +0000 (10:29 +0200)
* lisp/dired-aux.el (dired-mark-read-string): Use read-string
when op-symbol is 'touch' (bug#70725).

(cherry picked from commit d00eb1c90253d2a353d3e9730df37fdd81c2a3d2)

lisp/dired-aux.el

index 98a8f35819975341cd423a55d5ccef42268b3c68..d5f2876c3ee16cf56a9cadadcabcaa06df5b7c00 100644 (file)
@@ -647,10 +647,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