lisp/subr.el (syntax-after): Fix unibyte buffer case (bug#81717)

This commit is contained in:
Stefan Monnier 2026-08-30 23:05:02 -04:00
parent 24fc3c0592
commit 2eae6803a0

View file

@ -6555,7 +6555,10 @@ If POS is outside the buffer's accessible portion, return nil."
(let ((st (if parse-sexp-lookup-properties
(get-char-property pos 'syntax-table))))
(if (consp st) st
(aref (or st (syntax-table)) (char-after pos))))))
(let ((c (char-after pos)))
(aref (or st (syntax-table))
(if enable-multibyte-characters
c (unibyte-char-to-multibyte c))))))))
(defun syntax-class (syntax)
"Return the code for the syntax class described by SYNTAX.