diff options
| author | Mattias EngdegÄrd | 2022-09-19 10:55:09 +0200 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2022-09-19 19:30:03 +0200 |
| commit | 60102016e416e5c19fa5945aeb80693dac7ff2e6 (patch) | |
| tree | 69979ff773d7031634e7bc4f4388abc4ae104717 /lisp/calc | |
| parent | a7c65fc6660878e244432a5b25fb3a4ff20e8604 (diff) | |
| download | emacs-60102016e416e5c19fa5945aeb80693dac7ff2e6.tar.gz emacs-60102016e416e5c19fa5945aeb80693dac7ff2e6.zip | |
Abolish max-specpdl-size (bug#57911)
The max-lisp-eval-depth limit is sufficient to prevent unbounded stack
growth including the specbind stack; simplify matters for the user by
not having them to worry about two different limits. This change
turns max-specpdl-size into a harmless variable with no effects,
to keep existing code happy.
* lisp/subr.el (max-specpdl-size):
Define as an ordinary (but obsolete) dynamic variable.
* admin/grammars/Makefile.in:
* doc/lispintro/emacs-lisp-intro.texi (Loops & Recursion):
* doc/lispref/control.texi (Cleanups):
* doc/lispref/edebug.texi (Checking Whether to Stop):
* doc/lispref/eval.texi (Eval):
* doc/lispref/variables.texi (Local Variables):
* doc/misc/calc.texi (Recursion Depth):
Update documentation.
* etc/NEWS: Announce.
* src/eval.c
(FletX): Use safe iteration to guard against circular bindings list.
(syms_of_eval): Remove old max-specpdl-size definition.
(init_eval_once, restore_stack_limits, call_debugger)
(signal_or_quit, grow_specpdl_allocation):
* leim/Makefile.in:
* lisp/Makefile.in:
* lisp/calc/calc-stuff.el (calc-more-recursion-depth)
(calc-less-recursion-depth):
* lisp/calc/calc.el (calc-do):
* lisp/cedet/semantic/ede-grammar.el (ede-proj-makefile-insert-rules):
* lisp/cedet/semantic/grammar.el (semantic-grammar-batch-build-one-package):
* lisp/cus-start.el (standard):
* lisp/emacs-lisp/comp.el (comp--native-compile):
* lisp/emacs-lisp/edebug.el (edebug-max-depth):
(edebug-read-and-maybe-wrap-form, edebug-default-enter):
* lisp/emacs-lisp/regexp-opt.el (regexp-opt):
* lisp/eshell/esh-mode.el (eshell-mode):
* lisp/loadup.el (max-specpdl-size):
* lisp/mh-e/mh-e.el (mh-invisible-headers):
* lisp/net/shr.el (shr-insert-document, shr-descend):
* lisp/play/hanoi.el (hanoi-internal):
* lisp/progmodes/cperl-mode.el:
* src/fileio.c (Fdo_auto_save):
Remove references to and modifications of max-specpdl-size.
Diffstat (limited to 'lisp/calc')
| -rw-r--r-- | lisp/calc/calc-stuff.el | 8 | ||||
| -rw-r--r-- | lisp/calc/calc.el | 3 |
2 files changed, 3 insertions, 8 deletions
diff --git a/lisp/calc/calc-stuff.el b/lisp/calc/calc-stuff.el index 0e8ea42bedc..758b9201843 100644 --- a/lisp/calc/calc-stuff.el +++ b/lisp/calc/calc-stuff.el | |||
| @@ -52,18 +52,14 @@ With a prefix, push that prefix as a number onto the stack." | |||
| 52 | (calc-less-recursion-depth n) | 52 | (calc-less-recursion-depth n) |
| 53 | (let ((n (if n (prefix-numeric-value n) 2))) | 53 | (let ((n (if n (prefix-numeric-value n) 2))) |
| 54 | (if (> n 1) | 54 | (if (> n 1) |
| 55 | (setq max-specpdl-size (* max-specpdl-size n) | 55 | (setq max-lisp-eval-depth (* max-lisp-eval-depth n)))) |
| 56 | max-lisp-eval-depth (* max-lisp-eval-depth n)))) | ||
| 57 | (message "max-lisp-eval-depth is now %d" max-lisp-eval-depth)))) | 56 | (message "max-lisp-eval-depth is now %d" max-lisp-eval-depth)))) |
| 58 | 57 | ||
| 59 | (defun calc-less-recursion-depth (n) | 58 | (defun calc-less-recursion-depth (n) |
| 60 | (interactive "P") | 59 | (interactive "P") |
| 61 | (let ((n (if n (prefix-numeric-value n) 2))) | 60 | (let ((n (if n (prefix-numeric-value n) 2))) |
| 62 | (if (> n 1) | 61 | (if (> n 1) |
| 63 | (setq max-specpdl-size | 62 | (setq max-lisp-eval-depth (max (/ max-lisp-eval-depth n) 200)))) |
| 64 | (max (/ max-specpdl-size n) 600) | ||
| 65 | max-lisp-eval-depth | ||
| 66 | (max (/ max-lisp-eval-depth n) 200)))) | ||
| 67 | (message "max-lisp-eval-depth is now %d" max-lisp-eval-depth)) | 63 | (message "max-lisp-eval-depth is now %d" max-lisp-eval-depth)) |
| 68 | 64 | ||
| 69 | 65 | ||
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 5077c8c8528..c0f87ad3d42 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el | |||
| @@ -1625,8 +1625,7 @@ See calc-keypad for details." | |||
| 1625 | (error | 1625 | (error |
| 1626 | (if (and (eq (car err) 'error) | 1626 | (if (and (eq (car err) 'error) |
| 1627 | (stringp (nth 1 err)) | 1627 | (stringp (nth 1 err)) |
| 1628 | (string-match "max-specpdl-size\\|max-lisp-eval-depth" | 1628 | (string-search "max-lisp-eval-depth" (nth 1 err))) |
| 1629 | (nth 1 err))) | ||
| 1630 | (error (substitute-command-keys | 1629 | (error (substitute-command-keys |
| 1631 | "Computation got stuck or ran too long. Type \\`M' to increase the limit")) | 1630 | "Computation got stuck or ran too long. Type \\`M' to increase the limit")) |
| 1632 | (setq calc-aborted-prefix nil) | 1631 | (setq calc-aborted-prefix nil) |