GNU bug report logs - #23949
25.0.95; Regression in handling error caused by (string-match-p "." nil)

Previous Next

Package: emacs;

Reported by: Kaushal Modi <kaushal.modi <at> gmail.com>

Date: Mon, 11 Jul 2016 20:13:02 UTC

Severity: normal

Tags: fixed

Merged with 16294, 24166

Found in versions 25.0.95, 24.3.50

Fixed in version 26.1

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


Message #65 received at 23949 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> suse.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 23949 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 kaushal.modi <at> gmail.com
Subject: Re: bug#23949: 25.0.95;
 Regression in handling error caused by (string-match-p "." nil)
Date: Wed, 13 Jul 2016 17:03:22 +0200
Eli Zaretskii <eliz <at> gnu.org> 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 <at> suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."




This bug report was last modified 8 years and 167 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.