all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: no-spam@cua.dk (Kim F. Storm)
Cc: bug-gnu-emacs@gnu.org
Subject: Re: `match-data' set improperly
Date: 13 Feb 2003 13:25:16 +0100	[thread overview]
Message-ID: <5xfzqsl64z.fsf@kfs2.cua.dk> (raw)
In-Reply-To: <001301c2d32b$17f71b40$6200a8c0@swift.xxx>

"Matt Swift" <swift@alum.mit.edu> writes:

> I stand corrected.
> 
> Nevertheless I see a strong case for revising both the documentation and the
> behavior of the function.  

I have fixed the documentation for match-data, so that it explicitly
states that the return value is undefined if the last search failed.

I don't see a strong reason to change the behaviour; it's worked like this
for many years, so people seem to be able to cope with it.  

I think the code is generally easier to understand if there is an
explicit test on the return value of the search command.

On the other hand, I don't object (but I'm not the one to decide!!) to
changing this behaviour in the way you suggest (i.e.  make the various
match-* functions return nil if the last search failed).

Maybe you can write a patch (it can be isolated to search.c I think),
so we can see what's needed?

> The second sentence you quote is almost meaningless.  "did not do
> this" -- did not do WHAT? alter it, or not alter it?  Likewise, one
> cannot tell what might be changed to what in the future.

At least it cleary (:-)) indicates that you should not rely on the
return value, neither now, nor in the future.

-- 
Kim F. Storm  http://www.cua.dk

  reply	other threads:[~2003-02-13 12:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-13  0:54 `match-data' set improperly Luc Teirlinck
2003-02-13  6:42 ` Matt Swift
2003-02-13 12:25   ` Kim F. Storm [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-02-12  3:16 Matthew Swift
2003-02-12 10:53 ` Kim F. Storm
2003-02-12 19:25   ` Matt Swift
     [not found] ` <mailman.1845.1045043916.21513.bug-gnu-emacs@gnu.org>
2003-02-12 16:02   ` Kevin Rodgers
2003-02-13 10:08     ` 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=5xfzqsl64z.fsf@kfs2.cua.dk \
    --to=no-spam@cua.dk \
    --cc=bug-gnu-emacs@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 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.