aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)
374 syntax-tables. */ 374 syntax-tables. */
375 gl_state.current_syntax_table = current_buffer->syntax_table; 375 gl_state.current_syntax_table = current_buffer->syntax_table;
376 gl_state.use_global = 0; 376 gl_state.use_global = 0;
377 while (PT > BEGV) 377 if (open_paren_in_column_0_is_defun_start)
378 { 378 {
379 /* Open-paren at start of line means we may have found our 379 while (PT > BEGV)
380 defun-start. */
381 if (SYNTAX (FETCH_CHAR (PT_BYTE)) == Sopen)
382 { 380 {
383 SETUP_SYNTAX_TABLE (PT + 1, -1); /* Try again... */ 381 /* Open-paren at start of line means we may have found our
384 if (SYNTAX (FETCH_CHAR (PT_BYTE)) == Sopen 382 defun-start. */
385 && open_paren_in_column_0_is_defun_start) 383 if (SYNTAX (FETCH_CHAR (PT_BYTE)) == Sopen)
386 break; 384 {
387 /* Now fallback to the default value. */ 385 SETUP_SYNTAX_TABLE (PT + 1, -1); /* Try again... */
388 gl_state.current_syntax_table = current_buffer->syntax_table; 386 if (SYNTAX (FETCH_CHAR (PT_BYTE)) == Sopen)
389 gl_state.use_global = 0; 387 break;
388 /* Now fallback to the default value. */
389 gl_state.current_syntax_table = current_buffer->syntax_table;
390 gl_state.use_global = 0;
391 }
392 /* Move to beg of previous line. */
393 scan_newline (PT, PT_BYTE, BEGV, BEGV_BYTE, -2, 1);
390 } 394 }
391 /* Move to beg of previous line. */
392 scan_newline (PT, PT_BYTE, BEGV, BEGV_BYTE, -2, 1);
393 } 395 }
394 396
395 /* Record what we found, for the next try. */ 397 /* Record what we found, for the next try. */