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

Emacs (even on the TTY), can do a decent job of rendering markup using it's built in EWW browser. Works pretty well, at least for most of the content I'm looking for.

Using it with Notmuch or mu4e is not the easiest thing to do, but it works pretty solidly.



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)))


I genuinely wish I liked using emacs.




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

Search: