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!
Hi Richard,Richard Stanton via bug-auctex via Bug reporting list for AUCTeX <bug-auctex@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 ofbug#65750[1] last September.In the fix, settings for outline mode were deferred after the parsingfile local variables so that user's customize to section commands arereflected 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 tentativeworkaround, 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=65750Regards,Ikumi Keita#StandWithUkraine #StopWarInUkraine#Gaza #StopMassiveKilling #CeasefireNOW
|