# HG changeset patch # User Gerd Moellmann # Date 959617005 0 # Node ID d01408f0820d551a829f65d7ebcc24eda929cc7d # Parent 98b8559aeb745c1f9cab80b27e2a84f32e3689f9 (find_defun_start): Move test for open_paren_in_column_0_is_defun_start outside of the loop. diff -r 98b8559aeb74 -r d01408f0820d src/syntax.c --- a/src/syntax.c Mon May 29 15:51:56 2000 +0000 +++ b/src/syntax.c Mon May 29 16:16:45 2000 +0000 @@ -374,22 +374,24 @@ syntax-tables. */ gl_state.current_syntax_table = current_buffer->syntax_table; gl_state.use_global = 0; - while (PT > BEGV) + if (open_paren_in_column_0_is_defun_start) { - /* Open-paren at start of line means we may have found our - defun-start. */ - if (SYNTAX (FETCH_CHAR (PT_BYTE)) == Sopen) + while (PT > BEGV) { - SETUP_SYNTAX_TABLE (PT + 1, -1); /* Try again... */ - if (SYNTAX (FETCH_CHAR (PT_BYTE)) == Sopen - && open_paren_in_column_0_is_defun_start) - break; - /* Now fallback to the default value. */ - gl_state.current_syntax_table = current_buffer->syntax_table; - gl_state.use_global = 0; + /* Open-paren at start of line means we may have found our + defun-start. */ + 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); } - /* Move to beg of previous line. */ - scan_newline (PT, PT_BYTE, BEGV, BEGV_BYTE, -2, 1); } /* Record what we found, for the next try. */