I try to run crux-delete-file-and-buffer, but it gives me:
vc-delete-file: Please commit or undo your changes before deleting
Why can't it just delete it?;)
I try to run crux-delete-file-and-buffer, but it gives me:
vc-delete-file: Please commit or undo your changes before deleting
Why can't it just delete it?;)
Just delete the stupid crux* thing and use this;)
;; based on http://emacsredux.com/blog/2013/04/03/delete-file-and-buffer/
(defun delete-file-and-buffer ()
"Kill the current buffer and deletes the file it is visiting."
(interactive)
(let ((filename (buffer-file-name)))
(if filename
(if (y-or-n-p (concat "Do you really want to delete file " filename " ?"))
(progn
(delete-file filename)
(message "Deleted file %s." filename)
(kill-buffer)))
(message "Not a file visiting buffer!"))))
Found here: Github