all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: lennart.borgman.073@student.lu.se, emacs-devel@gnu.org
Subject: Re: convert-standard-filename on w32 does not preserve match-data?
Date: Mon, 25 Dec 2006 18:19:57 -0500	[thread overview]
Message-ID: <jwv8xgv1se6.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <E1GxSJs-0006Kc-8Z@fencepost.gnu.org> (Richard Stallman's message of "Thu\, 21 Dec 2006 13\:07\:04 -0500")

>     No, I think instead that code that calls convert-standard-filename
>     shouldn't expect it to preserve the match-data.

> It seems cleaner to me for a general subroutine, that does a job not
> specifically related to searching or matching, to preserve the match
> data, rather than making all its callers take care.

Until now the way things have worked apparently is:

  any function that is not a "simple builtin" does not need to save the
  match data.

Now what is a "simple builtin" is not clearly specified anywhere, but
I wouldn't expect convert-standard-filename to be one.

The main reason for limiting the number of functions that preserve the match
data is that, on the one hand save-match-data is a relatively costly
operation, and on the other, 99% of the uses of the match-data is
immediately after a regex-match, with very few operations in-between (if
any), so it's much more efficient performancewise and programmerwise to
place the save-match-data at the few places where the use of the match data
does not come immediately after the regexp-match, than to place around each
and every function that's not obviously related to searching or matching
(i.e. a majority of the functions).


        Stefan

  parent reply	other threads:[~2006-12-25 23:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-20 22:17 convert-standard-filename on w32 does not preserve match-data? Lennart Borgman
2006-12-20 23:06 ` Stefan Monnier
2006-12-20 23:13   ` Lennart Borgman
2006-12-21 18:07   ` Richard Stallman
2006-12-22 23:33     ` Eli Zaretskii
2006-12-24  1:35       ` Richard Stallman
2006-12-25 23:19     ` Stefan Monnier [this message]
2006-12-26 17:22       ` Richard Stallman
2006-12-27 14:55         ` Stefan Monnier
2006-12-27 15:02           ` Lennart Borgman (gmail)
2006-12-27 16:08             ` Stefan Monnier
2006-12-27 17:46               ` Lennart Borgman (gmail)
2006-12-29 21:02                 ` Stefan Monnier
2006-12-29 21:54                   ` Lennart Borgman (gmail)
2006-12-28 17:19             ` Richard Stallman

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

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

  git send-email \
    --in-reply-to=jwv8xgv1se6.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=lennart.borgman.073@student.lu.se \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.