summaryrefslogtreecommitdiffhomepage
path: root/notmuch.org
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-01-12 18:29:08 +0000
committerjao <jao@gnu.org>2022-01-12 18:29:08 +0000
commit4165aa6e0859af2bbee3c02e1aaf5a664f411b32 (patch)
treee10329dbde16502936e9b75b7802f0448f46f267 /notmuch.org
parent29cc19fc5eec7f9ddc7d56c475112e2ff7acb6a4 (diff)
downloadelibs-4165aa6e0859af2bbee3c02e1aaf5a664f411b32.tar.gz
elibs-4165aa6e0859af2bbee3c02e1aaf5a664f411b32.tar.bz2
whitespace
Diffstat (limited to 'notmuch.org')
-rw-r--r--notmuch.org49
1 files changed, 24 insertions, 25 deletions
diff --git a/notmuch.org b/notmuch.org
index dd8d0d9..c12019a 100644
--- a/notmuch.org
+++ b/notmuch.org
@@ -398,9 +398,32 @@
#+end_src
* tree
#+begin_src emacs-lisp
+ (defun jao-notmuch-tree--forward (&optional prev)
+ (interactive)
+ (forward-line (if prev -1 1))
+ (when prev (forward-char 2))
+ (jao-notmuch-tree-scroll-or-next))
+
+ (defun jao-notmuch-tree--backward ()
+ (interactive)
+ (jao-notmuch-tree--forward t))
+
+ (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)))))
+
+ (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)))
+
(use-package notmuch-tree
:init
-
(setq notmuch-tree-result-format
`(("date" . "%12s ")
("authors" . "%-35s")
@@ -428,30 +451,6 @@
(jao-notmuch-tree-setup "T")
- (defun jao-notmuch-tree--forward (&optional prev)
- (interactive)
- (forward-line (if prev -1 1))
- (when prev (forward-char 2))
- (jao-notmuch-tree-scroll-or-next))
-
- (defun jao-notmuch-tree--backward ()
- (interactive)
- (jao-notmuch-tree--forward t))
-
- (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)))))
-
- (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)))
-
:bind (:map notmuch-tree-mode-map
(("b" . jao-notmuch-browse-urls)
("d" . jao-notmuch-tree-toggle-delete)