summaryrefslogtreecommitdiff
path: root/.config/emacs/init.el
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@gmail.com>2025-06-14 18:17:04 +0200
committerKévin Le Gouguec <kevin.legouguec@gmail.com>2025-06-14 18:17:04 +0200
commit80e2ebc852d16fb863224cbd68508ceb73b0bce3 (patch)
treed4c51dc0dce30d52c93b7119ed9934caf4735256 /.config/emacs/init.el
parentaa5980aec403dc1bc7bbc22458c9282f04457fa1 (diff)
downloaddotfiles-80e2ebc852d16fb863224cbd68508ceb73b0bce3.tar.xz
Add command to send character to clipboard
Useful to re-purpose an Emacs session as a severely oversized Unicode character picking widget. Bind to uppercase 'C' rather than 'c' since $DAYJOB config uses the latter for 'c'ite (kill a region with added '> ' markers).
Diffstat (limited to '.config/emacs/init.el')
-rw-r--r--.config/emacs/init.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/.config/emacs/init.el b/.config/emacs/init.el
index 7ce7b11..3fe49c6 100644
--- a/.config/emacs/init.el
+++ b/.config/emacs/init.el
@@ -200,6 +200,10 @@ Raise a user error if the command fails. Heed `my/run-strip-newline'."
See `my/run' for details, e.g. status handling and output massaging."
(my/kill (apply 'my/run program args)))
+(defun my/kill-char (c)
+ (interactive (list (read-char-by-name "Codepoint? " t)))
+ (my/kill (string c)))
+
(defun my/kill-date (date format)
(interactive
(if current-prefix-arg
@@ -306,7 +310,8 @@ list and require no escaping."
(my/define-prefix-command my/kill-map
"Keymap for adding things to the kill ring."
- '(("d" my/kill-date)
+ '(("C" my/kill-char)
+ ("d" my/kill-date)
("f" my/kill-filename)
("|" my/kill-pipe-region)
("!" my/kill-shell)))