]> git.eshelyaron.com Git - emacs.git/commitdiff
(vc-dir-mode-map): Bind "d" to vc-dir-delete-file.
authorSam Steingold <sds@gnu.org>
Wed, 30 Apr 2008 16:58:15 +0000 (16:58 +0000)
committerSam Steingold <sds@gnu.org>
Wed, 30 Apr 2008 16:58:15 +0000 (16:58 +0000)
(vc-dir-delete-file): Add.
(vc-delete-file): Do not barf when the file has been already deleted.

lisp/ChangeLog
lisp/vc.el

index cce6cee7a7173127a12a5182e9c82f71403ffefd..3cedeca41d5ad78586e243ef126839b58fcd990d 100644 (file)
@@ -1,3 +1,9 @@
+2008-04-30  Sam Steingold  <sds@gnu.org>
+
+       * vc.el (vc-dir-mode-map): Bind "d" to vc-dir-delete-file.
+       (vc-dir-delete-file): Add.
+       (vc-delete-file): Do not barf when the file has been already deleted.
+
 2008-04-30  Dan Nicolaescu  <dann@ics.uci.edu>
 
        * emacs-lisp/lisp-mode.el (lisp-mode-map): Add menu.
index 33148db22dfcd0e5fbbd857e31298a702f9eff81..764e52f7066204d4ad296d98dfd7bdf435e5ee62 100644 (file)
@@ -2985,6 +2985,7 @@ specific headers."
     (define-key map "x" 'vc-dir-hide-up-to-date)
     (define-key map "q" 'quit-window)
     (define-key map "g" 'vc-dir-refresh)
+    (define-key map "d" 'vc-dir-delete-file)
     (define-key map "\C-c\C-c" 'vc-dir-kill-dir-status-process)
     ;; Does not work unless mouse sets point.  Functions like vc-dir-find-file
     ;; need to find the file from the mouse position, not `point'.
@@ -3553,6 +3554,12 @@ that share the same state."
   (mapc 'vc-register (or (vc-dir-marked-files)
                          (list (vc-dir-current-file)))))
 
+(defun vc-dir-delete-file ()
+  "Delete the marked files, or the current file if no marks."
+  (interactive)
+  (mapc 'vc-delete-file (or (vc-dir-marked-files)
+                            (list (vc-dir-current-file)))))
+
 (defun vc-dir-show-fileentry (file)
   "Insert an entry for a specific file into the current VC status listing.
 This is typically used if the file is up-to-date (or has been added
@@ -4022,7 +4029,8 @@ backend to NEW-BACKEND, and unregister FILE from the current backend.
     (unless (y-or-n-p (format "Really want to delete %s? "
                              (file-name-nondirectory file)))
       (error "Abort!"))
-    (unless (or (file-directory-p file) (null make-backup-files))
+    (unless (or (file-directory-p file) (null make-backup-files)
+                (not (file-exists-p file)))
       (with-current-buffer (or buf (find-file-noselect file))
        (let ((backup-inhibited nil))
          (backup-buffer))