unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Davis Herring" <herring@lanl.gov>
To: "Glenn Morris" <rgm@gnu.org>
Cc: Geoff Gole <geoffgole@gmail.com>, emacs-devel@gnu.org
Subject: Re: (require 'cus-load) clobbers match-data
Date: Tue, 16 Feb 2010 12:25:36 -0800 (PST)	[thread overview]
Message-ID: <37521.130.55.118.19.1266351936.squirrel@webmail.lanl.gov> (raw)
In-Reply-To: <swy6itndl7.fsf@fencepost.gnu.org>

> 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'.

Davis

-- 
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
shipping.




  reply	other threads:[~2010-02-16 20:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-14  5:13 (require 'cus-load) clobbers match-data Geoff Gole
2010-02-14  7:01 ` David Kastrup
2010-02-14  7:49   ` Geoff Gole
2010-02-14  8:00     ` David Kastrup
2010-02-14  8:33       ` Geoff Gole
2010-02-16 20:13 ` Glenn Morris
2010-02-16 20:25   ` Davis Herring [this message]
2010-02-16 21:11     ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=37521.130.55.118.19.1266351936.squirrel@webmail.lanl.gov \
    --to=herring@lanl.gov \
    --cc=emacs-devel@gnu.org \
    --cc=geoffgole@gmail.com \
    --cc=rgm@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).