[gnu.emacs.bug] Search registers and alternatives

macrakis@UUNET.UU.NET (Stavros Macrakis) (10/21/88)

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)