GNU bug report logs - #69254
14.0.2; outline-hide-body doesn't work when called in LaTeX-mode-hook

Previous Next

Package: auctex;

Reported by: Richard Stanton <rhstanton <at> berkeley.edu>

Date: Sun, 18 Feb 2024 19:52:02 UTC

Severity: normal

Found in version 14.0.2

Done: Ikumi Keita <ikumi <at> ikumi.que.jp>

Bug is archived. No further changes may be made.

Full log


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

From: Richard Stanton <rhstanton <at> berkeley.edu>
To: Ikumi Keita <ikumi <at> ikumi.que.jp>
Cc: 69254 <at> debbugs.gnu.org
Subject: Re: bug#69254: 14.0.2; outline-hide-body doesn't work when called in
 LaTeX-mode-hook
Date: Mon, 19 Feb 2024 08:51:01 -0800
[Message part 1 (text/plain, inline)]
That works. Thanks! 

The explanation makes perfect sense. But it also means that putting

%%% eval: (outline-hide-body)

in the file’s local variables doesn’t work. Is there a similar work-around here, so I can make the settings file-specific if I want?

Thanks!




> On Feb 19, 2024, at 1:41 AM, Ikumi Keita <ikumi <at> ikumi.que.jp> wrote:
> 
> Hi Richard,
> 
>>>>>> Richard Stanton via bug-auctex via Bug reporting list for AUCTeX <bug-auctex <at> gnu.org <mailto:bug-auctex <at> gnu.org>> writes:
>> Using Emacs 29.2 under MacOS 12.7.3, I want LaTeX files to open with
>> section bodies hidden, and just headers showing. I can get this to work
>> manually when I'm editing the file by running the command
>> "outline-hide-body". But when I run the same command as part of
>> LaTeX-mode-hook, the file opens with nothing hidden.
> 
>> Here's the relevant portion of my init.el file. The rest of it just
>> deals with setting up straight.el:
> 
>> (use-package tex :straight auctex)
> 
>> (add-hook 'LaTeX-mode-hook (lambda()
>>                             (outline-minor-mode 1)
>>                             (outline-hide-body)
>>                             ))
> 
>> Note that:
> 
>> 1) If I add other commands to this LaTeX-mode-hook, they get executed just
>> fine. it seems to be only the outline-hide-body command that isn't doing
>> what I expect.
> 
>> 2) Everything works as I hope if I don't load AUCTeX but use the
>> built-in LaTeX mode instead (with the appropriately renamed hook).
> 
>> Is this a bug, or am i missing something?
> 
> Sorry for bothering you. I think this is an outcome of the fix of
> bug#65750[1] last September.
> 
> In the fix, settings for outline mode were deferred after the parsing
> file local variables so that user's customize to section commands are
> reflected to outline related functionalities. This however means that
> `LaTeX-mode-hook' runs before outline mode settings are ready.
> 
> I haven't come up with a clean solutions yet. For a tentative
> workaround, you can use
> (add-hook 'LaTeX-mode-hook
> 	  (lambda ()
> 	    (add-hook 'find-file-hook
> 		      (lambda()
>                        (outline-minor-mode 1)
>                        (outline-hide-body))
> 		      nil t)))
> 
> instead of
> (add-hook 'LaTeX-mode-hook (lambda()
>                             (outline-minor-mode 1)
>                             (outline-hide-body)
>                             ))
> .
> 
> [1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65750 <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65750>
> 
> Regards,
> Ikumi Keita
> #StandWithUkraine #StopWarInUkraine
> #Gaza #StopMassiveKilling #CeasefireNOW

[Message part 2 (text/html, inline)]

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

Previous Next


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