diff options
| author | jao <jao@gnu.org> | 2025-11-13 20:09:31 +0000 |
|---|---|---|
| committer | jao <jao@gnu.org> | 2025-11-13 20:09:31 +0000 |
| commit | a479b2dd82cb8985fceffc8a329cc4bb12765679 (patch) | |
| tree | ae69886e04d76e6105c6ff2839d7a54b2ca5fcd8 /custom/jao-custom-notmuch.el | |
| parent | 2f4caff918d9b5e70419d7bc7a4887e09bdfdb8a (diff) | |
| download | elibs-a479b2dd82cb8985fceffc8a329cc4bb12765679.tar.gz elibs-a479b2dd82cb8985fceffc8a329cc4bb12765679.tar.bz2 | |
mail: better open email url in notmuchmain
Diffstat (limited to 'custom/jao-custom-notmuch.el')
| -rw-r--r-- | custom/jao-custom-notmuch.el | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/custom/jao-custom-notmuch.el b/custom/jao-custom-notmuch.el index 4d797c8..18c62b7 100644 --- a/custom/jao-custom-notmuch.el +++ b/custom/jao-custom-notmuch.el @@ -462,16 +462,25 @@ (defun jao-notmuch--via-url () (when (window-live-p notmuch-tree-message-window) (with-selected-window notmuch-tree-message-window - (goto-char (point-min)) - (when (re-search-forward "^Via: http" nil t) - (thing-at-point-url-at-point))))) + (jao-url-email-url)))) (defun jao-notmuch-browse-url (ext) (interactive "P") - (when-let (url (or (jao-notmuch--via-url) - (car (last (jao-notmuch-message-urls))))) - (funcall (if ext browse-url-secondary-browser-function #'browse-url) - url))) + (when-let* ((url (or (jao-notmuch--via-url) + (car (last (jao-notmuch-message-urls)))))) + (if ext + (funcall browse-url-secondary-browser-function url) + (window-configuration-to-register ?G) + (select-window notmuch-tree-message-window) + (eww url)))) + +(defun jao-notmuch-from-eww (keep-eww-buffer) + (interactive "P") + (unless keep-eww-buffer (jao-eww-close)) + (jump-to-register ?G)) + +(with-eval-after-load 'eww + (define-key eww-mode-map (kbd "h") #'jao-notmuch-from-eww)) (defun jao-notmuch-adjust-tree-fonts (&optional family) (let ((fg (face-attribute 'jao-themes-dimm :foreground))) |
