[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Obsoleting font-latex-update-font-lock for fixing bug#37945
From: |
Tassilo Horn |
Subject: |
Re: Obsoleting font-latex-update-font-lock for fixing bug#37945 |
Date: |
Thu, 11 Jun 2020 08:52:31 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Ikumi Keita <ikumi@ikumi.que.jp> writes:
> Actually, there is another "hard reset" in font-latex.el. The function
> `font-latex-add-to-syntax-alist' also sets `font-lock-set-defaults' to
> nil in order to apply the update in `font-latex-syntax-alist' to
> font-lock.
> I think something like the following patch would do the job:
> ----------------------------------------------------------------------
> diff --git a/font-latex.el b/font-latex.el
> index a7076162..d74ccace 100644
> --- a/font-latex.el
> +++ b/font-latex.el
> @@ -1223,8 +1223,10 @@ triggers Font Lock to recognize the change."
> (set (make-local-variable 'font-latex-syntax-alist)
> (append font-latex-syntax-alist list))
> ;; Tell font-lock about the update.
> - (setq font-lock-set-defaults nil)
> - (font-latex-setup))
> + ;; (setq font-lock-set-defaults nil)
> + (font-latex-setup)
> + (dolist (elt list)
> + (modify-syntax-entry (car elt) (cdr elt) font-lock-syntax-table)))
>
> (defun font-latex-syntax-propertize-function (start end)
> "The `syntax-propertize-function' for (La)TeX documents."
> ----------------------------------------------------------------------
> The call to `font-latex-setup' is there only to keep the variable
> `font-lock-defaults' in sync with `font-latex-syntax-alist', just for
> not confusing debug.
> Maybe `font-lock-flush' should be added as well.
Good catch, I've committed a slightly modified (commented) version of
your patch.
Thanks!
Tassilo
Re: Obsoleting font-latex-update-font-lock for fixing bug#37945, Uwe Brauer, 2020/06/11