From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.bugs Subject: bug#23949: 25.0.95; Regression in handling error caused by (string-match-p "." nil) Date: Wed, 13 Jul 2016 17:03:22 +0200 Message-ID: References: <83lh17ati6.fsf@gnu.org> <83h9bvarb6.fsf@gnu.org> <83mvllaa4u.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1468422267 16677 80.91.229.3 (13 Jul 2016 15:04:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Jul 2016 15:04:27 +0000 (UTC) Cc: 23949@debbugs.gnu.org, Stefan Monnier , kaushal.modi@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 13 17:04:16 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bNLhv-0000Dh-3H for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Jul 2016 17:04:15 +0200 Original-Received: from localhost ([::1]:48272 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNLhu-0005tt-Df for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Jul 2016 11:04:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNLhm-0005ss-6d for bug-gnu-emacs@gnu.org; Wed, 13 Jul 2016 11:04:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNLhi-00032D-R3 for bug-gnu-emacs@gnu.org; Wed, 13 Jul 2016 11:04:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37629) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNLhi-000329-NT for bug-gnu-emacs@gnu.org; Wed, 13 Jul 2016 11:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bNLhi-0003uH-I4 for bug-gnu-emacs@gnu.org; Wed, 13 Jul 2016 11:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andreas Schwab Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 13 Jul 2016 15:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23949 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23949-submit@debbugs.gnu.org id=B23949.146842220814963 (code B ref 23949); Wed, 13 Jul 2016 15:04:02 +0000 Original-Received: (at 23949) by debbugs.gnu.org; 13 Jul 2016 15:03:28 +0000 Original-Received: from localhost ([127.0.0.1]:49963 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bNLhA-0003tG-4n for submit@debbugs.gnu.org; Wed, 13 Jul 2016 11:03:28 -0400 Original-Received: from mx2.suse.de ([195.135.220.15]:49075) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bNLh6-0003t5-7p for 23949@debbugs.gnu.org; Wed, 13 Jul 2016 11:03:26 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Original-Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id CC0A4AAF2; Wed, 13 Jul 2016 15:03:22 +0000 (UTC) X-Yow: Yow! I'm imagining a surfer van filled with soy sauce! In-Reply-To: <83mvllaa4u.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 13 Jul 2016 17:24:49 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) 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:121003 Archived-At: Eli Zaretskii writes: > Does the following variant of string-match-p look right? Its intent > is to limit the effect of inhibit-changing-match-data to the call to > string-match only, leaving the error handling, if any is needed, > outside of that binding. > > (defsubst string-match-p (regexp string &optional start) > "\ > Same as `string-match' except this function does not change the match data." > (condition-case err > (let ((inhibit-changing-match-data t)) > (string-match regexp string start)) > (error (signal (car err) (cdr err))))) This optimizes for the rare case that string-match throws an error. Better would be to bind inhibit-changing-match-data in call_debugger. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."