this post was submitted on 26 Oct 2023
1 points (100.0% liked)

Emacs

342 readers
1 users here now

A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!

Get Emacs

Rules

  1. Posts should be emacs related
  2. Be kind please
  3. Yes, we already know: Google results for "emacs" and "vi" link to each other. We good.

Emacs Resources

Emacs Tutorials

Useful Emacs configuration files and distributions

Quick pain-saver tip

founded 2 years ago
MODERATORS
 

I know I can use M-x browse-url-of-buffer to create a temp file and render it on my default browser. But how could I render it with eww?

I tried the function suggested here, but I get the error message that says:

eww-display-html: Buffer nil doesn’t exist

The use case is the following:

  1. Export org as HTML (to a temp buffer);
  2. Render the HTML to a browser, my default browser or eww.

Any suggestions?

top 4 comments
sorted by: hot top controversial new old
[–] [email protected] 1 points 2 years ago (1 children)

I've always used (shr-render-buffer (current-buffer)). I don't know the differences from eww-display-html, but one is that it pops up a buffer named *html* and renders it there.

[–] [email protected] 1 points 2 years ago
[–] [email protected] 1 points 2 years ago (1 children)

Try this:

(eww-display-html 'utf-8 (buffer-name) nil (point-min) (current-buffer))

https://asciinema.org/a/bg4bmSYDhVwvZdLcwb9zmofOI

[–] [email protected] 1 points 2 years ago