[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (require 'cus-load) clobbers match-data

From: Davis Herring
Subject: Re: (require 'cus-load) clobbers match-data
Date: Tue, 16 Feb 2010 12:25:36 -0800 (PST)
User-agent: SquirrelMail/1.4.8-5.7.lanl7

> In general, there should be no expectation that any operation in Emacs
> will preserve the match-data (unless it explicitly says so).
>> Maybe require should save and restore the match data itself?
> This would be completely unnecessary in the vast majority of cases.
> Since a require can run arbitrary code, there should be no expectation
> that it preserves match-data.

This may not have been the original point, but loading a library can be
the result of calling an autoloaded function, even one that advertises
that it preserves the match data.  In that case it makes sense for `load'
(or something else in that sequence) to save it; loading a file is
(typically) already expensive compared to `save-match-data'.


This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during

reply via email to

[Prev in Thread] Current Thread [Next in Thread]