auctex
[Top][All Lists]
Advanced

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

Re: [AUCTeX] TeX-fold-mode and sectioning font lock mode


From: Ikumi Keita
Subject: Re: [AUCTeX] TeX-fold-mode and sectioning font lock mode
Date: Mon, 07 Jun 2021 19:14:35 +0900

Hi Juan,

>>>>> Juan Jose Garcia-Ripoll <juanjose.garciaripoll@gmail.com> writes:
> Just to clarify, to solve this, I have to create a hook to LaTeX-mode that
> looks as follows, ensuring that I fontify the buffer before it is folded

> (defun juanjo:latex-hook ()
>            (turn-on-reftex)
>            (TeX-fold-mode +1)
>            (font-lock-mode +1)
>            (TeX-fold-buffer))

> If I simply use use-package with two :hook statements, one for
> TeX-fold-mode and one for TeX-fold-buffer, this does not work.

AUCTeX documentation[1] has the following instruction:
,----
|  -- Command: TeX-fold-buffer
|      ('C-c C-o C-b') Hide all foldable items in the current buffer
|      according to the setting of 'TeX-fold-type-list'.
| 
|      If you want to have this done automatically every time you open a
|      file, add it to a hook and make sure the function is called after
|      font locking is set up for the buffer.  The following code should
|      accomplish this:
| 
|           (add-hook 'find-file-hook #'TeX-fold-buffer t)
`----
Please try this instead of adding `TeX-fold-buffer' in `LaTeX-mode-hook'.

[1] https://www.gnu.org/software/auctex/manual/auctex/Folding.html#Folding

> On Sat, Apr 28, 2018 at 6:36 PM, Juan Jose Garcia-Ripoll <
> juanjose.garciaripoll@gmail.com> wrote:

>> I have a \section{} in LaTeX which is properly fontified in ordinary
>> LaTeX-mode. If I fold the buffer, the outcome looks pretty different
>> I can see the usual fontified text if I move with the cursor over the text
>> and once I exit I recover the face that should have been there from the
>> beginning
>> 
>> I assume this is a bug in how TeX-fold works but I am having a hard time
>> debugging it.

Regards,
Ikumi Keita



reply via email to

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