emacs-devel
[Top][All Lists]
Advanced

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

Re: master 305dbc7 2/4: Move description of value to syntax-ppss functio


From: Dmitry Gutov
Subject: Re: master 305dbc7 2/4: Move description of value to syntax-ppss function.
Date: Wed, 30 Oct 2019 16:59:34 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0


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 <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

     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.





reply via email to

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