Emacs: Simplify delete-current-buffer-file
Alan Pearce alan@alanpearce.co.uk
Thu, 10 Jul 2014 20:36:17 +0100
1 files changed, 3 insertions(+), 4 deletions(-)
jump to
M tag-emacs/emacs.d/init.el → tag-emacs/emacs.d/init.el
@@ -319,13 +319,12 @@ (defun delete-current-buffer-file () "Removes file connected to current buffer and kills buffer." (interactive) - (let ((filename (buffer-file-name)) - (buffer (current-buffer))) + (let ((filename (buffer-file-name))) (if (not (and filename (file-exists-p filename))) - (ido-kill-buffer) + (kill-this-buffer) (when (yes-or-no-p "Are you sure you want to remove this file? ") (delete-file filename) - (kill-buffer buffer) + (kill-this-buffer) (message "File '%s' successfully removed" filename))))) (req-package ws-butler