]> code.delx.au - gnu-emacs/blobdiff - lisp/vc/vc-dir.el
Faces names should not end in "-face".
[gnu-emacs] / lisp / vc / vc-dir.el
index c90bf1c2343eea30696ee2f442aa0c180cc09ccf..028e4257d1189809df42c3f945aa9ccb75378983 100644 (file)
@@ -1,6 +1,6 @@
 ;;; vc-dir.el --- Directory status display under VC  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2007-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2016 Free Software Foundation, Inc.
 
 ;; Author:   Dan Nicolaescu <dann@ics.uci.edu>
 ;; Keywords: vc tools
@@ -111,7 +111,7 @@ See `run-hooks'."
           (current-buffer)))))
 
 (defvar vc-dir-menu-map
-  (let ((map (make-sparse-keymap "VC-dir")))
+  (let ((map (make-sparse-keymap "VC-Dir")))
     (define-key map [quit]
       '(menu-item "Quit" quit-window
                  :help "Quit"))
@@ -204,6 +204,10 @@ See `run-hooks'."
                  :help "List the change log for the current tree in a window"))
     ;; VC commands.
     (define-key map [sepvccmd] '("--"))
+    (define-key map [push]
+      '(menu-item "Push Changes" vc-push
+                 :enable (vc-find-backend-function vc-dir-backend 'push)
+                 :help "Push the current branch's changes"))
     (define-key map [update]
       '(menu-item "Update to Latest Version" vc-update
                  :help "Update the current fileset's files to their tip revisions"))
@@ -246,6 +250,8 @@ See `run-hooks'."
     (define-key map "D" 'vc-root-diff)    ;; C-x v D
     (define-key map "i" 'vc-register)     ;; C-x v i
     (define-key map "+" 'vc-update)       ;; C-x v +
+    ;; I'd prefer some kind of symmetry with vc-update:
+    (define-key map "P" 'vc-push)         ;; C-x v P
     (define-key map "l" 'vc-print-log)    ;; C-x v l
     (define-key map "L" 'vc-print-root-log) ;; C-x v L
     (define-key map "I" 'vc-log-incoming)   ;; C-x v I
@@ -265,6 +271,7 @@ See `run-hooks'."
     (define-key map " " 'vc-dir-next-line)
     (define-key map "\t" 'vc-dir-next-directory)
     (define-key map "p" 'vc-dir-previous-line)
+    (define-key map [?\S-\ ] 'vc-dir-previous-line)
     (define-key map [backtab] 'vc-dir-previous-directory)
     ;;; Rebind paragraph-movement commands.
     (define-key map "\M-}" 'vc-dir-next-directory)
@@ -294,7 +301,7 @@ See `run-hooks'."
       `(menu-item
        ;; VC backends can use this to add mode-specific menu items to
        ;; vc-dir-menu-map.
-       "VC-dir" ,vc-dir-menu-map :filter vc-dir-menu-map-filter))
+       "VC-Dir" ,vc-dir-menu-map :filter vc-dir-menu-map-filter))
     map)
   "Keymap for directory buffer.")
 
@@ -926,7 +933,7 @@ If it is a file, return the corresponding cons for the file itself."
 
 (defun vc-dir-resynch-file (&optional fname)
   "Update the entries for FNAME in any directory buffers that list it."
-  (let ((file (or fname (expand-file-name buffer-file-name)))
+  (let ((file (expand-file-name (or fname buffer-file-name)))
         (drop '()))
     (save-current-buffer
       ;; look for a vc-dir buffer that might show this file.
@@ -1241,7 +1248,7 @@ These are the commands available for use in the file status buffer:
     ;; Otherwise if you do C-x v d -> C-x C-f -> C-c v d
     ;; you may get a new *vc-dir* buffer, different from the original
     (file-truename (read-directory-name "VC status for directory: "
-                                       default-directory default-directory t
+                                       (vc-root-dir) nil t
                                        nil))
     (if current-prefix-arg
        (intern