diff options
| author | Stefan Monnier | 2012-03-25 16:37:21 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2012-03-25 16:37:21 -0400 |
| commit | 699c782b7668c44d0fa4446331b0590a6d5dac82 (patch) | |
| tree | 5dcce364741d0761920a3d274b0fc8aba4103d45 /src/syntax.c | |
| parent | 98fb480ee31bf74cf554044f60f21df16566dd7f (diff) | |
| parent | e99a9b8bdccadded1f6fae88ee7a2a93dfd4eacf (diff) | |
| download | emacs-pending.tar.gz emacs-pending.zip | |
Merge from trunkpending
Diffstat (limited to 'src/syntax.c')
| -rw-r--r-- | src/syntax.c | 28 |
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 | ||
| 5 | This file is part of GNU Emacs. | 5 | This 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 | ||
| 2840 | DEFUN ("scan-lists", Fscan_lists, Sscan_lists, 3, 3, 0, | 2845 | DEFUN ("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. |
| 2842 | 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. | ||
| 2843 | 2852 | ||
| 2844 | 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 |
| 2845 | only places where the depth in parentheses becomes zero | 2854 | point (i.e. the starting point is DEPTH parentheses deep). This |
| 2846 | are candidates for stopping; COUNT such places are counted. | 2855 | function scans over parentheses until the depth goes to zero COUNT |
| 2847 | Thus, a positive value for DEPTH means go out levels. | 2856 | times. Hence, positive DEPTH moves out that number of levels of |
| 2857 | parentheses, while negative DEPTH moves to a deeper level. | ||
| 2848 | 2858 | ||
| 2849 | Comments are ignored if `parse-sexp-ignore-comments' is non-nil. | 2859 | Comments are ignored if `parse-sexp-ignore-comments' is non-nil. |
| 2850 | 2860 | ||
| 2851 | 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 |
| 2852 | and the depth is wrong, an error is signaled. | 2862 | before we have scanned over COUNT lists, return nil if the depth at |
| 2853 | 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. */) |
| 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); |