Function: vc-dir-unmark-all-files

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

Signature

(vc-dir-unmark-all-files ARG)

Documentation

Unmark all files with the same state as the current one.

If the current entry is a directory, unmark all the child files. With prefix argument ARG, unmark all files.

The commands operate on files that are on the same state. This command is intended to make it easy to deselect all files that share the same state.

See also vc-dir-simple-unmark-all-files.

Probably introduced at or before Emacs version 32.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc-dir.el.gz
(defun vc-dir-unmark-all-files (arg)
  "Unmark all files with the same state as the current one.
If the current entry is a directory, unmark all the child files.
With prefix argument ARG, unmark all files.

The commands operate on files that are on the same state.
This command is intended to make it easy to deselect all files
that share the same state.

See also `vc-dir-simple-unmark-all-files'."
  (interactive "P")
  (if (if vc-dir-simple-unmark-all-files (not arg) arg)
      (ewoc-map
       (lambda (filearg)
	 (when (vc-dir-fileinfo->marked filearg)
	   (setf (vc-dir-fileinfo->marked filearg) nil)
	   t))
       vc-ewoc)
    (let* ((crt (ewoc-locate vc-ewoc))
	   (data (ewoc-data crt)))
      (if (vc-dir-fileinfo->directory data)
	  ;; It's a directory, unmark child files.
          (let (crt-data)
	    (while (and (setq crt (ewoc-next vc-ewoc crt))
			(setq crt-data (ewoc-data crt))
			(not (vc-dir-fileinfo->directory crt-data)))
	      (setf (vc-dir-fileinfo->marked crt-data) nil)
	      (ewoc-invalidate vc-ewoc crt)))
	;; It's a file
	(let ((crt-state (vc-dir-fileinfo->state (ewoc-data crt))))
	  (ewoc-map
	   (lambda (filearg)
	     (when (and (vc-dir-fileinfo->marked filearg)
			(eq (vc-dir-fileinfo->state filearg) crt-state))
	       (setf (vc-dir-fileinfo->marked filearg) nil)
	       t))
	   vc-ewoc))))))