Open ppareit opened 5 years ago
That's odd. latex-extra doesn't contain a single reference to the
auto-fill-mode
variable. The only thing it does is change the function
used for filling (but it doesn't actually turn on the mode).
This could be some side-effect of your custom settings.
I had the same issue. @ppareit solution fixed it for me too.
The following worked for me (on v1.3, and I presume anything higher)
(setq latex/cleanup-do-fill nil)
Simply adding turn-off-auto-fill
to latex-extra-mode-hook
didn't fix things for me.
I think the problem is that auto-fill-function
, which is the variable which holds the state for auto-fill-mode
, is set by latex/auto-fill-function
. Instead, a local value for normal-auto-fill-function
should be set. That is for example what fortran-mode
does. The following patch works for me:
(defun latex/setup-auto-fill ()
"Set the function used to fill a paragraph to `latex/auto-fill-function'."
(interactive)
(setq-local normal-auto-fill-function 'latex/auto-fill-function)
(and auto-fill-function
(setq auto-fill-function 'latex/auto-fill-function))))
The last two lines modify auto-fill-function
in case it is alread set to another value, for example if auto-fill-mode
has been turned on before latex-mode-extra
.
I've never used auto-fill (I prefer visual-line-mode), yet enabling this mode enabled auto-fill-mode for my latex buffer. This is unexpected.
The following emacs configuration fixed the issue for me: