GNU bug report logs - #22983
syntax-ppss returns wrong result.

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Fri, 11 Mar 2016 15:13:02 UTC

Severity: normal

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Alan Mackenzie <acm <at> muc.de>
Subject: bug#22983: closed (Re: bug#22983: syntax-ppss returns wrong result.)
Date: Sun, 01 Oct 2017 16:32:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#22983: syntax-ppss returns wrong result.

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 22983 <at> debbugs.gnu.org.

-- 
22983: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22983
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Alan Mackenzie <acm <at> muc.de>
To: 22983-done <at> debbugs.gnu.org
Subject: Re: bug#22983: syntax-ppss returns wrong result.
Date: 1 Oct 2017 16:31:03 -0000
The bug has been fixed by patches to the emacs-26 branch.

-- 
Alan Mackenzie (Nuremberg, Germany).


[Message part 3 (message/rfc822, inline)]
From: Alan Mackenzie <acm <at> muc.de>
To: bug-gnu-emacs <at> gnu.org
Subject: syntax-ppss returns wrong result.
Date: Fri, 11 Mar 2016 15:15:12 +0000
Hello, Emacs.

The fundamental contract in syntax-ppss is that (syntax-ppss POS)
returns the same value as (parse-partial-sexp (point-min) POS) (with the
exception of elements 2 and 6).  This is currently not always the case.

In the master branch, emacs -Q and visit xdisp.c with C-x C-f.  Follow
this recipe:

    M-: (syntax-ppss-flush-cache 1)
    M-: (setq ppss-0 (syntax-ppss 40000))
    M-<
    C-s #include " <CR>
    M->
    C-x n n
    M-: (setq ppss-1 (syntax-ppss 40000))
    M-: (setq parse (parse-partial-sexp (point-min) 40000))

At this point, `ppss-1' and `parse' should match (apart from elements 2
and 6).  What we actually have is:

    ppss-1: (2 39992 nil nil nil nil 2 nil nil (39975 39992))
    parse:  (0 nil 15674 34 nil nil 0 nil 15675 nil)

.

-- 
Alan Mackenzie (Nuremberg, Germany).



This bug report was last modified 7 years and 283 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.