Function: vc-dir-mark-file

vc-dir-mark-file is a byte-compiled function defined in vc-dir.el.gz.

Signature

(vc-dir-mark-file &optional ARG)

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc-dir.el.gz
(defun vc-dir-mark-file (&optional arg)
  ;; Mark ARG or the current file and move to the next line.
  (let* ((crt (or arg (ewoc-locate vc-ewoc)))
         (file (ewoc-data crt))
	 (isdir (vc-dir-fileinfo->directory file))
	 ;; Forbid marking a directory containing marked files in its
	 ;; tree, or a file in a marked directory tree.
	 (conflict (if isdir
		       (vc-dir-children-marked-p crt)
		     (vc-dir-parent-marked-p crt))))
    (when conflict
      (error (if isdir
		 "File `%s' in this directory is already marked"
	       "Parent directory `%s' is already marked")
	     (vc-dir-fileinfo->name conflict)))
    (setf (vc-dir-fileinfo->marked file) t)
    (ewoc-invalidate vc-ewoc crt)
    (unless (or arg (mouse-event-p last-command-event))
      (vc-dir-next-line 1))))