From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: master 305dbc7 2/4: Move description of value to syntax-ppss function. Date: Wed, 30 Oct 2019 16:59:34 +0200 Message-ID: References: <20191030121649.15369.13207@vcs0.savannah.gnu.org> <20191030121651.BFCF8204DF@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="50357"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 To: emacs-devel@gnu.org, Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 30 16:17:15 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 1iPpil-000D05-4h for ged-emacs-devel@m.gmane.org; Wed, 30 Oct 2019 16:17:15 +0100 Original-Received: from localhost ([::1]:41448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iPpij-0001QE-Tu for ged-emacs-devel@m.gmane.org; Wed, 30 Oct 2019 11:17:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37582) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iPpRk-0002gF-2b for emacs-devel@gnu.org; Wed, 30 Oct 2019 10:59:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iPpRi-00089x-Id for emacs-devel@gnu.org; Wed, 30 Oct 2019 10:59:39 -0400 Original-Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:40878) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iPpRi-00088f-BX for emacs-devel@gnu.org; Wed, 30 Oct 2019 10:59:38 -0400 Original-Received: by mail-ed1-x531.google.com with SMTP id p59so1986021edp.7 for ; Wed, 30 Oct 2019 07:59:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=RaKhWRoYcZ33P6IJeV6x7PnYs05SLZUVADI/Lm5SQSM=; b=i9NPiOfy12WKjMAeG1FmyEu8MZEGLxu2Blb40S8tM5ethP6rIO40xK9+DLnUyRdijn X8kcSYAvdkNcHAmbe5TVShqaHV9NEzrnaYBTE60CLwmd6DgHUoq5S2ZOLVb+DFARJ5YF ap97oY/z2EcM1IRCNq/JhLYOCLult9iwx6aeTqgDQngmermYClWztcZEs4HoomOMq+ah hlNmLMHzy2V3TYTSnmxIiC5Twp2dvI2wuyAFv4plNVhx0dy3inn7XMQt6BBHZAH8flg9 z8Irfv544Y0Wf/HMZlJpQzn8MNnWrkJMHi3q4YijCH5L+c2euL0BuvTHfkii/ntdZRq2 +DZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=RaKhWRoYcZ33P6IJeV6x7PnYs05SLZUVADI/Lm5SQSM=; b=IxCuzteuXCkI/7+/5Xzjjkd2YtIHPCZ64ZB4aUkQhVthvcw7y3/VYWapsCkRRzxh2I 2IPXnU5X/C/HQG/J1CtNaUiMveR3GlfAbclat6AcYn5BOsX/I6q7Ayf/FjdAVXdoE4tM +LsjERwPwliWXcCJoVZqKvINmiibeQAJ177buHMJSCU8CM3IFDDOgD9EF6j05z0G7aR6 ogSvYrSSVJDH6F386sPV8oR7QMjYNtNLekXSdO/FcmCgoEWohz8INy+7JI/rN1Ux2Zp4 K0R5HIryGe0OUlnSOcGmNsv4XNUo1WSMIO6v6l4Q9gnnSPdf20r5jf3rYVC5wj4Fv347 6ftw== X-Gm-Message-State: APjAAAUHNmtzza1LltEpSb8OD5SHPq87vYr1rGBe5PGLbLGDkGlQyupg DrsXKXMzwgGgKboMs2ylvkI= X-Google-Smtp-Source: APXvYqz2PI9KJNBDEJ+Bm4sqJoGcfFSBnkVn06Uxa/CikGpE6s/tXd1ClXDnt7z1BY8i2JPDn72b1w== X-Received: by 2002:aa7:d755:: with SMTP id a21mr86500eds.98.1572447576777; Wed, 30 Oct 2019 07:59:36 -0700 (PDT) Original-Received: from [192.168.0.140] ([109.110.245.170]) by smtp.googlemail.com with ESMTPSA id l49sm6265edb.3.2019.10.30.07.59.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Oct 2019 07:59:35 -0700 (PDT) In-Reply-To: <20191030121651.BFCF8204DF@vcs0.savannah.gnu.org> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::531 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:241624 Archived-At: A bit of a problem with this change is the syntax-ppss doscstring originally said (and still contains these words): except that values at positions 2 and 6 in the returned list (counting from 0) cannot be relied upon. So documenting them in this function is... not logical? On 30.10.2019 14:16, Lars Ingebrigtsen wrote: > branch: master > commit 305dbc7e2be05748039aacb1a3d697f6f64bed4c > Author: Lars Ingebrigtsen > Commit: Lars Ingebrigtsen > > Move description of value to syntax-ppss function. > > * lisp/emacs-lisp/syntax.el (syntax-ppss): Move the description of > the return value from... > > * src/syntax.c (Fparse_partial_sexp): ... here because > `syntax-ppss' is what's called over the place, and jumping through > an indirection to get to the value description is inconvenient. > --- > lisp/emacs-lisp/syntax.el | 20 ++++++++++++++++++++ > src/syntax.c | 20 +------------------- > 2 files changed, 21 insertions(+), 19 deletions(-) > > diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el > index 3861b16..913e34d 100644 > --- a/lisp/emacs-lisp/syntax.el > +++ b/lisp/emacs-lisp/syntax.el > @@ -476,6 +476,26 @@ run from `point-min' to POS except that values at positions 2 and 6 > in the returned list (counting from 0) cannot be relied upon. > Point is at POS when this function returns. > > +Value is a list of elements describing final state of parsing: > + 0. depth in parens. > + 1. character address of start of innermost containing list; nil if none. > + 2. character address of start of last complete sexp terminated. > + 3. non-nil if inside a string. > + (it is the character that will terminate the string, > + or t if the string should be terminated by a generic string delimiter.) > + 4. nil if outside a comment, t if inside a non-nestable comment, > + else an integer (the current comment nesting). > + 5. t if following a quote character. > + 6. the minimum paren-depth encountered during this scan. > + 7. style of comment, if any. > + 8. character address of start of comment or string; nil if not in one. > + 9. List of positions of currently open parens, outermost first. > +10. When the last position scanned holds the first character of a > + (potential) two character construct, the syntax of that position, > + otherwise nil. That construct can be a two character comment > + delimiter or an Escaped or Char-quoted character. > +11..... Possible further internal information used by ‘parse-partial-sexp’. > + > It is necessary to call `syntax-ppss-flush-cache' explicitly if > this function is called while `before-change-functions' is > temporarily let-bound, or if the buffer is modified without > diff --git a/src/syntax.c b/src/syntax.c > index edfdae2..8509213 100644 > --- a/src/syntax.c > +++ b/src/syntax.c > @@ -3530,25 +3530,7 @@ Parsing stops at TO or when certain criteria are met; > If fifth arg OLDSTATE is omitted or nil, > parsing assumes that FROM is the beginning of a function. > > -Value is a list of elements describing final state of parsing: > - 0. depth in parens. > - 1. character address of start of innermost containing list; nil if none. > - 2. character address of start of last complete sexp terminated. > - 3. non-nil if inside a string. > - (it is the character that will terminate the string, > - or t if the string should be terminated by a generic string delimiter.) > - 4. nil if outside a comment, t if inside a non-nestable comment, > - else an integer (the current comment nesting). > - 5. t if following a quote character. > - 6. the minimum paren-depth encountered during this scan. > - 7. style of comment, if any. > - 8. character address of start of comment or string; nil if not in one. > - 9. List of positions of currently open parens, outermost first. > -10. When the last position scanned holds the first character of a > - (potential) two character construct, the syntax of that position, > - otherwise nil. That construct can be a two character comment > - delimiter or an Escaped or Char-quoted character. > -11..... Possible further internal information used by `parse-partial-sexp'. > +See `syntax-ppss' for a description of the return value. > > If third arg TARGETDEPTH is non-nil, parsing stops if the depth > in parentheses becomes equal to TARGETDEPTH. >