From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Fix the choked unreality in page Parser State in syntax.texi. Date: Wed, 18 Dec 2019 19:54:23 +0000 Message-ID: <20191218195423.GA5215@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="28767"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 18 20:54:46 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ihfPB-0007Fy-UM for ged-emacs-devel@m.gmane.org; Wed, 18 Dec 2019 20:54:46 +0100 Original-Received: from localhost ([::1]:59874 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihfP5-0006Mc-4N for ged-emacs-devel@m.gmane.org; Wed, 18 Dec 2019 14:54:39 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60729) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihfOv-0006Gt-Nk for emacs-devel@gnu.org; Wed, 18 Dec 2019 14:54:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihfOu-0001Ch-4q for emacs-devel@gnu.org; Wed, 18 Dec 2019 14:54:29 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:15450 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1ihfOt-00011k-OJ for emacs-devel@gnu.org; Wed, 18 Dec 2019 14:54:28 -0500 Original-Received: (qmail 79606 invoked by uid 3782); 18 Dec 2019 19:54:25 -0000 Original-Received: from acm.muc.de (p4FE15C48.dip0.t-ipconnect.de [79.225.92.72]) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 18 Dec 2019 20:54:23 +0100 Original-Received: (qmail 5271 invoked by uid 1000); 18 Dec 2019 19:54:23 -0000 Content-Disposition: inline X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:243454 Archived-At: Hello, Emacs. The page Parser State in the Elisp manual gives a choked, vague, inadequate impression. The cause is clear - A parser state is exactly the return value of parse-partial-sexp, yet that function is not mentioned once in the page. In fact, the page looks censored to avoid mentioning parse-partial-sexp. This is ridiculous and harmful. I therefore propose installing the following documentation patch for Emacs 27. It also tidies up one or two untidinesses: diff --git a/doc/lispref/syntax.texi b/doc/lispref/syntax.texi index 63d534dd13..d494d6fc5e 100644 --- a/doc/lispref/syntax.texi +++ b/doc/lispref/syntax.texi @@ -797,12 +797,13 @@ Parser State A @dfn{parser state} is a list of (currently) eleven elements describing the state of the syntactic parser, after it parses the text between a specified starting point and a specified end point in the -buffer. Parsing functions such as @code{syntax-ppss} +buffer using @code{parse-partial-sexp} (@pxref{Low-Level Parsing}). +Parsing functions such as @code{syntax-ppss} @ifnottex (@pxref{Position Parse}) @end ifnottex -return a parser state as the value. Some parsing functions accept a -parser state as an argument, for resuming parsing. +also return a parser state as the value. @code{parse-partial-sexp} +can accept a parser state as an argument, for resuming parsing. Here are the meanings of the elements of the parser state: @@ -866,11 +867,11 @@ Parser State @end enumerate Elements 1, 2, and 6 are ignored in a state which you pass as an -argument to continue parsing. Elements 9 and 10 are mainly used -internally by the parser code. +argument to @code{parse-partial-sexp} to continue parsing. Elements 9 +and 10 are mainly used internally by the parser code. - One additional piece of useful information is available from a -parser state using this function: + Two additional pieces of useful information are available from a +parser state using these functions: @defun syntax-ppss-toplevel-pos state This function extracts, from parser state @var{state}, the last @@ -883,8 +884,8 @@ Parser State @end defun @defun syntax-ppss-context state -Return @code{string} if @var{state} is a string and @code{comment} if -it's a comment. +Return @code{string} if the end position of a scan returning +@var{state} is in a string, and @code{comment} if it's in a comment. @end defun @node Low-Level Parsing -- Alan Mackenzie (Nuremberg, Germany).