Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For when eww doesn't work, this snippet will let you type "c v" in a notmuch mail buffer to render the html content of an email in an external browser:

    (defun btv/notmuch-browse-html ()
      (interactive "")
      (let ((html-part (seq-find
                        (lambda (elt)
                          (pcase-let ((`(,begin ,end ,props) elt))
                            (let* ((part (plist-get props :notmuch-part))
                                   (type
                                    (or (plist-get part :computed-type)
                                        (plist-get part :content-type))))
                              (and (equal type "text/html")
                                   begin))))
                        (object-intervals (current-buffer)))))
        (when html-part
          (save-excursion
            (goto-char (1+ (car html-part)))
            (notmuch-show-view-part)))))
    
    (add-hook 'notmuch-show-mode-hook
              (lambda ()            
                (define-key notmuch-show-stash-map "v" 'btv/notmuch-browse-html)))


Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: