From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#22983: [ Patch ] Re: bug#22983: syntax-ppss returns wrong result. Date: Sun, 24 Sep 2017 11:26:37 +0000 Message-ID: <20170924112637.GA5725@ACM> References: <20170910113626.GB3588@ACM> <20170911201204.GC3605@ACM> <20170917102956.GA4519@ACM> <20170918190847.GB4536@ACM> <20170919204753.GD19168@ACM> <8819156d-b58f-f87f-14b1-5e347202c752@yandex.ru> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1506252918 13252 195.159.176.226 (24 Sep 2017 11:35:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 24 Sep 2017 11:35:18 +0000 (UTC) User-Agent: Mutt/1.7.2 (2016-11-26) Cc: John Wiegley , Philipp Stephani , 22983@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 24 13:35:14 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dw5Bm-0002sA-CD for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Sep 2017 13:35:10 +0200 Original-Received: from localhost ([::1]:37664 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dw5Bt-00011h-IJ for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Sep 2017 07:35:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dw5Bl-0000yU-Cs for bug-gnu-emacs@gnu.org; Sun, 24 Sep 2017 07:35:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dw5Be-0001It-0J for bug-gnu-emacs@gnu.org; Sun, 24 Sep 2017 07:35:09 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46569) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dw5Bd-0001IN-Ta for bug-gnu-emacs@gnu.org; Sun, 24 Sep 2017 07:35:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dw5Bd-0006zb-Jm for bug-gnu-emacs@gnu.org; Sun, 24 Sep 2017 07:35:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Sep 2017 11:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22983 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22983-submit@debbugs.gnu.org id=B22983.150625284326810 (code B ref 22983); Sun, 24 Sep 2017 11:35:01 +0000 Original-Received: (at 22983) by debbugs.gnu.org; 24 Sep 2017 11:34:03 +0000 Original-Received: from localhost ([127.0.0.1]:55250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dw5Ah-0006yL-2J for submit@debbugs.gnu.org; Sun, 24 Sep 2017 07:34:03 -0400 Original-Received: from ocolin.muc.de ([193.149.48.4]:37918 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1dw5Ae-0006xv-Ur for 22983@debbugs.gnu.org; Sun, 24 Sep 2017 07:34:01 -0400 Original-Received: (qmail 9930 invoked by uid 3782); 24 Sep 2017 11:33:59 -0000 Original-Received: from acm.muc.de (p548C6746.dip0.t-ipconnect.de [84.140.103.70]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 24 Sep 2017 13:33:57 +0200 Original-Received: (qmail 5987 invoked by uid 1000); 24 Sep 2017 11:26:37 -0000 Content-Disposition: inline In-Reply-To: <8819156d-b58f-f87f-14b1-5e347202c752@yandex.ru> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:137332 Archived-At: Hello, Dmitry. On Fri, Sep 22, 2017 at 17:09:03 +0300, Dmitry Gutov wrote: > Hi Alan, > On 9/19/17 11:47 PM, Alan Mackenzie wrote: > > I have done now, without the slightest cause for concern (see below). > Thank you. Should you commit the patch (with any documentation tweaks > you deem necessary), or should I? Could I ask you to do it, please? I'm somewhat exhausted from debating another basic Emacs change. Ah yes, the documentation. I checked the doc in the elisp manual, and twice the phrase "from the beginning of the buffer" was used. I've clarified that with "from the beginning of the visible portion of the buffer". I've also amended "a cache" to "caches", though this doesn't seem too important. What do you think: diff --git a/doc/lispref/syntax.texi b/doc/lispref/syntax.texi index e3ae53536f..b37f2b22b8 100644 --- a/doc/lispref/syntax.texi +++ b/doc/lispref/syntax.texi @@ -751,7 +751,8 @@ Position Parse @defun syntax-ppss &optional pos This function returns the parser state that the parser would reach at -position @var{pos} starting from the beginning of the buffer. +position @var{pos} starting from the beginning of the visible portion +of the buffer. @iftex See the next section for @end iftex @@ -762,11 +763,11 @@ Position Parse The return value is the same as if you call the low-level parsing function @code{parse-partial-sexp} to parse from the beginning of the -buffer to @var{pos} (@pxref{Low-Level Parsing}). However, -@code{syntax-ppss} uses a cache to speed up the computation. Due to -this optimization, the second value (previous complete subexpression) -and sixth value (minimum parenthesis depth) in the returned parser -state are not meaningful. +visible portion of the buffer to @var{pos} (@pxref{Low-Level +Parsing}). However, @code{syntax-ppss} uses caches to speed up the +computation. Due to this optimization, the second value (previous +complete subexpression) and sixth value (minimum parenthesis depth) in +the returned parser state are not meaningful. This function has a side effect: it adds a buffer-local entry to @code{before-change-functions} (@pxref{Change Hooks}) for -- Alan Mackenzie (Nuremberg, Germany).