summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/net/jao-notmuch.el59
1 files changed, 15 insertions, 44 deletions
diff --git a/lib/net/jao-notmuch.el b/lib/net/jao-notmuch.el
index db23bc1..cc8ad64 100644
--- a/lib/net/jao-notmuch.el
+++ b/lib/net/jao-notmuch.el
@@ -259,33 +259,6 @@
(message "No URLs in this message")))
-;;; navigating URLs
-
-(require 'ffap)
-
-(defun jao-notmuch-show-next-button ()
- (interactive)
- (when (get-text-property (point) 'w3m-href-anchor)
- (goto-char (next-single-property-change (point) 'w3m-href-anchor)))
- (if-let* ((pos (next-single-property-change (point) 'w3m-href-anchor)))
- (goto-char pos)
- (or (forward-button 1 nil t t)
- (ffap-next-guess))))
-
-(defun jao-notmuch-show-previous-button ()
- (interactive)
- (if-let* ((pos (previous-single-property-change (point) 'w3m-href-anchor)))
- (goto-char (previous-single-property-change pos 'w3m-href-anchor))
- (or (backward-button 1 nil t t)
- (ffap-next-guess t))))
-
-(defun jao-notmuch-show-ret ()
- (interactive)
- (when-let* ((url (or (get-text-property (point) 'w3m-href-anchor)
- (thing-at-point-url-at-point))))
- (browse-url url)))
-
-
;;; toggling mime parts and images
(defun jao-notmuch--toggle-mime ()
@@ -302,18 +275,21 @@
(jao-notmuch--toggle-mime)
(jao-notmuch-goto-tree-buffer t)))
-(defun jao-notmuch--view-html ()
+(defun jao-notmuch-find-message-part (type)
+ (save-excursion
+ (goto-char (point-min))
+ (text-property-search-forward
+ :notmuch-part
+ type
+ (lambda (value notmuch-part)
+ (equal (plist-get notmuch-part :content-type) value)))))
+
+(defun jao-notmuch-view-html ()
"Open the text/html part of current message using `notmuch-show-view-part'."
(interactive)
- (save-excursion
- (goto-char
- (prop-match-beginning
- (text-property-search-forward
- :notmuch-part
- "text/html"
- (lambda (value notmuch-part)
- (equal (plist-get notmuch-part :content-type)
- value)))))
+ (when-let* (((jao-notmuch-goto-message-buffer nil t))
+ (part (jao-notmuch-find-message-part "text/html")))
+ (goto-char (prop-match-beginning part))
(notmuch-show-view-part)))
(defvar-local jao-notmuch--showing-images nil)
@@ -341,13 +317,8 @@
(jao-notmuch--w3m-toggle-images)))
(window-system (jao-notmuch--shr-toggle-images))
(notmuch-tree-message-buffer
- (if nil ;;(fboundp 'jao-open-in-x-frame)
- (let ((w (get-buffer-window notmuch-tree-message-buffer)))
- (jao-open-in-x-frame (window-width w) (window-height w))
- (jao-notmuch--shr-toggle-images)
- (delete-window))
- (with-current-buffer notmuch-tree-message-buffer
- (jao-notmuch--view-html))))))
+ (with-current-buffer notmuch-tree-message-buffer
+ (jao-notmuch-view-html)))))
;;; header and mode lines with thread message counts