diff options
author | Alan Pearce | 2014-07-10 20:36:17 +0100 |
---|---|---|
committer | Alan Pearce | 2014-07-10 20:36:17 +0100 |
commit | 1c79164ecdab46c284def04ad374fcae94116b0d (patch) | |
tree | 06cc0d6f808ed012e3441cc6772c309bebc7a6ef /tag-emacs | |
parent | 3479cc5e532413ef4b51eda45ecc8782af43281a (diff) | |
download | dotfiles-1c79164ecdab46c284def04ad374fcae94116b0d.tar.lz dotfiles-1c79164ecdab46c284def04ad374fcae94116b0d.tar.zst dotfiles-1c79164ecdab46c284def04ad374fcae94116b0d.zip |
Emacs: Simplify delete-current-buffer-file
Diffstat (limited to 'tag-emacs')
-rw-r--r-- | tag-emacs/emacs.d/init.el | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tag-emacs/emacs.d/init.el b/tag-emacs/emacs.d/init.el index e81b313..3b36f8a 100644 --- a/tag-emacs/emacs.d/init.el +++ b/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 |