From 1622ac38772868d101e48107591db8f4700627c4 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Tue, 5 Sep 2023 00:14:03 +1000 Subject: A few changes - add dedicate-windows-by-modes as window-configuration-change-hook, but it did not work well when used on gnus-summary-mode - copying gnus article regions also copies links, which are appended at the end of the copy as footnote - overload org-id-store-link so that capturing today's work could include the item priority - org should open a gnus link in other-window - fixing my-org-clean-up-entry so that it deletes trailing empty lines - added a silly utility function to clean a red energy bill pay link --- emacs/.emacs.d/lisp/my/my-web.el | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'emacs/.emacs.d/lisp/my/my-web.el') diff --git a/emacs/.emacs.d/lisp/my/my-web.el b/emacs/.emacs.d/lisp/my/my-web.el index bd6a55d..311bcf9 100644 --- a/emacs/.emacs.d/lisp/my/my-web.el +++ b/emacs/.emacs.d/lisp/my/my-web.el @@ -126,16 +126,27 @@ (list (let ((com-table)) (dolist (buffer (buffer-list)) - (with-current-buffer buffer - (when (equal major-mode 'eww-mode) - (add-to-list - 'com-table - (concat (plist-get eww-data :title) - (propertize (concat " " (buffer-name)) - 'invisible t)))))) + (with-current-buffer buffer + (when (equal major-mode 'eww-mode) + (add-to-list + 'com-table + (concat (plist-get eww-data :title) + (propertize (concat " " (buffer-name)) + 'invisible t)))))) (completing-read "Eww buffer title: " com-table)))) (string-match "^.* \\(.*\\)$" title-and-buffer) (switch-to-buffer (match-string 1 title-and-buffer))) +(defun my-red-energy-copy-clean-url (beg end) + "Clean up the payment url in a raw red energy bill email." + (interactive "r") + (let ((url (url-unhex-string + (replace-regexp-in-string + "^.*url=" "" (replace-regexp-in-string + "=3D" "=" (replace-regexp-in-string "= +" "" (buffer-substring-no-properties beg end))))))) + (kill-new url) + (message "Copied link: %s" url))) + (provide 'my-web) ;;; my-web.el ends here -- cgit v1.2.3