🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.emacs
Article #9631

match-beginning/match-end behavior

#9631
From: Dale Worley
Date: Tue, 27 Feb 1990 15:23
20 lines
1359 bytes
johnd@Stardent.COM (John R. Dennis @stardent) writes:
> To detect if there was a match for a particular sub-expression the
> elisp code was relying on the fact that (match-beginning n) would return nil
> if there was no match for sub-expression n. We are using GNU emacs version
> 18.50.  If there is no match it generates an error.

Yes, the behavior of match-beginning/match-end has changed in recent
versions.  In the most recent versions of Emacs, they return nil for
subexpressions that don't match.  Since I use Emerge on versions 18.53
and 18.54, I haven't worried about the change.

Presumably the Emacs developers changed the behavior for exactly the
reasons you describe.  I assume upward-compatibility wasn't a problem,
because very little code relies on an operation returning an error in
certain circumstances.

Dale Worley		Compass, Inc.			worley@compass.com
--
Civilization ends at the water's edge.  On the ocean, you enter the food chain,
and not necessarily at the top.
Technical Details
Message-ID: <1518@compass.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!samsung!think!compass!worley

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!samsung!think!compass!worley
From: worley@compass.com (Dale Worley)
Newsgroups: comp.emacs
Subject: match-beginning/match-end behavior
Message-ID: <1518@compass.com>
Date: 27 Feb 90 15:23:30 GMT
Organization: Compass, Inc., Wakefield, MA
Lines: 20
In-reply-to: johnd@Stardent.COM's message of 23 Feb 90 18:46:31 GM