# HG changeset patch # User Eric S. Raymond # Date 1198772237 0 # Node ID a5a588610e41f6b0d9947680532c4e690d492680 # Parent 13951469ac3aff6223c56cc681cfd5e1f9d20f03 * vc.el (vc-dired-hook): Show unregistered file status as "?" in non-terse mode. (vc-dired-ignorable-p): Ignore Makefile when it has a peer named Makefile.in or Makefile.am diff -r 13951469ac3a -r a5a588610e41 lisp/ChangeLog --- a/lisp/ChangeLog Thu Dec 27 15:26:02 2007 +0000 +++ b/lisp/ChangeLog Thu Dec 27 16:17:17 2007 +0000 @@ -5,7 +5,10 @@ ignorted in VC-Dired listings, heading off lots of expensive calls to (vc-state). - * vc.el (vc-dired-hook): Refactoring step. + * vc.el (vc-dired-hook): Show unregistered file status as "?" in + non-terse mode. + (vc-dired-ignorable-p): Ignore Makefile when it has a peer named + Makefile.in or Makefile.am 2007-12-27 Vinicius Jose Latorre diff -r 13951469ac3a -r a5a588610e41 lisp/vc.el --- a/lisp/vc.el Thu Dec 27 15:26:02 2007 +0000 +++ b/lisp/vc.el Thu Dec 27 16:17:17 2007 +0000 @@ -2330,11 +2330,18 @@ (defun vc-dired-ignorable-p (filename) "Should FILENAME be ignored in VC-Dired listings?" (catch t + ;; Ignore anything that wouldn't be found by completion (.o, .la, etc.) (dolist (ignorable completion-ignored-extensions) (let ((ext (substring filename (- (length filename) (length ignorable))))) (if (string= ignorable ext) (throw t t)))) + ;; Ignore Makefiles derived from something else + (when (string= (file-name-nondirectory filename) "Makefile") + (let* ((dir (file-name-directory filename)) + (peers (directory-files (or dir default-directory)))) + (if (or (member "Makefile.in" peers) (member "Makefile.am" peers)) + (throw t t)))) nil)) (defun vc-dired-hook () @@ -2390,12 +2397,18 @@ (t (let ((backend (vc-backend filename))) (cond - ((and backend - (not (and vc-dired-terse-mode - (vc-up-to-date-p filename)))) + ;; Not registered + ((not backend) + (if vc-dired-terse-mode + (dired-kill-line) + (vc-dired-reformat-line "?") + (forward-line 1))) + ;; Either we're in non-terse mode or it's out of date + ((not (and vc-dired-terse-mode (vc-up-to-date-p filename))) (vc-dired-reformat-line (vc-call dired-state-info filename)) (forward-line 1)) - (t + ;; Remaining cases are under version control but uninteresting + (t (dired-kill-line))))))) ;; any other line (t (forward-line 1)))) @@ -2405,7 +2418,7 @@ (widen) (cond ((eq (count-lines (point-min) (point-max)) 1) (goto-char (point-min)) - (message "No files locked under %s" default-directory))))) + (message "No changes pending under %s" default-directory))))) (defun vc-dired-purge () "Remove empty subdirs."