Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

value of autofill changes when enabling this mode #31

Open
ppareit opened this issue Jan 4, 2019 · 4 comments
Open

value of autofill changes when enabling this mode #31

ppareit opened this issue Jan 4, 2019 · 4 comments

Comments

@ppareit
Copy link

ppareit commented Jan 4, 2019

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:

(add-hook 'latex-extra-mode-hook 'turn-off-auto-fill)
@Malabarba
Copy link
Owner

Malabarba commented Jan 7, 2019 via email

@MathieuSchopfer
Copy link

MathieuSchopfer commented Jan 15, 2019

I had the same issue. @ppareit solution fixed it for me too.

@iffsid
Copy link

iffsid commented Oct 2, 2020

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.

@bernardjoseph
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants