GNU bug report logs - #69404
Loss of latex-mode fontification when loading libraries in latex-mode-hook that require json-mode

Previous Next

Package: emacs;

Reported by: Gabriele Nicolardi <gabriele <at> medialab.sissa.it>

Date: Mon, 26 Feb 2024 09:29:01 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 69404 <at> debbugs.gnu.org (full text, mbox):

From: Gabriele Nicolardi <gabriele <at> medialab.sissa.it>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 69404 <at> debbugs.gnu.org
Subject: Re: bug#69404: Loss of latex-mode fontification when loading
 libraries in latex-mode-hook that require json-mode
Date: Wed, 28 Feb 2024 14:29:40 +0100
Indeed it was a bug in json-mode.el

https://github.com/json-emacs/json-mode/issues/79

Thanks!

Gabriele Nicolardi

Il 26/02/24 16:57, Eli Zaretskii ha scritto:
>> Date: Mon, 26 Feb 2024 16:41:15 +0100
>> Cc: 69404 <at> debbugs.gnu.org
>> From: Gabriele Nicolardi <gabriele <at> medialab.sissa.it>
>>
>>
>> Il 26/02/24 14:03, Eli Zaretskii ha scritto:
>>>> If I load my .tex file like this:
>>>>
>>>> emacs -Q --eval "(load-file \"/tmp/config.el\")" test.tex
>>>>
>>>> I lose latex-mode fontification:
>>> What is the value of major-mode after you load your .tex file as
>>> above?
>> In the buffer loaded as above, with the wrong fontification, I have:
>>
>> major-mode is a variable defined in ‘C source code’.
>>
>>
>> Its value is ‘latex-mode’
>> Original value was ‘fundamental-mode’
>> Local in buffer test.tex; global value is fundamental-mode
> Then I suggest to look for the reason in json-mode.el.  For example,
> this part:
>
>    (add-to-list 'magic-fallback-mode-alist '("^[{[]$" . json-mode))
>
> could change the global state when you load json-mode.




This bug report was last modified 1 year and 135 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.