🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #1091

Search registers and alternatives

#1091
From: Stavros Macrakis
Date: Fri, 21 Oct 1988 13:51
31 lines
1295 bytes
Gnu Emacs 18.50 (usg-unix-v)

In regex searches, in the presence of alternation (\|), marked
substrings (\n) have funny behavior.

Try the following:

(defun regtest ()
  (insert "this is a foo")
  (goto-char (point-min))
  (re-search-forward "\\(bar\\)\\|foo")
  (setq standard-output (current-buffer))
  (prin1 (match-data)))

(regtest)

Sometimes you get something like:

(#<marker at 308 in bf> #<marker at 311 in bf> #<marker at 308 in bf>
#<marker at 581 in bf>)
	; I think 581 = point-max + 1	

And sometimes:

(#<marker at 268 in bf> #<marker at 271 in bf> #<marker at 268 in bf>
#<marker at 1 in bf>))

That is, the end of the unmatched substring seems to be either point-min or
point-max + 1.  Why is it non-nil at all?  I would have expected:

(#<marker at 268 in bf> #<marker at 271 in bf> nil nil)
Technical Details
Message-ID: <8810211351.AA08532@emeraude.dedlpr.bull.fr>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!uunet!tut.cis.ohio-state.edu!UUNET.UU.NET!mcvax!emeraude.dedlpr.bull.fr!macrakis

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!uunet!tut.cis.ohio-state.edu!UUNET.UU.NET!mcvax!emeraude.dedlpr.bull.fr!macrakis
From: mcvax!emeraude.dedlpr.bull.fr!macrakis@UUNET.UU.NET (Stavros Macrakis)
Newsgroups: gnu.emacs.bug
Subject: Search registers and alternatives
Message-ID: <8810211351.AA08532@emeraude.dedlpr.bull.fr>
Date: 21 Oct 88 13:51:01 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 31