Skip to content

Instantly share code, notes, and snippets.

@takumikinjo
Created July 6, 2010 15:15
Show Gist options
  • Save takumikinjo/465510 to your computer and use it in GitHub Desktop.
Save takumikinjo/465510 to your computer and use it in GitHub Desktop.
(defun delete-file-kill-buffer ()
"Do delete-file function then kill-buffer function"
(interactive)
(let ((buf (current-buffer))
(filepath (buffer-file-name (current-buffer))))
(when (and
(not (null filepath))
(file-exists-p filepath))
(delete-file filepath))
(kill-buffer buf)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment