[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-25 3f539c0 2/3: Fix debugging of string-match-p erro
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] emacs-25 3f539c0 2/3: Fix debugging of string-match-p errors |
Date: |
Fri, 23 Sep 2016 14:06:24 +0000 (UTC) |
branch: emacs-25
commit 3f539c0013cf0f64b71e58d288ff1e53211fba2d
Author: Noam Postavsky <address@hidden>
Commit: Eli Zaretskii <address@hidden>
Fix debugging of string-match-p errors
* src/eval.c (call_debugger): Bind inhibit-changing-match-data to nil so
that debugger code that needs to do regexp match won't break
(Bug #23949, Bug #24166, Bug#16294).
This was backported from master
(cherry picked from commit 7fb75680b38fe0805c2ff7e9cca3bec8121ba984)
---
src/eval.c | 5 +++++
src/search.c | 1 +
2 files changed, 6 insertions(+)
diff --git a/src/eval.c b/src/eval.c
index fe6460d..13a41a2 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -299,6 +299,11 @@ call_debugger (Lisp_Object arg)
specbind (Qinhibit_redisplay, Qnil);
specbind (Qinhibit_debugger, Qt);
+ /* If we are debugging an error while `inhibit-changing-match-data'
+ is bound to non-nil (e.g., within a call to `string-match-p'),
+ then make sure debugger code can still use match data. */
+ specbind (Qinhibit_changing_match_data, Qnil);
+
#if 0 /* Binding this prevents execution of Lisp code during
redisplay, which necessarily leads to display problems. */
specbind (Qinhibit_eval_during_redisplay, Qt);
diff --git a/src/search.c b/src/search.c
index b70f020..dc7e2d8 100644
--- a/src/search.c
+++ b/src/search.c
@@ -3396,6 +3396,7 @@ or other such regexp constructs are not replaced with
this.
A value of nil (which is the normal value) means treat spaces literally. */);
Vsearch_spaces_regexp = Qnil;
+ DEFSYM (Qinhibit_changing_match_data, "inhibit-changing-match-data");
DEFVAR_LISP ("inhibit-changing-match-data", Vinhibit_changing_match_data,
doc: /* Internal use only.
If non-nil, the primitive searching and matching functions