mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-22 07:09:54 +00:00
(find_defun_start): Move test for
open_paren_in_column_0_is_defun_start outside of the loop.
This commit is contained in:
parent
49e70dec96
commit
4467eb94e5
28
src/syntax.c
28
src/syntax.c
@ -374,22 +374,24 @@ find_defun_start (pos, pos_byte)
|
|||||||
syntax-tables. */
|
syntax-tables. */
|
||||||
gl_state.current_syntax_table = current_buffer->syntax_table;
|
gl_state.current_syntax_table = current_buffer->syntax_table;
|
||||||
gl_state.use_global = 0;
|
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
|
while (PT > BEGV)
|
||||||
defun-start. */
|
|
||||||
if (SYNTAX (FETCH_CHAR (PT_BYTE)) == Sopen)
|
|
||||||
{
|
{
|
||||||
SETUP_SYNTAX_TABLE (PT + 1, -1); /* Try again... */
|
/* Open-paren at start of line means we may have found our
|
||||||
if (SYNTAX (FETCH_CHAR (PT_BYTE)) == Sopen
|
defun-start. */
|
||||||
&& open_paren_in_column_0_is_defun_start)
|
if (SYNTAX (FETCH_CHAR (PT_BYTE)) == Sopen)
|
||||||
break;
|
{
|
||||||
/* Now fallback to the default value. */
|
SETUP_SYNTAX_TABLE (PT + 1, -1); /* Try again... */
|
||||||
gl_state.current_syntax_table = current_buffer->syntax_table;
|
if (SYNTAX (FETCH_CHAR (PT_BYTE)) == Sopen)
|
||||||
gl_state.use_global = 0;
|
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. */
|
/* Record what we found, for the next try. */
|
||||||
|
Loading…
Reference in New Issue
Block a user