diff options
| author | Paul Eggert | 2012-02-24 22:41:40 -0800 |
|---|---|---|
| committer | Paul Eggert | 2012-02-24 22:41:40 -0800 |
| commit | a89654f8f34114db543cb91363e8fded6d73e986 (patch) | |
| tree | 5ac508597ef2aa460308b4b26c244779e48cdb40 /src/syntax.c | |
| parent | 6e6c82a4e687708d5a7a3887f92db45bd74da276 (diff) | |
| parent | 67b0de11479247cb8bd8491e10e0b464046f18be (diff) | |
| download | emacs-a89654f8f34114db543cb91363e8fded6d73e986.tar.gz emacs-a89654f8f34114db543cb91363e8fded6d73e986.zip | |
Merge from trunk.
Diffstat (limited to 'src/syntax.c')
| -rw-r--r-- | src/syntax.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/syntax.c b/src/syntax.c index a802360582b..70e66ba1871 100644 --- a/src/syntax.c +++ b/src/syntax.c | |||
| @@ -2846,18 +2846,23 @@ scan_lists (register EMACS_INT from, EMACS_INT count, EMACS_INT depth, int sexpf | |||
| 2846 | 2846 | ||
| 2847 | DEFUN ("scan-lists", Fscan_lists, Sscan_lists, 3, 3, 0, | 2847 | DEFUN ("scan-lists", Fscan_lists, Sscan_lists, 3, 3, 0, |
| 2848 | doc: /* Scan from character number FROM by COUNT lists. | 2848 | doc: /* Scan from character number FROM by COUNT lists. |
| 2849 | Returns the character number of the position thus found. | 2849 | Scan forward if COUNT is positive, backward if COUNT is negative. |
| 2850 | Return the character number of the position thus found. | ||
| 2851 | |||
| 2852 | A \"list", in this context, refers to a balanced parenthetical | ||
| 2853 | grouping, as determined by the syntax table. | ||
| 2850 | 2854 | ||
| 2851 | If DEPTH is nonzero, paren depth begins counting from that value, | 2855 | If DEPTH is nonzero, treat that as the nesting depth of the starting |
| 2852 | only places where the depth in parentheses becomes zero | 2856 | point (i.e. the starting point is DEPTH parentheses deep). This |
| 2853 | are candidates for stopping; COUNT such places are counted. | 2857 | function scans over parentheses until the depth goes to zero COUNT |
| 2854 | Thus, a positive value for DEPTH means go out levels. | 2858 | times. Hence, positive DEPTH moves out that number of levels of |
| 2859 | parentheses, while negative DEPTH moves to a deeper level. | ||
| 2855 | 2860 | ||
| 2856 | Comments are ignored if `parse-sexp-ignore-comments' is non-nil. | 2861 | Comments are ignored if `parse-sexp-ignore-comments' is non-nil. |
| 2857 | 2862 | ||
| 2858 | If the beginning or end of (the accessible part of) the buffer is reached | 2863 | If we reach the beginning or end of the accessible part of the buffer |
| 2859 | and the depth is wrong, an error is signaled. | 2864 | before we have scanned over COUNT lists, return nil if the depth at |
| 2860 | If the depth is right but the count is not used up, nil is returned. */) | 2865 | that point is zero, and signal a error if the depth is nonzero. */) |
| 2861 | (Lisp_Object from, Lisp_Object count, Lisp_Object depth) | 2866 | (Lisp_Object from, Lisp_Object count, Lisp_Object depth) |
| 2862 | { | 2867 | { |
| 2863 | CHECK_NUMBER (from); | 2868 | CHECK_NUMBER (from); |