diff options
| author | Lars Ingebrigtsen | 2019-10-30 12:39:14 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-10-30 13:16:44 +0100 |
| commit | 305dbc7e2be05748039aacb1a3d697f6f64bed4c (patch) | |
| tree | 4110b343b5b5c96000b02e81b9051821b9e71d9b | |
| parent | 40c787ff4e9162d6f1a9a0abac3c83f1d0389810 (diff) | |
| download | emacs-305dbc7e2be05748039aacb1a3d697f6f64bed4c.tar.gz emacs-305dbc7e2be05748039aacb1a3d697f6f64bed4c.zip | |
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.
| -rw-r--r-- | lisp/emacs-lisp/syntax.el | 20 | ||||
| -rw-r--r-- | 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 3861b160cc9..913e34d5136 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 | |||
| 476 | in the returned list (counting from 0) cannot be relied upon. | 476 | in the returned list (counting from 0) cannot be relied upon. |
| 477 | Point is at POS when this function returns. | 477 | Point is at POS when this function returns. |
| 478 | 478 | ||
| 479 | Value is a list of elements describing final state of parsing: | ||
| 480 | 0. depth in parens. | ||
| 481 | 1. character address of start of innermost containing list; nil if none. | ||
| 482 | 2. character address of start of last complete sexp terminated. | ||
| 483 | 3. non-nil if inside a string. | ||
| 484 | (it is the character that will terminate the string, | ||
| 485 | or t if the string should be terminated by a generic string delimiter.) | ||
| 486 | 4. nil if outside a comment, t if inside a non-nestable comment, | ||
| 487 | else an integer (the current comment nesting). | ||
| 488 | 5. t if following a quote character. | ||
| 489 | 6. the minimum paren-depth encountered during this scan. | ||
| 490 | 7. style of comment, if any. | ||
| 491 | 8. character address of start of comment or string; nil if not in one. | ||
| 492 | 9. List of positions of currently open parens, outermost first. | ||
| 493 | 10. When the last position scanned holds the first character of a | ||
| 494 | (potential) two character construct, the syntax of that position, | ||
| 495 | otherwise nil. That construct can be a two character comment | ||
| 496 | delimiter or an Escaped or Char-quoted character. | ||
| 497 | 11..... Possible further internal information used by ‘parse-partial-sexp’. | ||
| 498 | |||
| 479 | It is necessary to call `syntax-ppss-flush-cache' explicitly if | 499 | It is necessary to call `syntax-ppss-flush-cache' explicitly if |
| 480 | this function is called while `before-change-functions' is | 500 | this function is called while `before-change-functions' is |
| 481 | temporarily let-bound, or if the buffer is modified without | 501 | temporarily let-bound, or if the buffer is modified without |
diff --git a/src/syntax.c b/src/syntax.c index edfdae22590..850921353d6 100644 --- a/src/syntax.c +++ b/src/syntax.c | |||
| @@ -3530,25 +3530,7 @@ Parsing stops at TO or when certain criteria are met; | |||
| 3530 | If fifth arg OLDSTATE is omitted or nil, | 3530 | If fifth arg OLDSTATE is omitted or nil, |
| 3531 | parsing assumes that FROM is the beginning of a function. | 3531 | parsing assumes that FROM is the beginning of a function. |
| 3532 | 3532 | ||
| 3533 | Value is a list of elements describing final state of parsing: | 3533 | See `syntax-ppss' for a description of the return value. |
| 3534 | 0. depth in parens. | ||
| 3535 | 1. character address of start of innermost containing list; nil if none. | ||
| 3536 | 2. character address of start of last complete sexp terminated. | ||
| 3537 | 3. non-nil if inside a string. | ||
| 3538 | (it is the character that will terminate the string, | ||
| 3539 | or t if the string should be terminated by a generic string delimiter.) | ||
| 3540 | 4. nil if outside a comment, t if inside a non-nestable comment, | ||
| 3541 | else an integer (the current comment nesting). | ||
| 3542 | 5. t if following a quote character. | ||
| 3543 | 6. the minimum paren-depth encountered during this scan. | ||
| 3544 | 7. style of comment, if any. | ||
| 3545 | 8. character address of start of comment or string; nil if not in one. | ||
| 3546 | 9. List of positions of currently open parens, outermost first. | ||
| 3547 | 10. When the last position scanned holds the first character of a | ||
| 3548 | (potential) two character construct, the syntax of that position, | ||
| 3549 | otherwise nil. That construct can be a two character comment | ||
| 3550 | delimiter or an Escaped or Char-quoted character. | ||
| 3551 | 11..... Possible further internal information used by `parse-partial-sexp'. | ||
| 3552 | 3534 | ||
| 3553 | If third arg TARGETDEPTH is non-nil, parsing stops if the depth | 3535 | If third arg TARGETDEPTH is non-nil, parsing stops if the depth |
| 3554 | in parentheses becomes equal to TARGETDEPTH. | 3536 | in parentheses becomes equal to TARGETDEPTH. |