about summary refs log tree commit diff
path: root/configs/shared/.emacs.d/wpc
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-01-17T18·52+0000
committerWilliam Carroll <wpcarro@gmail.com>2020-01-17T18·52+0000
commitcd3b879e7bf8d361465e45cab052543df7f9f004 (patch)
tree7a4dd204363f72bd580b81e5e7d149b624a02ab1 /configs/shared/.emacs.d/wpc
parente197dc5aba1072b1f584453f9042d7c23e825318 (diff)
Support clipboard/contents
This function returns the contents of the clipboard without calling paste.
Diffstat (limited to 'configs/shared/.emacs.d/wpc')
-rw-r--r--configs/shared/.emacs.d/wpc/clipboard.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/configs/shared/.emacs.d/wpc/clipboard.el b/configs/shared/.emacs.d/wpc/clipboard.el
index 603afc90af85..8955261cdc73 100644
--- a/configs/shared/.emacs.d/wpc/clipboard.el
+++ b/configs/shared/.emacs.d/wpc/clipboard.el
@@ -36,6 +36,10 @@
   (yank)
   (message message))
 
+(defun clipboard/contents ()
+  "Return the contents of the clipboard as a string."
+  (substring-no-properties (current-kill 0)))
+
 (exwm-input-set-key
  (kbd "C-M-v") #'ivy-clipmenu/copy)