diff options
author | Richard M Stallman <rms@gnu.org> | 2020-10-15 22:32:41 -0400 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 2020-10-15 22:32:41 -0400 |
commit | 7e3a95d8fd0ced4a75edea7b14b3038b1997d516 (patch) | |
tree | 357a16ed28bb8db467d92f3ca07a4565c02e2887 /lisp/net/shr.el | |
parent | f5c9d3f54ec85a83bfe33d0171df2546e750ec0c (diff) | |
download | emacs-7e3a95d8fd0ced4a75edea7b14b3038b1997d516.tar.gz emacs-7e3a95d8fd0ced4a75edea7b14b3038b1997d516.tar.bz2 emacs-7e3a95d8fd0ced4a75edea7b14b3038b1997d516.zip |
Add way to prevent asking "increase specpdl size?"
* net/shr.el (shr-offer-extend-specpdl): New option, default t.
(shr-descend): If shr-offer-extend-specpdl is nil, don't even ask
whether to extend the specpdl, just signal error.
Diffstat (limited to 'lisp/net/shr.el')
-rw-r--r-- | lisp/net/shr.el | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 88e691752ab..2e5dd5ffa50 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -146,6 +146,14 @@ same domain as the main data." :version "24.4" :type 'boolean) +(defcustom shr-offer-extend-specpdl t + "Non-nil means offer to extend the specpdl if the HTML nests deeply. +Complicated HTML can require more nesting than the current specpdl +size permits. If this variable is t, ask the user whether to increase +the specpdl size. If nil, just give up." + :version "28.1" + :type 'boolean) + (defvar shr-content-function nil "If bound, this should be a function that will return the content. This is used for cid: URLs, and the function is called with the @@ -527,7 +535,8 @@ size, and full-buffer size." (start (point))) ;; shr uses many frames per nested node. (if (and (> shr-depth (/ max-specpdl-size 15)) - (not (and (y-or-n-p "Too deeply nested to render properly; increase `max-specpdl-size'?") + (not (and shr-offer-extend-specpdl + (y-or-n-p "Too deeply nested to render properly; increase `max-specpdl-size'?") (setq max-specpdl-size (* max-specpdl-size 2))))) (setq shr-warning "Not rendering the complete page because of too-deep nesting") |