From: Dmitry Gutov <dgutov@yandex.ru>
To: emacs-devel@gnu.org, Lars Ingebrigtsen <larsi@gnus.org>
Subject: Re: master 305dbc7 2/4: Move description of value to syntax-ppss function.
Date: Wed, 30 Oct 2019 16:59:34 +0200 [thread overview]
Message-ID: <f104223f-975b-2f62-9404-3cd5baa0bf6f@yandex.ru> (raw)
In-Reply-To: <20191030121651.BFCF8204DF@vcs0.savannah.gnu.org>
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 <larsi@gnus.org>
> Commit: Lars Ingebrigtsen <larsi@gnus.org>
>
> 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.
>
next parent reply other threads:[~2019-10-30 14:59 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20191030121649.15369.13207@vcs0.savannah.gnu.org>
[not found] ` <20191030121651.BFCF8204DF@vcs0.savannah.gnu.org>
2019-10-30 14:59 ` Dmitry Gutov [this message]
2019-10-30 15:03 ` master 305dbc7 2/4: Move description of value to syntax-ppss function Lars Ingebrigtsen
2019-10-30 15:13 ` Dmitry Gutov
2019-10-30 15:22 ` Lars Ingebrigtsen
2019-10-30 15:26 ` Dmitry Gutov
2019-10-30 15:30 ` Lars Ingebrigtsen
2019-10-30 15:29 ` Lars Ingebrigtsen
2019-10-30 16:13 ` Dmitry Gutov
2019-10-30 16:17 ` Lars Ingebrigtsen
2019-10-30 16:47 ` Dmitry Gutov
2019-10-30 17:03 ` Lars Ingebrigtsen
2019-10-30 19:39 ` Stefan Monnier
2019-10-30 20:28 ` Lars Ingebrigtsen
2019-12-13 12:34 ` Noam Postavsky
2019-12-13 13:03 ` Dmitry Gutov
2019-12-17 16:28 ` Lars Ingebrigtsen
2020-02-15 14:55 ` Noam Postavsky
2020-02-15 15:14 ` Dmitry Gutov
2020-02-15 16:23 ` Noam Postavsky
2020-02-23 14:11 ` Noam Postavsky
2019-10-30 20:34 ` Alan Mackenzie
2019-10-30 20:41 ` Dmitry Gutov
2019-10-31 1:45 ` Stefan Monnier
2019-10-31 14:06 ` Lars Ingebrigtsen
2019-10-30 20:47 ` Alan Mackenzie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f104223f-975b-2f62-9404-3cd5baa0bf6f@yandex.ru \
--to=dgutov@yandex.ru \
--cc=emacs-devel@gnu.org \
--cc=larsi@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).