From: Richard M. Stallman Date: Sat, 17 May 2003 12:50:31 +0000 (+0000) Subject: (find_defun_start): When open_paren_in_column_0_is_defun_start, X-Git-Tag: ttn-vms-21-2-B4~10128 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1fd1cc2fc21249b2ef0d776b73333995cbe1e960;p=emacs.git (find_defun_start): When open_paren_in_column_0_is_defun_start, return beginning of buffer. --- diff --git a/src/ChangeLog b/src/ChangeLog index 5a67533e82b..ae5f2d339a2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,31 @@ +2003-05-17 Richard M. Stallman + + * syntax.c (find_defun_start): + When open_paren_in_column_0_is_defun_start, + return beginning of buffer. + + * lisp.h (map_char_table): Declare added arg. + + * fns.c (map_char_table): New arg TABLE gets the master table. + All calls changed. + Process default and inheritance, resorting to Faref if necessary. + + * keymap.c (Fset_keymap_parent, map_keymap, Fcopy_keymap) + (Faccessible_keymaps): Pass new arg to map_char_table. + + * fontset.c (Ffontset_info): Pass new arg to map_char_table. + + * casetab.c (set_case_table): Pass new arg to map_char_table. + + * data.c (let_shadows_buffer_binding_p): Make target of p volatile. + + * lisp.h (specbinding_func): New typedef. + (struct specbinding): Use specbinding_func, to put the `volatile' + in the right place. + + * alloc.c (Fgarbage_collect): Cast pointers into specpdl + to avoid GCC warning. + 2003-05-16 Ralph Schleicher (tiny change) * fileio.c (Fdelete_file): Handle symlinks pointing to diff --git a/src/syntax.c b/src/syntax.c index d25c4394c6e..706706a53a1 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -337,7 +337,7 @@ dec_bytepos (bytepos) It should be the last one before POS, or nearly the last. When open_paren_in_column_0_is_defun_start is nonzero, - the beginning of every line is treated as a defun-start. + only the beginning of the buffer is treated as a defun-start. We record the information about where the scan started and what its result was, so that another call in the same area @@ -353,6 +353,12 @@ find_defun_start (pos, pos_byte) { int opoint = PT, opoint_byte = PT_BYTE; + if (!open_paren_in_column_0_is_defun_start) + { + find_start_value_byte = BEGV_BYTE; + return BEGV; + } + /* Use previous finding, if it's valid and applies to this inquiry. */ if (current_buffer == find_start_buffer /* Reuse the defun-start even if POS is a little farther on. @@ -372,24 +378,21 @@ find_defun_start (pos, pos_byte) syntax-tables. */ gl_state.current_syntax_table = current_buffer->syntax_table; gl_state.use_global = 0; - if (open_paren_in_column_0_is_defun_start) + while (PT > BEGV) { - while (PT > BEGV) + /* Open-paren at start of line means we may have found our + defun-start. */ + if (SYNTAX (FETCH_CHAR (PT_BYTE)) == Sopen) { - /* Open-paren at start of line means we may have found our - defun-start. */ + SETUP_SYNTAX_TABLE (PT + 1, -1); /* Try again... */ if (SYNTAX (FETCH_CHAR (PT_BYTE)) == Sopen) - { - SETUP_SYNTAX_TABLE (PT + 1, -1); /* Try again... */ - if (SYNTAX (FETCH_CHAR (PT_BYTE)) == Sopen) - break; - /* Now fallback to the default value. */ - gl_state.current_syntax_table = current_buffer->syntax_table; - gl_state.use_global = 0; - } - /* Move to beg of previous line. */ - scan_newline (PT, PT_BYTE, BEGV, BEGV_BYTE, -2, 1); + break; + /* Now fallback to the default value. */ + gl_state.current_syntax_table = current_buffer->syntax_table; + gl_state.use_global = 0; } + /* Move to beg of previous line. */ + scan_newline (PT, PT_BYTE, BEGV, BEGV_BYTE, -2, 1); } /* Record what we found, for the next try. */