diff options
author | Philipp Stephani <phst@google.com> | 2020-08-03 21:07:32 +0200 |
---|---|---|
committer | Philipp Stephani <phst@google.com> | 2020-08-03 21:07:32 +0200 |
commit | ca419812d35f252fca2708ffdd132c223d094c0f (patch) | |
tree | acd074b79efd322c408168a7be70df997f5c0ee7 /lisp/emacs-lisp/edebug.el | |
parent | 16b7f413a9ff819c374e07ee927c1fd2b4138109 (diff) | |
download | emacs-ca419812d35f252fca2708ffdd132c223d094c0f.tar.gz emacs-ca419812d35f252fca2708ffdd132c223d094c0f.tar.bz2 emacs-ca419812d35f252fca2708ffdd132c223d094c0f.zip |
Avoid duplicate Edebug symbols when backtracking (Bug#42701)
When Edebug backtracks, it nevertheless generates definitions for the
non-matching branches, see Bug#41988 and Bug#42701. This should be
fixed eventually (probably by deferring the definition until a branch
is known to match), but for now add a band-aid to avoid these
duplicate symbols, at least for anonymous forms.
* lisp/emacs-lisp/edebug.el (edebug-make-enter-wrapper): Regenerate
anonymous names.
* test/lisp/emacs-lisp/edebug-tests.el
(edebug-tests-duplicate-symbol-backtrack): New regression test.
Diffstat (limited to 'lisp/emacs-lisp/edebug.el')
-rw-r--r-- | lisp/emacs-lisp/edebug.el | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index cef97e0fb45..d9bbf6129c6 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -1240,6 +1240,13 @@ purpose by adding an entry to this alist, and setting ;; since it wraps the list of forms with a call to `edebug-enter'. ;; Uses the dynamically bound vars edebug-def-name and edebug-def-args. ;; Do this after parsing since that may find a name. + (when (string-match-p (rx bos "edebug-anon" (+ digit) eos) + (symbol-name edebug-old-def-name)) + ;; FIXME: Due to Bug#42701, we reset an anonymous name so that + ;; backtracking doesn't generate duplicate definitions. It would + ;; be better to not define wrappers in the case of a non-matching + ;; specification branch to begin with. + (setq edebug-old-def-name nil)) (setq edebug-def-name (or edebug-def-name edebug-old-def-name (gensym "edebug-anon"))) `(edebug-enter |