]> git.eshelyaron.com Git - sweep.git/commit
Respect 'syntax-table' text properties
authorEshel Yaron <me@eshelyaron.com>
Sun, 26 Nov 2023 10:33:57 +0000 (11:33 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sun, 26 Nov 2023 10:33:57 +0000 (11:33 +0100)
commit7e0726cf4c231fd3a1bee600243138356cbd4bda
treed0090d155f79b8f69965211c5dcda1aba0a81be9
parent0a58409a4c5404ee349654fde66dd7742a4f4e73
Respect 'syntax-table' text properties

Replace all usages of (char-syntax (char-before/after ...)) with
'syntax-after' calls, since the former doesn't take into account the
'syntax-table' text property that 'syntax-propertize-function' adds.
In particular, this fixes an issue with 'forward-sexp' over character
literals such as "0'c".

* sweeprolog.el (sweeprolog-syntax-propertize): Replace with...
(sweeprolog-syntax-propertize-function): New 'defconst'.
(sweeprolog-mode): Use it.
(sweeprolog--op-p, sweeprolog-syntax-class-at): New 'defsubst'.
(sweeprolog--parse-context, sweeprolog--completion-at-point)
(sweeprolog-next-token-boundaries, sweeprolog-last-token-boundaries)
(sweeprolog--forward-term, sweeprolog--backward-term)
(sweeprolog--precedence-at-point,sweeprolog-align-spaces)
(sweeprolog-indent-line): Respect 'syntax-table' text properties.

* sweeprolog-tests.el (backward-sexp-over-char-literal): Test it.
sweeprolog-tests.el
sweeprolog.el