Created
January 22, 2014 16:43
-
-
Save kyanagi/8562198 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun kill-buffer-file-name (nondirectory-p) | |
(interactive "P") | |
(let ((file-name (buffer-file-name))) | |
(if (stringp file-name) | |
(progn | |
(when nondirectory-p | |
(setq file-name (file-name-nondirectory file-name))) | |
(message "%s" file-name) | |
(kill-new file-name)) | |
(error "This buffer does not visit a file")))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment