emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/vc-hooks.el,v


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/vc-hooks.el,v
Date: Mon, 23 Jul 2007 21:07:05 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        07/07/23 21:07:05

Index: vc-hooks.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/vc-hooks.el,v
retrieving revision 1.196
retrieving revision 1.197
diff -u -b -r1.196 -r1.197
--- vc-hooks.el 23 Jul 2007 19:44:56 -0000      1.196
+++ vc-hooks.el 23 Jul 2007 21:07:03 -0000      1.197
@@ -716,34 +716,35 @@
             ;; any VC Dired buffer to synchronize.
             (vc-dired-resynch-file file)))))
 
+(defconst vc-mode-line-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map [mode-line down-mouse-1] 'vc-menu-map)
+    map))
+
 (defun vc-mode-line (file)
   "Set `vc-mode' to display type of version control for FILE.
 The value is set in the current buffer, which should be the buffer
 visiting FILE."
   (interactive (list buffer-file-name))
-  (let ((backend (vc-backend file))
-       ml-string ml-echo)
+  (let ((backend (vc-backend file)))
     (if (not backend)
        (setq vc-mode nil)
-      (setq ml-string (vc-call mode-line-string file))
-      (setq ml-echo (get-text-property 0 'help-echo ml-string))
+      (let* ((ml-string (vc-call mode-line-string file))
+             (ml-echo (get-text-property 0 'help-echo ml-string)))
       (setq vc-mode
            (concat
             " "
-            (if vc-display-status
+               (if (null vc-display-status)
+                   (symbol-name backend)
                 (propertize
                  ml-string
                  'mouse-face 'mode-line-highlight
                  'help-echo
-                 (concat (if ml-echo
-                             ml-echo
+                  (concat (or ml-echo
                            (format "File under the %s version control system"
                                    backend))
                          "\nmouse-1: Version Control menu")
-                 'local-map (let ((map (make-sparse-keymap)))
-                              (define-key map [mode-line down-mouse-1]
-                                'vc-menu-map) map))
-              (symbol-name backend))))
+                  'local-map vc-mode-line-map)))))
       ;; If the file is locked by some other user, make
       ;; the buffer read-only.  Like this, even root
       ;; cannot modify a file that someone else has locked.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]