aboutsummaryrefslogtreecommitdiffstats
path: root/src/syntax.c
diff options
context:
space:
mode:
authorChong Yidong2012-02-17 22:01:05 +0800
committerChong Yidong2012-02-17 22:01:05 +0800
commit7b926f3f3db5d9a22260209547fb3e60df919ecf (patch)
tree7728b5c424cb28deb71a90afe24b9eaa89320a5c /src/syntax.c
parentee0ce425dbd94d9b15c1442f9699a47b7feeaf90 (diff)
downloademacs-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.c21
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
2845DEFUN ("scan-lists", Fscan_lists, Sscan_lists, 3, 3, 0, 2845DEFUN ("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.
2847Returns the character number of the position thus found. 2847Scan forward if COUNT is positive, backward if COUNT is negative.
2848Return the character number of the position thus found.
2849
2850A \"list", in this context, refers to a balanced parenthetical
2851grouping, as determined by the syntax table.
2848 2852
2849If DEPTH is nonzero, paren depth begins counting from that value, 2853If DEPTH is nonzero, treat that as the nesting depth of the starting
2850only places where the depth in parentheses becomes zero 2854point (i.e. the starting point is DEPTH parentheses deep). This
2851are candidates for stopping; COUNT such places are counted. 2855function scans over parentheses until the depth goes to zero COUNT
2852Thus, a positive value for DEPTH means go out levels. 2856times. Hence, positive DEPTH moves out that number of levels of
2857paretheses, while negative DEPTH moves to a deeper level.
2853 2858
2854Comments are ignored if `parse-sexp-ignore-comments' is non-nil. 2859Comments are ignored if `parse-sexp-ignore-comments' is non-nil.
2855 2860
2856If the beginning or end of (the accessible part of) the buffer is reached 2861If we reach the beginning or end of the accessible part of the buffer
2857and the depth is wrong, an error is signaled. 2862before we have scanned over COUNT lists, return nil if the depth at
2858If the depth is right but the count is not used up, nil is returned. */) 2863that 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);