From xemacs-m  Thu Jan 30 13:37:38 1997
Received: from CNRI.Reston.VA.US (CNRI.Reston.VA.US [132.151.1.1])
          by xemacs.org (8.8.4/8.8.4) with SMTP
	  id NAA16247 for <xemacs-beta@xemacs.org>; Thu, 30 Jan 1997 13:37:33 -0600 (CST)
Received: from newcnri.cnri.reston.va.us by CNRI.Reston.VA.US id aa18767;
          30 Jan 97 14:39 EST
Received: from anthem.CNRI.Reston.Va.US by newcnri.CNRI.Reston.Va.US (SMI-8.6/SMI-SVR4)
	id OAA23189; Thu, 30 Jan 1997 14:39:02 -0500
Received: by anthem.CNRI.Reston.Va.US (SMI-8.6/SMI-SVR4)
	id OAA13426; Thu, 30 Jan 1997 14:39:02 -0500
Date: Thu, 30 Jan 1997 14:39:02 -0500
Message-Id: <199701301939.OAA13426@anthem.CNRI.Reston.Va.US>
From: "Barry A. Warsaw" <bwarsaw@CNRI.Reston.VA.US>
To: xemacs-beta@xemacs.org
Subject: parse-partial-sexp is broken
Reply-To: bwarsaw@python.org
X-Attribution: BAW
X-Oblique-Strategy: Lie
X-WWW-Homepage: http://www.python.org/~bwarsaw


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.

-Barry

-------------------- snip snip --------------------
(defun pps-works-p ()
  "Return whether `parse-partial-sexp' works or not"
  (let ((buf (get-buffer-create " ---*---pps---*---"))
	state status)
    (save-excursion
      (set-buffer buf)
      (erase-buffer)
      (insert "(line1\n line2)\nline3")
      (lisp-mode)
      (goto-char (point-min))
      (setq state (parse-partial-sexp (point) (save-excursion
						(forward-line 1)
						(point))))
      (parse-partial-sexp (point) (point-max) 0 nil state)
      (setq status (not (= (point) (point-max))))
      (kill-buffer buf)
      status)))

