unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: jai-bholeki@gmx.com
To: moasenwood@zoho.eu
Cc: help-gnu-emacs@gnu.org
Subject: Re: problems with auto-fill-mode
Date: Sat, 30 Jan 2021 18:14:08 +0100	[thread overview]
Message-ID: <trinity-d1b90a41-0183-4975-8be4-77bf92dc1164-1612026848312@3c-app-mailcom-bs16> (raw)
In-Reply-To: <87im7emk4w.fsf@zoho.eu>


> 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	other threads:[~2021-01-30 17:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-30 16:36 problems with auto-fill-mode jai-bholeki
2021-01-30 16:54 ` jai-bholeki
2021-01-30 17:04   ` moasenwood--- via Users list for the GNU Emacs text editor
2021-01-30 17:14     ` jai-bholeki [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=trinity-d1b90a41-0183-4975-8be4-77bf92dc1164-1612026848312@3c-app-mailcom-bs16 \
    --to=jai-bholeki@gmx.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=moasenwood@zoho.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).