diff options
| author | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2025-10-04 10:51:48 +0200 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2025-10-04 10:51:48 +0200 |
| commit | b3addc78248d0863477daed28672441880e2333d (patch) | |
| tree | c2837603ac815c7e8b440457968685bf36d0f71a | |
| parent | b5a9016d7f8fab817f83dec943c16a07d759ceac (diff) | |
| download | dotfiles-b3addc78248d0863477daed28672441880e2333d.tar.xz | |
Fine-tune my/kill-as-html
* bind to C-c k W
* port to Wayland
(could have branched on XDG_SESSION_TYPE; ain't nobody got time)
* echo for feedback
(wouldn't it be nice to ask HTML mode to fontify the echoed string…)
| -rw-r--r-- | .config/emacs/init.el | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/.config/emacs/init.el b/.config/emacs/init.el index de8a622..895472a 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -325,10 +325,11 @@ list and require no escaping." ("u" ,(my/make-input-toggle my/symbols)))) (my/define-prefix-command my/kill-map - "Keymap for adding things to the kill ring." + "Keymap for adding things to the kill ring (or system clipboard)." '(("C" my/kill-char) ("d" my/kill-date) ("f" my/kill-filename) + ("W" my/kill-as-html) ("|" my/kill-pipe-region) ("!" my/kill-shell))) @@ -682,8 +683,9 @@ UPSTREAMS is a list of fetch URLs." ;; it sound like passing a value with a 'text/html property set to ;; the HTML string should work, but empirically it doesn't. ;; Maybe look into `selection-converter-alist'. - (call-process-region nil nil "xclip" nil nil nil - "-selection" "clipboard" "-target" "text/html"))) + (call-process-region + nil nil "wl-copy" nil 0 nil "--type" "text/html") + (message "Copied:\n\n%s" (buffer-string)))) (defun my/yank-from-html (html markup) (interactive |
