dotfiles

🎜 Clone'em, tweak'em, stick'em in your $HOME 🎝
git clone https://git.kevinlegouguec.net/dotfiles
Log | Files | Refs | README

commit b3addc78248d0863477daed28672441880e2333d
parent b5a9016d7f8fab817f83dec943c16a07d759ceac
Author: Kévin Le Gouguec <kevin.legouguec@gmail.com>
Date:   Sat,  4 Oct 2025 10:51:48 +0200

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…)

Diffstat:
M.config/emacs/init.el | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git 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