Subject: Re: bug#14207: 24.2; insert-file-contents clobbers match data

From: Eli Zaretskii <[email-masked]>
Date: Mon, 15 Apr 2013 08:16:35 +0300

> From: Aidan Gauland <[email-masked]>
> 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.