diff options
| author | Chong Yidong | 2012-02-17 22:01:05 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-02-17 22:01:05 +0800 |
| commit | 7b926f3f3db5d9a22260209547fb3e60df919ecf (patch) | |
| tree | 7728b5c424cb28deb71a90afe24b9eaa89320a5c /src/syntax.c | |
| parent | ee0ce425dbd94d9b15c1442f9699a47b7feeaf90 (diff) | |
| download | emacs-7b926f3f3db5d9a22260209547fb3e60df919ecf.tar.gz emacs-7b926f3f3db5d9a22260209547fb3e60df919ecf.zip | |
Clarify doc of scan-lists.
* doc/lispref/syntax.texi (Motion via Parsing): Doc fix for scan-lists.
* src/syntax.c (Fscan_lists): Doc fix.
Fixes: debbugs:10833
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 bb473a52b3a..645a65f13e6 100644 --- a/src/syntax.c +++ b/src/syntax.c | |||
| @@ -2844,18 +2844,23 @@ scan_lists (register EMACS_INT from, EMACS_INT count, EMACS_INT depth, int sexpf | |||
| 2844 | 2844 | ||
| 2845 | DEFUN ("scan-lists", Fscan_lists, Sscan_lists, 3, 3, 0, | 2845 | DEFUN ("scan-lists", Fscan_lists, Sscan_lists, 3, 3, 0, |
| 2846 | doc: /* Scan from character number FROM by COUNT lists. | 2846 | doc: /* Scan from character number FROM by COUNT lists. |
| 2847 | Returns the character number of the position thus found. | 2847 | Scan forward if COUNT is positive, backward if COUNT is negative. |
| 2848 | Return the character number of the position thus found. | ||
| 2849 | |||
| 2850 | A \"list", in this context, refers to a balanced parenthetical | ||
| 2851 | grouping, as determined by the syntax table. | ||
| 2848 | 2852 | ||
| 2849 | If DEPTH is nonzero, paren depth begins counting from that value, | 2853 | If DEPTH is nonzero, treat that as the nesting depth of the starting |
| 2850 | only places where the depth in parentheses becomes zero | 2854 | point (i.e. the starting point is DEPTH parentheses deep). This |
| 2851 | are candidates for stopping; COUNT such places are counted. | 2855 | function scans over parentheses until the depth goes to zero COUNT |
| 2852 | Thus, a positive value for DEPTH means go out levels. | 2856 | times. Hence, positive DEPTH moves out that number of levels of |
| 2857 | paretheses, while negative DEPTH moves to a deeper level. | ||
| 2853 | 2858 | ||
| 2854 | Comments are ignored if `parse-sexp-ignore-comments' is non-nil. | 2859 | Comments are ignored if `parse-sexp-ignore-comments' is non-nil. |
| 2855 | 2860 | ||
| 2856 | If the beginning or end of (the accessible part of) the buffer is reached | 2861 | If we reach the beginning or end of the accessible part of the buffer |
| 2857 | and the depth is wrong, an error is signaled. | 2862 | before we have scanned over COUNT lists, return nil if the depth at |
| 2858 | If the depth is right but the count is not used up, nil is returned. */) | 2863 | that point is zero, and signal a error if the depth is nonzero. */) |
| 2859 | (Lisp_Object from, Lisp_Object count, Lisp_Object depth) | 2864 | (Lisp_Object from, Lisp_Object count, Lisp_Object depth) |
| 2860 | { | 2865 | { |
| 2861 | CHECK_NUMBER (from); | 2866 | CHECK_NUMBER (from); |