From xemacs-m  Thu Jan 30 22:12:44 1997
Received: from altair.xemacs.org (steve@xemacs.miranova.com [206.190.83.19])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id WAA01079
	for <xemacs-beta@xemacs.org>; Thu, 30 Jan 1997 22:12:43 -0600 (CST)
Received: (from steve@localhost)
	by altair.xemacs.org (8.8.5/8.8.5) id UAA03753;
	Thu, 30 Jan 1997 20:24:05 -0800
To: xemacs-beta@xemacs.org
Subject: Re: parse-partial-sexp is broken
References: <199701301939.OAA13426@anthem.CNRI.Reston.Va.US>
X-Url: http://www.miranova.com/%7Esteve/
Mail-Copies-To: never
X-Face: #!T9!#9s-3o8)*uHlX{Ug[xW7E7Wr!*L46-OxqMu\xz23v|R9q}lH?cRS{rCNe^'[`^sr5"
 f8*@r4ipO6Jl!:Ccq<xoV[Qz2u8<8-+Vwf2gzJ44lf_/y9OaQ`@#Q65{U4/TC)i2`~/M&QI$X>p:9I
 OSS'2{-)-4wBnVeg0S\O4Al@)uC[pD|+
X-Attribution: sb
From: Steven L Baur <steve@miranova.com>
In-Reply-To: "Barry A. Warsaw"'s message of Thu, 30 Jan 1997 14:39:02 -0500
Mime-Version: 1.0 (generated by tm-edit 7.101)
Content-Type: text/plain; charset=US-ASCII
Date: 30 Jan 1997 20:24:03 -0800
Message-ID: <m2enf2tqu4.fsf@altair.xemacs.org>
Lines: 42
X-Mailer: Gnus v5.4.8/XEmacs 20.0

Barry A Warsaw writes:

> I just discovered that parse-partial-sexp is broken in XEmacs 19.15b90
> (and presumably every XEmacs previous).  I think FSF's Emacs used to
> be broken as well, but 19.34 seems to be fixed.

> Run the following defun.  This will return nil in XEmacs but t in
> Emacs.  I believe Emacs is doing The Right Thing.  The problem seems
> to be that the paren depth isn't being initialized from the state
> argument.

This patch partially synchs scan_sexps_forward with Emacs 19.34.

Index: syntax.c
===================================================================
RCS file: /usr/local/xemacs/xemacs-20.0/src/syntax.c,v
retrieving revision 1.2
diff -u -r1.2 syntax.c
--- syntax.c	1997/01/03 03:10:53	1.2
+++ syntax.c	1997/01/31 04:14:18
@@ -1369,7 +1369,7 @@
 	    error ("Nesting too deep for parser");
 	  curlevel->prev = -1;
 	  curlevel->last = -1;
-	  if (!--targetdepth) goto done;
+	  if (targetdepth == depth) goto done;
 	  break;
 
 	case Sclose:
@@ -1379,7 +1379,7 @@
 	  if (curlevel != levelstart)
 	    curlevel--;
 	  curlevel->prev = curlevel->last;
-	  if (!++targetdepth) goto done;
+	  if (targetdepth == depth) goto done;
 	  break;
 
 	case Sstring:

-- 
steve@miranova.com baur
Unsolicited commercial e-mail will be billed at $250/message.

