]> git.eshelyaron.com Git - emacs.git/commitdiff
Use state prettyprinter in vc-dir buffers.
authorEric S. Raymond <esr@snark.thyrsus.com>
Fri, 16 May 2008 22:42:36 +0000 (22:42 +0000)
committerEric S. Raymond <esr@snark.thyrsus.com>
Fri, 16 May 2008 22:42:36 +0000 (22:42 +0000)
doc/emacs/ChangeLog
doc/emacs/vc1-xtra.texi
lisp/ChangeLog
lisp/vc.el

index 54528646c7c946baa6ad44a26a56466eaf81c6cb..a8410167cf77b85e56579056904d3c90629d81e3 100644 (file)
@@ -1,3 +1,8 @@
+2008-05-16  Eric S. Raymond  <esr@snark.thyrsus.com>
+
+       * vc2-xtra.texi: Mofify an example so it reflects what vc.el 
+       now does.
+
 2008-05-15  Eric S. Raymond  <esr@snark.thyrsus.com>
 
        * vc2-xtra.texi, emacs.texi, files.texi: Snapshots node renamed to
index a9e081cb63b77625fc13f432d1814f94a0d2c245..8c0dc501070e3a5c86c03c98755ce78b4f39a69d 100644 (file)
@@ -43,8 +43,8 @@ output is used.  Here is an example using RCS:
 @smallexample
 @group
     DIRECTORY            ./
-    edited               file1.c
-    up-to-date           file2.c
+    (modified)           file1.c
+    (update)            file2.c
 @end group
 @end smallexample
 
index 9e38b1236dcf5420045f7662bef03a46a948baab..17f42d14d5dd5ad0e00de93c170bd2265e4b29db 100644 (file)
@@ -1,3 +1,11 @@
+<<<<<<< ChangeLog
+2008-05-16  Eric S. Raymond  <esr@snark.thyrsus.com>
+
+       * 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  <jpw@pobox.com>
 
        * vc-dispatcher.el (top-level): Don't require cl when compiling.
index bcb5fd18d8bf4fbffbcbcbbf7913234e27f65f0a..73f0f8a013af715833ff7b28587a394c064f99cb 100644 (file)
@@ -1808,24 +1808,24 @@ specific headers."
 (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 @@ to provide the `find-revision' operation instead."
   (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