[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 60ec0c7 2/2: Query the user whether to increase sta
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] master 60ec0c7 2/2: Query the user whether to increase stack depth in shr |
Date: |
Sun, 15 Apr 2018 13:02:33 -0400 (EDT) |
branch: master
commit 60ec0c7960985bf6e849e2ea4c3888127f8e9bef
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
Query the user whether to increase stack depth in shr
* lisp/net/shr.el (shr-insert-document): Bind `max-specpdl-size'
here... (bug#30675).
(shr-descend): So that we can increase it temporarily here if the
user wants to.
---
lisp/net/shr.el | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 655f142..275b36f 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -274,6 +274,7 @@ DOM should be a parse tree as generated by
(not (shr--have-one-fringe-p)))
(* (frame-char-width) 2)
0)))))
+ (max-specpdl-size max-specpdl-size)
bidi-display-reordering)
;; If the window was hscrolled for some reason, shr-fill-lines
;; below will misbehave, because it silently assumes that it
@@ -523,8 +524,11 @@ size, and full-buffer size."
(shr-depth (1+ shr-depth))
(start (point)))
;; shr uses many frames per nested node.
- (if (> shr-depth (/ max-specpdl-size 15))
- (setq shr-warning "Too deeply nested to render properly; consider
increasing `max-specpdl-size'")
+ (if (and (> shr-depth (/ max-specpdl-size 15))
+ (not (and (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")
(when style
(if (string-match "color\\|display\\|border-collapse" style)
(setq shr-stylesheet (nconc (shr-parse-style style)