help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problems with auto-fill-mode


From: jai-bholeki
Subject: Re: problems with auto-fill-mode
Date: Sat, 30 Jan 2021 18:14:08 +0100

> Sent: Sunday, January 31, 2021 at 5:04 AM
> From: "moasenwood--- via Users list for the GNU Emacs text editor" 
> <help-gnu-emacs@gnu.org>
> To: help-gnu-emacs@gnu.org
> Subject: Re: problems with auto-fill-mode
>
> jai-bholeki wrote:
>
> > Does it matter which expression to call first.
> >
> >  (setq fill-column 72)
> >  (auto-fill-mode)
> >
> > or
> >
> >  (auto-fill-mode)
> >  (setq fill-column 72)
>
> No, because the mode uses that variable setting every time
> it fills.
>
> But the top version looks better and makes more sense: first
> set it up, then enable.

I would also think that setting "comment-auto-fill-only-comments"
should also be set before enable.

(setq fill-column 72)
(setq-local comment-auto-fill-only-comments t)
(auto-fill-mode)

What about add-hook for auto-fill comments for specific files?

(defun break-comments-din ()
  "Break lines when they exceed a specific character length."
  (setq-local comment-auto-fill-only-comments t))

(add-hook 'sh-mode-hook #'break-comments-din)


> --
> underground experts united
> http://user.it.uu.se/~embe8573
> https://dataswamp.org/~incal
>
>
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]