Mercurial > emacs
comparison src/syntax.c @ 1394:3f3934ca2df6
(find_defun_start): scan_buffer returns start of line;
no need to advance over newline.
| author | Richard M. Stallman <rms@gnu.org> |
|---|---|
| date | Sun, 11 Oct 1992 20:41:13 +0000 |
| parents | d9a103f4843e |
| children | 656f4297962e |
comparison
equal
deleted
inserted
replaced
| 1393:d2ae5897e43c | 1394:3f3934ca2df6 |
|---|---|
| 80 && MODIFF == find_start_modiff) | 80 && MODIFF == find_start_modiff) |
| 81 return find_start_value; | 81 return find_start_value; |
| 82 | 82 |
| 83 /* Back up to start of line. */ | 83 /* Back up to start of line. */ |
| 84 tem = scan_buffer ('\n', pos, -1, &shortage); | 84 tem = scan_buffer ('\n', pos, -1, &shortage); |
| 85 /* If we found a newline, we moved back over it, so advance fwd past it. */ | |
| 86 if (shortage == 0) | |
| 87 tem++; | |
| 88 | 85 |
| 89 while (tem > BEGV) | 86 while (tem > BEGV) |
| 90 { | 87 { |
| 91 /* Open-paren at start of line means we found our defun-start. */ | 88 /* Open-paren at start of line means we found our defun-start. */ |
| 92 if (SYNTAX (FETCH_CHAR (tem)) == Sopen) | 89 if (SYNTAX (FETCH_CHAR (tem)) == Sopen) |
| 93 break; | 90 break; |
| 94 /* Move to beg of previous line. */ | 91 /* Move to beg of previous line. */ |
| 95 tem = scan_buffer ('\n', tem, -2, &shortage); | 92 tem = scan_buffer ('\n', tem, -2, &shortage); |
| 96 if (shortage == 0) | |
| 97 tem++; | |
| 98 } | 93 } |
| 99 | 94 |
| 100 /* Record what we found, for the next try. */ | 95 /* Record what we found, for the next try. */ |
| 101 find_start_value = tem; | 96 find_start_value = tem; |
| 102 find_start_buffer = current_buffer; | 97 find_start_buffer = current_buffer; |
