mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-18 20:00:36 -08:00
(dired-unmark-all-files): Read arg as a string.
This commit is contained in:
parent
1e12dd87cf
commit
8b87a30104
1 changed files with 7 additions and 10 deletions
|
|
@ -1752,22 +1752,19 @@ OLD and NEW are both characters used to mark files."
|
||||||
(delete-region (point) (1+ (point)))
|
(delete-region (point) (1+ (point)))
|
||||||
(insert-char new 1)))))
|
(insert-char new 1)))))
|
||||||
|
|
||||||
(defun dired-unmark-all-files (flag &optional arg)
|
(defun dired-unmark-all-files (mark &optional arg)
|
||||||
"Remove a specific mark or any mark from every file.
|
"Remove a specific mark or any mark from every file.
|
||||||
With prefix arg, query for each marked file.
|
With prefix arg, query for each marked file.
|
||||||
Type \\[help-command] at that time for help."
|
Type \\[help-command] at that time for help."
|
||||||
(interactive
|
(interactive "sRemove marks (RET means all): \nP")
|
||||||
(let* ((cursor-in-echo-area t))
|
|
||||||
(list (progn (message "Remove marks (RET means all): ") (read-char))
|
|
||||||
current-prefix-arg)))
|
|
||||||
(let ((count 0)
|
(let ((count 0)
|
||||||
(re (if (zerop (length flag)) dired-re-mark
|
(re (if (zerop (length mark)) dired-re-mark
|
||||||
(concat "^" (regexp-quote flag)))))
|
(concat "^" (regexp-quote mark)))))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(let (buffer-read-only case-fold-search query
|
(let (buffer-read-only case-fold-search query
|
||||||
(help-form "\
|
(help-form "\
|
||||||
Type SPC or `y' to unflag one file, DEL or `n' to skip to next,
|
Type SPC or `y' to unmark one file, DEL or `n' to skip to next,
|
||||||
`!' to unflag all remaining files with no more questions."))
|
`!' to unmark all remaining files with no more questions."))
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(while (re-search-forward re nil t)
|
(while (re-search-forward re nil t)
|
||||||
(if (or (not arg)
|
(if (or (not arg)
|
||||||
|
|
@ -1775,7 +1772,7 @@ Type SPC or `y' to unflag one file, DEL or `n' to skip to next,
|
||||||
(dired-get-filename t)))
|
(dired-get-filename t)))
|
||||||
(progn (delete-char -1) (insert " ") (setq count (1+ count))))
|
(progn (delete-char -1) (insert " ") (setq count (1+ count))))
|
||||||
(forward-line 1))))
|
(forward-line 1))))
|
||||||
(message "%s" (format "Flags removed: %d %s" count flag) )))
|
(message "%s" (format "Marks removed: %d %s" count mark))))
|
||||||
|
|
||||||
;; Logging failures operating on files, and showing the results.
|
;; Logging failures operating on files, and showing the results.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue