summaryrefslogtreecommitdiffhomepage
path: root/custom
diff options
context:
space:
mode:
Diffstat (limited to 'custom')
-rw-r--r--custom/jao-custom-gnus.el10
-rw-r--r--custom/jao-custom-notmuch.el35
2 files changed, 27 insertions, 18 deletions
diff --git a/custom/jao-custom-gnus.el b/custom/jao-custom-gnus.el
index 409860c..dad3de1 100644
--- a/custom/jao-custom-gnus.el
+++ b/custom/jao-custom-gnus.el
@@ -592,14 +592,10 @@
(when (eq major-mode 'gnus-summary-mode)
(gnus-summary-select-article-buffer))
(save-excursion
- (goto-char (point-min))
- (when (or (search-forward-regexp "^Via: h" nil t)
- (search-forward-regexp "^URL:[\n ]h" nil t)
- (and (search-forward-regexp "^Link$" nil t)
- (not (beginning-of-line))))
+ (when-let* ((url (jao-url-email-url)))
(cond (external (jao-browse-with-external-browser))
- ((featurep 'jao-custom-eww) (eww (jao-url-around-point)))
- (t (browse-url (jao-url-around-point)))))))
+ ((featurep 'jao-custom-eww) (eww url))
+ (t (browse-url url))))))
(defun jao-gnus-from-eww (keep-eww-buffer)
(interactive "P")
diff --git a/custom/jao-custom-notmuch.el b/custom/jao-custom-notmuch.el
index a4f486f..18c62b7 100644
--- a/custom/jao-custom-notmuch.el
+++ b/custom/jao-custom-notmuch.el
@@ -46,7 +46,9 @@
(defun jao-notmuch-notify-and-update ()
(jao-notmuch-notify)
- (with-current-buffer "*notmuch-hello*" (notmuch-refresh-this-buffer)))
+ (with-current-buffer "*notmuch-hello*"
+ (notmuch-hello-update)
+ (jao-notmuch-hello-first)))
(when jao-notmuch-enabled
(jao-minibuffer-add-variable 'jao-notmuch-minibuffer-string -20))
@@ -126,7 +128,7 @@
`(,(jao-notmuch--q "inbox" "i")
,(jao-notmuch--q "write" "w")
,(jao-notmuch--q "drivel" "d")
- ,(jao-notmuch--q "hacking" "h")
+ ,(jao-notmuch--q "trove" "t")
,(jao-notmuch--q "local" "x")))
(jao-notmuch-def-searches news
@@ -146,6 +148,7 @@
("le" "emacs")
("lg" "geiser")
("lh" "haskell")
+ ("ll" "lisp")
("ln" "notmuch")
("lr" "rust")
("ls" "scheme")
@@ -165,7 +168,7 @@
t)
(jao-notmuch-def-searches nil
- `(,(jao-notmuch--q "flagged" "F" nil '("tag:flagged" "tag:jao"))))
+ `(,(jao-notmuch--q "flagged" "F" nil '("tag:flagged"))))
(jao-notmuch-def-searches today
`(,(jao-notmuch--q "new" "N" nil (list jao-notmuch--new "not tag:draft"))
@@ -459,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)))
@@ -529,7 +541,8 @@
(defun jao-notmuch--maybe-notify-and-update (&optional _both)
(when (not (derived-mode-p 'notmuch-hello-mode 'notmuch-tree-mode))
- (jao-notmuch-notify-and-update)))
+ (jao-notmuch-notify-and-update))
+ (jao-notmuch-refresh-hello))
(defun jao-notmuch-tree--sentinel (proc)
(when (eq (process-status proc) 'exit)