bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#30617: 26.0.91; syntax-ppss-toplevel-pos documentation bug


From: Charles A. Roelli
Subject: bug#30617: 26.0.91; syntax-ppss-toplevel-pos documentation bug
Date: Mon, 26 Feb 2018 20:32:06 +0100

The commentary for `syntax-ppss-toplevel-pos' in syntax.el mentions
the "undocumented 9th field" of syntax-ppss, which has been confirmed
and documented in v26.  It looks like the comment can be removed.

(defun syntax-ppss-toplevel-pos (ppss)
  "Get the latest syntactically outermost position found in a syntactic scan.
PPSS is a scan state, as returned by `parse-partial-sexp' or `syntax-ppss'.
An \"outermost position\" means one that it is outside of any syntactic entity:
outside of any parentheses, comments, or strings encountered in the scan.
If no such position is recorded in PPSS (because the end of the scan was
itself at the outermost level), return nil."
;; BEWARE! We rely on the undocumented 9th field. The 9th field currently
;; contains the list of positions of the enclosing open-parens.
;; I.e. those positions are outside of any string/comment and the first of
;; those is outside of any paren (i.e. corresponds to a nil ppss).
;; If this list is empty but we are in a string or comment, then the 8th
;; field contains a similar "toplevel" position.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]