0

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?;)

Jason Hunter
  • 709
  • 4
  • 10

1 Answers1

0

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

Jason Hunter
  • 709
  • 4
  • 10