summary refs log tree commit diff stats
path: root/emacs
diff options
context:
space:
mode:
authorAlan Pearce2013-05-04 09:14:04 +0100
committerAlan Pearce2013-05-04 09:14:04 +0100
commitb22564bae8b4d7b62ff314456d55bbabfcdbed48 (patch)
treec2498d4a9c2076ee6eea0577259d4b663871d619 /emacs
parent7715d133347319dc8585601ac783faf2ee566f9d (diff)
downloaddotfiles-b22564bae8b4d7b62ff314456d55bbabfcdbed48.tar.lz
dotfiles-b22564bae8b4d7b62ff314456d55bbabfcdbed48.tar.zst
dotfiles-b22564bae8b4d7b62ff314456d55bbabfcdbed48.zip
Emacs: delete-current-buffer-file should use vc-delete-file when appropriate
Diffstat (limited to 'emacs')
-rw-r--r--emacs/init.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/emacs/init.el b/emacs/init.el
index 41f9821..e543b2a 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -372,9 +372,11 @@
     (if (not (and filename (file-exists-p filename)))
         (ido-kill-buffer)
       (when (yes-or-no-p "Are you sure you want to remove this file? ")
-        (delete-file filename)
-        (kill-buffer buffer)
-        (message "File '%s' successfully removed" filename)))))
+        (if (vc-backend filename)
+            (vc-delete-file filename)
+          (delete-file filename)
+          (kill-buffer buffer)
+          (message "File '%s' successfully removed" filename))))))
 
 (use-package saveplace
   :defer t