GNU bug report logs - #14207
24.2; insert-file-contents clobbers match data

Previous Next

Package: emacs;

Reported by: Aidan Gauland <aidalgol <at> no8wireless.co.nz>

Date: Mon, 15 Apr 2013 01:02:01 UTC

Severity: minor

Tags: notabug

Found in version 24.2

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Aidan Gauland <aidalgol <at> no8wireless.co.nz>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 14207 <at> debbugs.gnu.org
Subject: Re: bug#14207: 24.2; insert-file-contents clobbers match data
Date: Tue, 16 Apr 2013 13:22:12 +1200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Aidan Gauland <aidalgol <at> no8wireless.co.nz>
>> Date: Mon, 15 Apr 2013 12:56:26 +1200
>> 
>> If (and only if) the match data is non-nil when `insert-file-contents'
>> is called, it clobbers the match-data.
>
> And why is that a bug?
>
> From the ELisp manual (node "Match Data"):
>
>      Notice that all functions are allowed to overwrite the match data
>   unless they're explicitly documented not to do so.
>
> 'insert-file-contents' is not documented to preserve match data.

Oh, OK.  I thought it was the other way around: functions are supposed
to explicitly be documented as modifying the match data.




This bug report was last modified 12 years and 91 days ago.

Previous Next


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