Add a hook to be run after eww has rendered a page

* net/eww.el (eww-after-render-hook): New variable.
(eww-render): Use it.
parent f7a192cb
2014-11-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
* eww.texi (Variable Index): Mention `eww-after-render-hook'.
2014-11-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
* eww.texi (Basics): Document `eww-readable'.
......
......@@ -235,6 +235,11 @@ developers started contributing to it as well.
@node Variable Index
@unnumbered Variable Index
@vindex eww-after-render-hook
After eww has rendered the data in the buffer,
@code{eww-after-render-hook} is called. It can be used to alter the
contents, for instance.
@printindex vr
@node Lisp Function Index
......
......@@ -156,6 +156,9 @@ the like off the page.
*** You can now use several eww buffers in parallel by renaming eww
buffers you want to keep separate.
*** `eww-after-render-hook' is now called after eww has rendered
the data in the buffer.
** Message mode
*** text/html messages that contain inline image parts will be
......
2014-11-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
* net/eww.el (eww-after-render-hook): New variable.
(eww-render): Use it.
* net/shr.el (shr-descend): Don't descend further than
`max-specpdl-size' allows (bug#16587).
(shr-depth): New variable.
......
......@@ -73,6 +73,12 @@
:type '(choice (const :tag "Never" nil)
regexp))
(defcustom eww-after-render-hook nil
"A hook called after eww has finished rendering the buffer."
:version "25.1"
:group 'eww
:type 'hook)
(defcustom eww-form-checkbox-selected-symbol "[X]"
"Symbol used to represent a selected checkbox.
See also `eww-form-checkbox-symbol'."
......@@ -227,7 +233,8 @@ word(s) will be searched for via `eww-search-prefix'."
(eww-display-raw buffer)
(eww-update-header-line-format)))
(plist-put eww-data :title url)
(setq eww-history-position 0))
(setq eww-history-position 0)
(run-hooks 'eww-after-render-hook))
(kill-buffer data-buffer))))
(defun eww-parse-headers ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment