2

I want to make a buffer in a new window (but not pop to it) insert HTML code in it, and render its content with shr-render-*. Yes, an HTML preview window, let me know if you know of a (simple) existing implementation ; I tried various strategies, like temp buffers :

(with-output-to-temp-buffer "foo"
  (print (format "%s" "<h1>plop</h1>"))
  (print standard-output)
  (shr-render-buffer))

But this opens yet another window, and I lose my original window ; Ideally, what I'd like is a help buffer, but I'm guessing they are read-only..?

yPhil
  • 963
  • 5
  • 22

1 Answers1

3

OK, I found out :

(with-output-to-temp-buffer "foo"
  (pop-to-buffer "foo")
  (insert "<h1>plip</h1>")
  (shr-render-region (point-min) (point-max)))
yPhil
  • 963
  • 5
  • 22