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

I miss using a TUI for mail but it looks like they haven’t really solved the most important reason I don’t, which is rendering HTML emails.


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.


Rendering HTML emails is fine, IMO, unless you want images. (I use mutt with w3m auto-view.) What’s more difficult is authoring/replying to HTML emails.


Try set send_multipart_alternative_filter=markdown2html.py [0] in your muttrc

[0] https://gitlab.com/muttmua/mutt/-/blob/master/contrib/markdo...


You can configure aerc to pass the email contents through an intermediate program depending on the MIME type. I believe it renders HTML through w3m by default or something like that. Of course it isn't full rendering with CSS and whatnot, but it is pretty good for most mails.


Yeah, I get that, but it's still not a great experience, and inconsistent. It would be cool to see something that uses iTerm's support for inline images: https://iterm2.com/documentation-images.html

Not sure how practical that actually would be, but I can dream.


You can make this work! Sixels work with w3m (which you can either reconfigure or replace)


w3m supports inline images; I don't know if they work in aerc, though.


I use lynx to render html email. Other people use w3m. It's your choice and it's a solved problem.




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

Search: