emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 78f841d: Change edebug-max-depth from defconst to d


From: Eli Zaretskii
Subject: [Emacs-diffs] master 78f841d: Change edebug-max-depth from defconst to defcustom
Date: Sat, 4 Feb 2017 10:58:13 +0000 (UTC)

branch: master
commit 78f841d6db77f8b72d6d7d221af26efb956ab6cb
Author: Gemini Lasswell <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Change edebug-max-depth from defconst to defcustom
    
    * lisp/emacs-lisp/edebug.el (edebug-max-depth): Add defcustom.
    (Bug#24713)
    
    * etc/NEWS: Mention edebug-max-depth.
    
    * doc/lispref/edebug.texi (Checking Whether to Stop): Mention
    edebug-max-depth and index it.  Add cross-references for
    max-lisp-eval-depth and max-specpdl-size.
    
    Co-authored-by: Eli Zaretskii <address@hidden>
---
 doc/lispref/edebug.texi   |   10 +++++++---
 etc/NEWS                  |    5 +++++
 lisp/emacs-lisp/edebug.el |   13 ++++++++++++-
 3 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/doc/lispref/edebug.texi b/doc/lispref/edebug.texi
index f6f73ea..da72c9b 100644
--- a/doc/lispref/edebug.texi
+++ b/doc/lispref/edebug.texi
@@ -979,9 +979,13 @@ program.
 
 @itemize @bullet
 @item
address@hidden and @code{max-specpdl-size} are both
-increased to reduce Edebug's impact on the stack.  You could, however,
-still run out of stack space when using Edebug.
address@hidden edebug-max-depth
address@hidden (@pxref{Eval}) and @code{max-specpdl-size}
+(@pxref{Local Variables}) are both increased to reduce Edebug's impact
+on the stack.  You could, however, still run out of stack space when
+using Edebug.  You can also enlarge the value of
address@hidden if Edebug reaches the limit of recursion depth
+instrumenting code that contains very large quoted lists.
 
 @item
 The state of keyboard macro execution is saved and restored.  While
diff --git a/etc/NEWS b/etc/NEWS
index 270f880..cbf2b70 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -464,6 +464,11 @@ viewing HTML files and the like.
 breakpoint (e.g. with "f" and "o") by customizing the new option
 'edebug-sit-on-break'.
 
++++
+*** New customizable option 'edebug-max-depth'
+This allows to enlarge the maximum recursion depth when instrumenting
+code.
+
 ** Eshell
 
 *** 'eshell-input-filter's value is now a named function
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index db54d1e..ec0f08d 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -112,6 +112,18 @@ and some not, use `def-edebug-spec' to specify an 
`edebug-form-spec'."
   :type 'boolean
   :group 'edebug)
 
+(defcustom edebug-max-depth 150
+  "Maximum recursion depth when instrumenting code.
+This limit is intended to stop recursion if an Edebug specification
+contains an infinite loop.  When Edebug is instrumenting code
+containing very large quoted lists, it may reach this limit and give
+the error message \"Too deep - perhaps infinite loop in spec?\".
+Make this limit larger to countermand that, but you may also need to
+increase `max-lisp-eval-depth' and `max-specpdl-size'."
+  :type 'integer
+  :group 'edebug
+  :version "26.1")
+
 (defcustom edebug-save-windows t
   "If non-nil, Edebug saves and restores the window configuration.
 That takes some time, so if your program does not care what happens to
@@ -1452,7 +1464,6 @@ expressions; a `progn' form will be returned enclosing 
these forms."
 (defvar edebug-after-dotted-spec nil)
 
 (defvar edebug-matching-depth 0)  ;; initial value
-(defconst edebug-max-depth 150)  ;; maximum number of matching recursions.
 
 
 ;;; Failure to match



reply via email to

[Prev in Thread] Current Thread [Next in Thread]