aboutsummaryrefslogtreecommitdiffstats
path: root/src/syntax.c
diff options
context:
space:
mode:
authorStefan Monnier2012-03-25 16:37:21 -0400
committerStefan Monnier2012-03-25 16:37:21 -0400
commit699c782b7668c44d0fa4446331b0590a6d5dac82 (patch)
tree5dcce364741d0761920a3d274b0fc8aba4103d45 /src/syntax.c
parent98fb480ee31bf74cf554044f60f21df16566dd7f (diff)
parente99a9b8bdccadded1f6fae88ee7a2a93dfd4eacf (diff)
downloademacs-pending.tar.gz
emacs-pending.zip
Merge from trunkpending
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 8c2d5ded21f..16012d9f88e 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1,5 +1,5 @@
1/* GNU Emacs routines to deal with syntax tables; also word and list parsing. 1/* GNU Emacs routines to deal with syntax tables; also word and list parsing.
2 Copyright (C) 1985, 1987, 1993-1995, 1997-1999, 2001-2011 2 Copyright (C) 1985, 1987, 1993-1995, 1997-1999, 2001-2012
3 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
@@ -398,7 +398,12 @@ find_defun_start (EMACS_INT pos, EMACS_INT pos_byte)
398 398
399 if (!open_paren_in_column_0_is_defun_start) 399 if (!open_paren_in_column_0_is_defun_start)
400 { 400 {
401 find_start_value = BEGV;
401 find_start_value_byte = BEGV_BYTE; 402 find_start_value_byte = BEGV_BYTE;
403 find_start_buffer = current_buffer;
404 find_start_modiff = MODIFF;
405 find_start_begv = BEGV;
406 find_start_pos = pos;
402 return BEGV; 407 return BEGV;
403 } 408 }
404 409
@@ -2839,18 +2844,23 @@ scan_lists (register EMACS_INT from, EMACS_INT count, EMACS_INT depth, int sexpf
2839 2844
2840DEFUN ("scan-lists", Fscan_lists, Sscan_lists, 3, 3, 0, 2845DEFUN ("scan-lists", Fscan_lists, Sscan_lists, 3, 3, 0,
2841 doc: /* Scan from character number FROM by COUNT lists. 2846 doc: /* Scan from character number FROM by COUNT lists.
2842Returns 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.
2843 2852
2844If DEPTH is nonzero, paren depth begins counting from that value, 2853If DEPTH is nonzero, treat that as the nesting depth of the starting
2845only places where the depth in parentheses becomes zero 2854point (i.e. the starting point is DEPTH parentheses deep). This
2846are candidates for stopping; COUNT such places are counted. 2855function scans over parentheses until the depth goes to zero COUNT
2847Thus, a positive value for DEPTH means go out levels. 2856times. Hence, positive DEPTH moves out that number of levels of
2857parentheses, while negative DEPTH moves to a deeper level.
2848 2858
2849Comments are ignored if `parse-sexp-ignore-comments' is non-nil. 2859Comments are ignored if `parse-sexp-ignore-comments' is non-nil.
2850 2860
2851If 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
2852and the depth is wrong, an error is signaled. 2862before we have scanned over COUNT lists, return nil if the depth at
2853If 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. */)
2854 (Lisp_Object from, Lisp_Object count, Lisp_Object depth) 2864 (Lisp_Object from, Lisp_Object count, Lisp_Object depth)
2855{ 2865{
2856 CHECK_NUMBER (from); 2866 CHECK_NUMBER (from);