summaryrefslogtreecommitdiff
path: root/src/syntax.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-02-24 22:41:40 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2012-02-24 22:41:40 -0800
commita89654f8f34114db543cb91363e8fded6d73e986 (patch)
tree5ac508597ef2aa460308b4b26c244779e48cdb40 /src/syntax.c
parent6e6c82a4e687708d5a7a3887f92db45bd74da276 (diff)
parent67b0de11479247cb8bd8491e10e0b464046f18be (diff)
downloademacs-a89654f8f34114db543cb91363e8fded6d73e986.tar.gz
Merge from trunk.
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 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
DEFUN ("scan-lists", Fscan_lists, Sscan_lists, 3, 3, 0,
doc: /* Scan from character number FROM by COUNT lists.
-Returns the character number of the position thus found.
+Scan forward if COUNT is positive, backward if COUNT is negative.
+Return the character number of the position thus found.
+
+A \"list", in this context, refers to a balanced parenthetical
+grouping, as determined by the syntax table.
-If DEPTH is nonzero, paren depth begins counting from that value,
-only places where the depth in parentheses becomes zero
-are candidates for stopping; COUNT such places are counted.
-Thus, a positive value for DEPTH means go out levels.
+If DEPTH is nonzero, treat that as the nesting depth of the starting
+point (i.e. the starting point is DEPTH parentheses deep). This
+function scans over parentheses until the depth goes to zero COUNT
+times. Hence, positive DEPTH moves out that number of levels of
+parentheses, while negative DEPTH moves to a deeper level.
Comments are ignored if `parse-sexp-ignore-comments' is non-nil.
-If the beginning or end of (the accessible part of) the buffer is reached
-and the depth is wrong, an error is signaled.
-If the depth is right but the count is not used up, nil is returned. */)
+If we reach the beginning or end of the accessible part of the buffer
+before we have scanned over COUNT lists, return nil if the depth at
+that point is zero, and signal a error if the depth is nonzero. */)
(Lisp_Object from, Lisp_Object count, Lisp_Object depth)
{
CHECK_NUMBER (from);