From 919a8e8574a495d0415d6436f77e967cb1a97b90 Mon Sep 17 00:00:00 2001 From: Matthew Date: Sat, 14 Dec 2019 17:50:45 -0500 Subject: [PATCH] eaf-get-path-or-url copy to kill-ring when called interactively only --- eaf.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/eaf.el b/eaf.el index 00bc381..7f33b04 100644 --- a/eaf.el +++ b/eaf.el @@ -499,10 +499,14 @@ buffer." (call-interactively cmd)))) (defun eaf-get-path-or-url () - "Get the current file path or web URL, and copy to ‘kill-ring’." + "Get the current file path or web URL. + +When called interactively, copy to ‘kill-ring’." (interactive) (if (derived-mode-p 'eaf-mode) - (message (kill-new (eaf-call "call_function" eaf--buffer-id "get_url"))) + (if (called-interactively-p 'any) + (message (kill-new (eaf-call "call_function" eaf--buffer-id "get_url"))) + (eaf-call "call_function" eaf--buffer-id "get_url")) (user-error "This command can only be called in an EAF buffer!"))) (defun eaf-proxy-function (fun)