summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2000-05-29 16:16:45 +0000
committerGerd Moellmann <gerd@gnu.org>2000-05-29 16:16:45 +0000
commit4467eb94e5fa405f097ffdbed43dc2f8c52621bb (patch)
treee2dba7c7fbf3740103d1b3d0ec7a4c0ad9b86ba7 /src
parent49e70dec964bc31cd44d2abbc5b79fd954352bc4 (diff)
downloademacs-4467eb94e5fa405f097ffdbed43dc2f8c52621bb.tar.gz
(find_defun_start): Move test for
open_paren_in_column_0_is_defun_start outside of the loop.
Diffstat (limited to 'src')
-rw-r--r--src/syntax.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 3be4aab4c96..d2eddafa439 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -374,22 +374,24 @@ find_defun_start (pos, pos_byte)
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. */