unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lektu@terra.es>
Cc: emacs-devel@gnu.org
Subject: Re: save-match-data woes
Date: Mon, 25 Feb 2002 09:10:03 +0100	[thread overview]
Message-ID: <20020225090007.B039.LEKTU@terra.es> (raw)
In-Reply-To: <200202221643.g1MGh3a30474@rum.cs.yale.edu>


On Fri, 22 Feb 2002 11:43:03 -0500, "Stefan Monnier" <monnier+gnu/emacs@RUM.cs.yale.edu> wrote:

> I think this is a wrong approach.  The match-data need only be saved
> in a few particular circumstances and I'd rather handle those cases
> in a special way.

Well, I'm not so sure about the "few particular circumstances". I think
is bad for a function to arbitrarily change the match data and not
saving it and not even documenting that it does modify it. That's bound
to cause trouble somewhere far away, where perhaps the trouble won't be
so easily connected with match data. I have no hard data, but my gut
feeling is that you will end saving/restoring match-data in many places
just to protect you against the relatively few functions that do not do
that now. What if one of your elisp modules is safely using a function
in another module and its maintainer just modifies slightly the
implementation, using now pp-to-string where he didn't before? Probably
you weren't saving match data because you didn't see the reason... and I
fail to see *why* you should have any reason now. It is not you who
changed anything.

> For ielm, the problem is that the user might invoke any random command
> between two inputs, so fixing M-p and M-n is not enough.

You're right. In the case of ielm.el, your fix is much better than mine.

(Unrelated:) On the matter of ielm, is there any objection to my patch
of a few days back that makes ielm-prompt customizable and read-only?


                                                           /L/e/k/t/u


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


  parent reply	other threads:[~2002-02-25  8:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-21 11:36 save-match-data woes Juanma Barranquero
2002-02-21 11:54 ` Eli Zaretskii
2002-02-22 16:43 ` Stefan Monnier
2002-02-23  5:26   ` Richard Stallman
2002-02-25  8:10   ` Juanma Barranquero [this message]
2002-02-25  8:21     ` Stefan Monnier
2002-02-25 10:19       ` Juanma Barranquero
2002-02-26 20:15       ` Richard Stallman
2002-02-27 10:00         ` Eli Zaretskii
2002-02-28  4:08           ` Richard Stallman
2002-02-26 20:14     ` 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

  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=20020225090007.B039.LEKTU@terra.es \
    --to=lektu@terra.es \
    --cc=emacs-devel@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).