Skip to content

Commit

Permalink
copy-fname-to-killring default basename in lieu of easy kill ring pac…
Browse files Browse the repository at this point in the history
…kage
  • Loading branch information
YYY authored and YYY committed Nov 29, 2019
1 parent b39fc58 commit 03c6ca2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions config.org
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,13 @@ kill current buffer no prompt
copies current filename to kill-ring
#+BEGIN_SRC emacs-lisp
(defun ava/copy-fname-to-killring (&optional arg)
"Copy current buffer filename to kill ring. Only basename if called with prefix arg"
"Copy current filename (basename) to kill ring. Full name if called with prefix arg"
(interactive "P")
(let ((filename (if (equal major-mode 'dired-mode)
default-directory
(if arg
(file-name-nondirectory (buffer-file-name))
(buffer-file-name)
(buffer-file-name)
(file-name-nondirectory (buffer-file-name))
)
)))
(when filename)
Expand Down

0 comments on commit 03c6ca2

Please sign in to comment.