From 1d65b5fc7082f7c13f00241033a8f1b38d111caa Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Thu, 13 Apr 2017 02:57:58 -0700 Subject: [PATCH] write function ive wanted for a long time --- my-init.org | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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-/ -- 2.30.2