GNU bug report logs -
#65750
12.2; LaTeX-mark-section and LaTeX-section-list
Previous Next
Reported by: Janet Chen <jjchen <at> math.harvard.edu>
Date: Tue, 5 Sep 2023 02:25:02 UTC
Severity: normal
Tags: wontfix
Found in version 12.2
Done: Ikumi Keita <ikumi <at> ikumi.que.jp>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hi Janet,
>>>>> Janet Chen <jjchen <at> math.harvard.edu> writes:
> I've added a custom section to LaTeX-section-list, but LaTeX-mark-section ignores it. This may be the intended behavior, but I think it would make more sense for it to mark sections based on the entries in LaTeX-section-list.
> In case it matters, here's the buffer local value of my LaTeX-section-list:
> (("part" 0)
> ("chapter" 1)
> ("section" 2)
> ("nsection" 2)
> ("subsection" 3)
> ("subsubsection" 4)
> ("paragraph" 5)
> ("subparagraph" 6))
Sorry for inconvenience. I assume you have file local variable section
like this:
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% LaTeX-section-list: (("part" 0) ("chapter" 1) ("section" 2) ("nsection" 2) ("subsection" 3) ("subsubsection" 4) ("paragraph" 5) ("subparagraph" 6))
%%% End:
For a tentative workaround, add the following code block in your init
file (~/.emacs.d/init.el) and try it out:
(add-hook 'LaTeX-mode-hook
(lambda ()
(add-hook 'hack-local-variables-hook
(lambda ()
(setq-local outline-regexp (LaTeX-outline-regexp t))
(setq outline-heading-alist
(mapcar (lambda (x)
(cons (concat "\\" (nth 0 x)) (nth 1 x)))
LaTeX-section-list)))
nil t)))
To developers:
`LaTeX-common-initialization' sets up some variables including
`outline-regexp' and `outline-heading-alist' before `run-mode-hooks',
which is responsible for parsing and applying the file local variables.
Shouldn't we move such set-up codes after `run-mode-hooks'? (And if so,
similar argument applies for other AUCTeX major modes as well.)
Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
This bug report was last modified 1 year and 151 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.