diff options
| author | Stefan Monnier | 2023-04-12 15:50:49 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2023-04-12 15:50:49 -0400 |
| commit | c2c3114961802b4c52b4cde0271e460fb08698cf (patch) | |
| tree | 874a4fa813938f3cf185682cf8aec759c8ab5843 /src/syntax.c | |
| parent | d53ff9fe28b63dcd9bab2479cb7a517ba7233016 (diff) | |
| download | emacs-c2c3114961802b4c52b4cde0271e460fb08698cf.tar.gz emacs-c2c3114961802b4c52b4cde0271e460fb08698cf.zip | |
(SETUP_SYNTAX_TABLE_FOR_OBJECT): Take a byteoffset
* src/syntax.c (SETUP_SYNTAX_TABLE_FOR_OBJECT): Take a byteoffset.
* src/regex-emacs.c (re_search_2, re_match_2): Simplify accordingly.
Diffstat (limited to 'src/syntax.c')
| -rw-r--r-- | src/syntax.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/syntax.c b/src/syntax.c index 8ef13eec40a..c1caaa8a739 100644 --- a/src/syntax.c +++ b/src/syntax.c | |||
| @@ -264,14 +264,16 @@ SETUP_SYNTAX_TABLE (ptrdiff_t from, ptrdiff_t count) | |||
| 264 | 264 | ||
| 265 | /* Same as above, but in OBJECT. If OBJECT is nil, use current buffer. | 265 | /* Same as above, but in OBJECT. If OBJECT is nil, use current buffer. |
| 266 | If it is t (which is only used in fast_c_string_match_ignore_case), | 266 | If it is t (which is only used in fast_c_string_match_ignore_case), |
| 267 | ignore properties altogether. */ | 267 | ignore properties altogether. |
| 268 | FROMBYTE is an regexp-byteoffset. */ | ||
| 268 | 269 | ||
| 269 | void | 270 | void |
| 270 | SETUP_SYNTAX_TABLE_FOR_OBJECT (Lisp_Object object, | 271 | SETUP_SYNTAX_TABLE_FOR_OBJECT (Lisp_Object object, |
| 271 | ptrdiff_t from, ptrdiff_t count) | 272 | ptrdiff_t frombyte, ptrdiff_t count) |
| 272 | { | 273 | { |
| 273 | SETUP_BUFFER_SYNTAX_TABLE (); | 274 | SETUP_BUFFER_SYNTAX_TABLE (); |
| 274 | gl_state.object = object; | 275 | gl_state.object = object; |
| 276 | ptrdiff_t from = SYNTAX_TABLE_BYTE_TO_CHAR (frombyte); | ||
| 275 | if (BUFFERP (gl_state.object)) | 277 | if (BUFFERP (gl_state.object)) |
| 276 | { | 278 | { |
| 277 | struct buffer *buf = XBUFFER (gl_state.object); | 279 | struct buffer *buf = XBUFFER (gl_state.object); |