# HG changeset patch # User Eric S. Raymond # Date 1210977756 0 # Node ID 31c82b39ac3c1ecf6b27aae06906265b95901acd # Parent b2c592fe419479ba313ae8241dd1b7ab0080c114 Use state prettyprinter in vc-dir buffers. diff -r b2c592fe4194 -r 31c82b39ac3c doc/emacs/ChangeLog --- a/doc/emacs/ChangeLog Fri May 16 22:39:45 2008 +0000 +++ b/doc/emacs/ChangeLog Fri May 16 22:42:36 2008 +0000 @@ -1,3 +1,8 @@ +2008-05-16 Eric S. Raymond + + * vc2-xtra.texi: Mofify an example so it reflects what vc.el + now does. + 2008-05-15 Eric S. Raymond * vc2-xtra.texi, emacs.texi, files.texi: Snapshots node renamed to diff -r b2c592fe4194 -r 31c82b39ac3c doc/emacs/vc1-xtra.texi --- a/doc/emacs/vc1-xtra.texi Fri May 16 22:39:45 2008 +0000 +++ b/doc/emacs/vc1-xtra.texi Fri May 16 22:42:36 2008 +0000 @@ -43,8 +43,8 @@ @smallexample @group DIRECTORY ./ - edited file1.c - up-to-date file2.c + (modified) file1.c + (update) file2.c @end group @end smallexample diff -r b2c592fe4194 -r 31c82b39ac3c lisp/ChangeLog --- a/lisp/ChangeLog Fri May 16 22:39:45 2008 +0000 +++ b/lisp/ChangeLog Fri May 16 22:42:36 2008 +0000 @@ -1,3 +1,11 @@ +<<<<<<< ChangeLog +2008-05-16 Eric S. Raymond + + * vc.el (vc-default-status-printer) + (vc-default-prettify-state-info): Enhance the state prettyprinter + to deall better with unknown states and indirect through it when + painting vc-dir buffers. + 2008-05-16 John Paul Wallington * vc-dispatcher.el (top-level): Don't require cl when compiling. diff -r b2c592fe4194 -r 31c82b39ac3c lisp/vc.el --- a/lisp/vc.el Fri May 16 22:39:45 2008 +0000 +++ b/lisp/vc.el Fri May 16 22:42:36 2008 +0000 @@ -1808,24 +1808,24 @@ (defun vc-default-status-printer (backend fileentry) "Pretty print FILEENTRY." ;; If you change the layout here, change vc-dir-move-to-goal-column. - (let ((state - (if (vc-dir-fileinfo->directory fileentry) - 'DIRECTORY - (vc-dir-fileinfo->state fileentry)))) + (let* ((isdir (vc-dir-fileinfo->directory fileentry)) + (state (if isdir 'DIRECTORY (vc-dir-fileinfo->state fileentry))) + (filename (vc-dir-fileinfo->name fileentry)) + (prettified (if isdir state (vc-call-backend backend 'prettify-state-info filename)))) (insert (propertize (format "%c" (if (vc-dir-fileinfo->marked fileentry) ?* ? )) 'face 'font-lock-type-face) " " (propertize - (format "%-20s" state) + (format "%-20s" prettified) 'face (cond ((eq state 'up-to-date) 'font-lock-builtin-face) ((memq state '(missing conflict)) 'font-lock-warning-face) (t 'font-lock-variable-name-face)) 'mouse-face 'highlight) " " (propertize - (format "%s" (vc-dir-fileinfo->name fileentry)) + (format "%s" filename) 'face 'font-lock-function-name-face 'mouse-face 'highlight)))) @@ -2643,16 +2643,16 @@ (let* ((state (vc-state file)) (statestring (cond - ((stringp state) (concat "(" state ")")) + ((stringp state) (concat "(locked:" state ")")) ((eq state 'edited) "(modified)") ((eq state 'needs-merge) "(merge)") ((eq state 'needs-update) "(update)") ((eq state 'added) "(added)") ((eq state 'removed) "(removed)") ((eq state 'ignored) "(ignored)") - ((eq state 'unregistered) "?") + ((eq state 'unregistered) "(unregistered)") ((eq state 'unlocked-changes) "(stale)") - ((not state) "(unknown)"))) + (t (concat "(unknown:" state ")")))) (buffer (get-file-buffer file)) (modflag