auctex-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Syntax propertize in font-latex (Re: bug#35140: 12.1; Scan errors in


From: Ikumi Keita
Subject: Re: Syntax propertize in font-latex (Re: bug#35140: 12.1; Scan errors in doctex mode with ^^A-comments after braces)
Date: Mon, 07 Mar 2022 17:14:22 +0900

Hi Tassilo and Stefan,

>>>>> Tassilo Horn <tsdh@gnu.org> writes:
> Ikumi Keita <ikumi@ikumi.que.jp> writes:
>> The problems is that it requires some changes in entries in
>> `font-latex-syntactic-keywords', sometimes rather non-trivial ones as
>> seen in the patch. It's possible to do required changes in files
>> distributed with AUCTeX, but if some user adds entries to
>> `font-latex-syntactic-keywords' in their private styles, this
>> incompatibility can be a non-easy problem.

> Indeed, and therefore I'd like to avoid such a drastic change if
> possible.

I see `syntax-propertize-via-font-lock' is implemented using
`font-lock-syntactic-keywords' as seen below. Is it planned that
`syntax-propertize-via-font-lock' survives after
`font-lock-syntactic-keywords' is removed in Emacs 29? (If not, we have
to consider to migrate to method using `syntax-propertize-rules',
introducing breaking changes in the format of
`font-latex-syntactic-keywords'.)

Current implementation of `syntax-propertize-via-font-lock':
----------------------------------------------------------------------
(defun syntax-propertize-via-font-lock (keywords)
  "Propertize for syntax using font-lock syntax.
KEYWORDS obeys the format used in `font-lock-syntactic-keywords'.
The return value is a function (with two parameters, START and
END) suitable for `syntax-propertize-function'."
  (lambda (start end)
    (with-no-warnings
      (let ((font-lock-syntactic-keywords keywords))
        (font-lock-fontify-syntactic-keywords-region start end)
        ;; In case it was eval'd/compiled.
        (setq keywords font-lock-syntactic-keywords)))))
----------------------------------------------------------------------

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine



reply via email to

[Prev in Thread] Current Thread [Next in Thread]