Function: dired-unmark-all-files

dired-unmark-all-files is an interactive and byte-compiled function defined in dired.el.gz.

Signature

(dired-unmark-all-files MARK &optional ARG)

Documentation

Remove a specific mark (or any mark) from every file.

After this command, type the mark character to remove, or type RET to remove all marks. With prefix arg, query for each marked file. Type <f1> (help-command) at that time for help.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/dired.el.gz
(defun dired-unmark-all-files (mark &optional arg)
  "Remove a specific mark (or any mark) from every file.
After this command, type the mark character to remove,
or type RET to remove all marks.
With prefix arg, query for each marked file.
Type \\[help-command] at that time for help."
  (interactive "cRemove marks (RET means all): \nP")
  (save-excursion
    (let* ((count 0)
	   (inhibit-read-only t) case-fold-search
           dired-unmark-all-files-query
	   (string (format "\n%c" mark))
           (help-form (substitute-command-keys "\
Type \\`SPC' or \\`y' to unmark one file, \\`DEL' or \\`n' to skip to next,
\\`!' to unmark all remaining files with no more questions.")))
      (goto-char (point-min))
      (while (if (eq mark ?\r)
		 (re-search-forward dired-re-mark nil t)
	       (search-forward string nil t))
	(if (or (not arg)
		(let ((file (dired-get-filename t t)))
		  (and file
		       (dired-query 'dired-unmark-all-files-query
				    "Unmark file `%s'? "
				    file))))
	    (progn (subst-char-in-region (1- (point)) (point)
					 (preceding-char) ?\s)
		   (setq count (1+ count)))))
      (message (if (= count 1) "1 mark removed"
		 "%d marks removed")
	       count))))