From: Ian Kelling Date: Thu, 13 Apr 2017 09:57:58 +0000 (-0700) Subject: write function ive wanted for a long time X-Git-Url: https://iankelling.org/git/?p=dot-emacs;a=commitdiff_plain;h=1d65b5fc7082f7c13f00241033a8f1b38d111caa;hp=f8bf76f7fbc3fbc04da5dbc0db2f16296b6fb5c2 write function ive wanted for a long time --- diff --git a/my-init.org b/my-init.org index fa7c72f..1072499 100644 --- a/my-init.org +++ b/my-init.org @@ -5293,8 +5293,9 @@ join lines #+end_src *** M-/ *** C-M-/] -copy-variable +copy-buffer-file-name #+begin_src emacs-lisp +;; haven't bound this atm, todo, maybe someday? (defun copy-variable (variable) (interactive (let ((v (variable-at-point)) @@ -5313,7 +5314,17 @@ copy-variable (list (if (equal val "") v (intern val))))) (kill-new (symbol-value variable))) -(global-set-key (kbd "C-M-/") 'copy-variable) + +(defun copy-buffer-file-name () + (interactive) + (kill-new + (cond + ((derived-mode-p 'mu4e-view-mode) (mu4e-message-field-at-point :path)) + (t buffer-file-name)) + )) + +(global-set-key (kbd "C-M-/") 'copy-buffer-file-name) + #+end_src *** C-S-/