]> git.eshelyaron.com Git - emacs.git/commit
(struct gl_state_s): Delete `offset` field
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 12 Apr 2023 19:14:39 +0000 (15:14 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 12 Apr 2023 19:20:07 +0000 (15:20 -0400)
commit1e6463ad22cd74b1b74b9395dff8c8b1485e202e
treee327d9f3bd06e99fa211ef17d45d43ae4a68e447
parent8fdd7710ec0448fe9d3908ad073ddd4d69917719
(struct gl_state_s): Delete `offset` field

`gl_state` had an `offset` field because:

    For buffers, regex-emacs.c passes arguments to the
    UPDATE_SYNTAX_TABLE functions which are relative to BEGV

but the reality is that these arguments are byte offsets relative to
BEGV_BYTE whereas `offset` was counted in chars, so the two didn't
cancel each other out.

* src/syntax.h (struct gl_state_s): Delete `offset` field.
(UPDATE_SYNTAX_TABLE_FORWARD, UPDATE_SYNTAX_TABLE_BACKWARD)
(SYNTAX_TABLE_BYTE_TO_CHAR):
* src/syntax.c (SETUP_SYNTAX_TABLE, SETUP_SYNTAX_TABLE_FOR_OBJECT)
(update_syntax_table, skip_syntaxes): Simplify accordingly.
src/syntax.c
src/syntax.h