From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#24166: With --eval, errors in string-match-p do not produce backtraces (but errors in string-match do?!) Date: Sat, 06 Aug 2016 08:25:17 -0400 Message-ID: <87inve6q4y.fsf@users.sourceforge.net> References: <25c2c856-ff1f-6e73-037a-65abae882673@live.com> <87lh0a7idu.fsf@users.sourceforge.net> <8337mil5pn.fsf@gnu.org> <83r3a2jie9.fsf@gnu.org> <83popmjga1.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1470486394 19065 195.159.176.226 (6 Aug 2016 12:26:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 6 Aug 2016 12:26:34 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux) Cc: 24166@debbugs.gnu.org, clement.pitclaudel@live.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Aug 06 14:26:25 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bW0gD-0002Ve-My for geb-bug-gnu-emacs@m.gmane.org; Sat, 06 Aug 2016 14:26:17 +0200 Original-Received: from localhost ([::1]:49258 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bW0gA-00019n-By for geb-bug-gnu-emacs@m.gmane.org; Sat, 06 Aug 2016 08:26:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bW0g3-00019W-QP for bug-gnu-emacs@gnu.org; Sat, 06 Aug 2016 08:26:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bW0fy-0006cc-Mu for bug-gnu-emacs@gnu.org; Sat, 06 Aug 2016 08:26:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59887) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bW0fy-0006cY-Hx for bug-gnu-emacs@gnu.org; Sat, 06 Aug 2016 08:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bW0fy-0005II-BN for bug-gnu-emacs@gnu.org; Sat, 06 Aug 2016 08:26:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Aug 2016 12:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24166 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24166-submit@debbugs.gnu.org id=B24166.147048631820293 (code B ref 24166); Sat, 06 Aug 2016 12:26:02 +0000 Original-Received: (at 24166) by debbugs.gnu.org; 6 Aug 2016 12:25:18 +0000 Original-Received: from localhost ([127.0.0.1]:57184 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bW0fG-0005HF-4R for submit@debbugs.gnu.org; Sat, 06 Aug 2016 08:25:18 -0400 Original-Received: from mail-io0-f179.google.com ([209.85.223.179]:35994) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bW0fE-0005H2-1m for 24166@debbugs.gnu.org; Sat, 06 Aug 2016 08:25:17 -0400 Original-Received: by mail-io0-f179.google.com with SMTP id b62so321941831iod.3 for <24166@debbugs.gnu.org>; Sat, 06 Aug 2016 05:25:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=zGzfTd//gZr3a7N302LilQIziTiAVOeI6w5vEEDW8+o=; b=qgFb5lwTngFoshjcDK89eYFyJo9AmGnga1q64Z7iy+McakdV69T59qnAKZ4qHc7EyZ sYWtvgWZdDcBe7TgkJSJ2dyp2T+vjlgmEpxPccsmgpjUvVADOIJW3c8gBBRi8glNqem8 q4Gs6e9CQfQIo74ZeqwJDNWMUyFzKxoYBFkGeU/cGvvqqFOTRxcMQhGYMFtBVL9k8zyT wAUwA1VKAHYvglLXmKuWtd98TFBHXQtXniUkeXZSnaqUvk0Crfz6ESwpWqSlNe4A9RCH r1C9Y+UUyJQOqMx3uaCRX1+ZEq2wrCEhGrOpytwJekz27Hf/OVoKn3C9W2YGlCAnv30G MGsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=zGzfTd//gZr3a7N302LilQIziTiAVOeI6w5vEEDW8+o=; b=McA76CX9lmcrEclTz6KO6XIyboQ80mScXWJFI2WbibbDAjVn32lohXbdMdi3uvMbPW o53/jLCkUT4zPlJwr9XnMP7yqy1rulsJaK8YbrsMvELRESLVMwUpsdT63IUo9TNWcp+Z eDnmydg9LMln/QHf6nxiYxpekWBe1ykJqvte7VVoV7jsw6k26EmBNTNiA9oNHdjeYvNu qkIeMR1Om8ZKWi3HGBL4vlT68m5lFlBUpL6r/1LuoBrVvCuVtfhw/1SU6rBP4JpLhnRi Tk8LD6k7tqxXab0Y0bpcs4J8ZIRrJbv6ZPxTU4v5HhLDGxJRbFEGYRsI/cUDAuEIv8s3 PMbQ== X-Gm-Message-State: AEkoouv04ITc2LuOdF1i+9S+1TMbOB/lUCEP0Kp657QbH/mKcUxdfFSUMA07jErCq/6ryA== X-Received: by 10.107.12.85 with SMTP id w82mr95393703ioi.182.1470486310437; Sat, 06 Aug 2016 05:25:10 -0700 (PDT) Original-Received: from zony (206-188-64-44.cpe.distributel.net. [206.188.64.44]) by smtp.googlemail.com with ESMTPSA id i79sm10084629iod.34.2016.08.06.05.25.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 06 Aug 2016 05:25:09 -0700 (PDT) In-Reply-To: <83popmjga1.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 06 Aug 2016 14:19:50 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:121892 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> Not related to this issue as such, but if we want to bind >> inhibit-changing-match-data for all debuggers, why not the others too? > > Which ones specifically did you have in mind? We need to consider > each one carefully, in order to determine whether every debugger needs > that, or just debug.el. Well I thought all of the ones in the let-binding except enable-recursive-minibuffers (which has a comment about a specific debug.el command) and window-configuration (which is just a local lexical variable), as they don't look debug.el specific. But I don't really have the patience for careful consideration of each variable just to solve some hypothetical problems, so let's leave it for another time. Here's the new patch. Is it correct to put the DEFSYM next to the DEFVAR_LISP? I saw a few places where they were separated, but that seems odd since it's then documented twice, and I thought maybe it's just because they happened to be added at different times by people who didn't notice the existing definition. --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=v2-0001-Fix-debugging-of-string-match-p-errors.patch Content-Description: patch v2 >From 9249fece6255615b63cd6848250003051f21cd1c Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Fri, 5 Aug 2016 22:11:00 -0400 Subject: [PATCH v2] 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). --- src/eval.c | 4 ++++ src/search.c | 1 + 2 files changed, 5 insertions(+) diff --git a/src/eval.c b/src/eval.c index 33b82f7..bf5bed7 100644 --- a/src/eval.c +++ b/src/eval.c @@ -300,6 +300,10 @@ call_debugger (Lisp_Object arg) specbind (Qinhibit_redisplay, Qnil); specbind (Qinhibit_debugger, Qt); + /* If we are debugging an error 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 5dc4d35..9b8fc58 100644 --- a/src/search.c +++ b/src/search.c @@ -3390,6 +3390,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 -- 2.8.0 --=-=-=--