unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Jim Porter <jporterbugs@gmail.com>
Cc: dhowells@redhat.com, Eli Zaretskii <eliz@gnu.org>,
	michael.albinus@gmx.de, npostavs@gmail.com,
	64439@debbugs.gnu.org
Subject: bug#64439: 28.2; auto-fill-mode gets turned on all over the place
Date: Tue, 11 Jul 2023 14:44:07 -0400	[thread overview]
Message-ID: <jwvv8equw5q.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <9f219125-ae2d-3683-b615-247452572eba@gmail.com> (Jim Porter's message of "Tue, 11 Jul 2023 09:07:22 -0700")

> For anyone who's interested, here's what I did to work around the bug in
> Emacs 29 and earlier:
>
> --------------------
>
> (use-package text-mode
>   :preface
>   (defun user/turn-on-auto-fill (&optional recursive)
>     "Turn on `auto-fill-mode', but fix things if it got set globally.
> See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=64439>."
>     (turn-on-auto-fill)
>     (when (default-value 'auto-fill-function)
>       (message "`auto-fill-function' got set globally; fixing it...")
>       (setq-default auto-fill-function nil)
>       (when recursive
>         (error (concat "Recursively setting the default value of "
>                        "`auto-fill-function'!")))
>       (run-with-timer 0 nil
>                       (lambda (buf)
>                         (with-current-buffer buf
>                           (user/turn-on-auto-fill)))
>                       (current-buffer))))

I suspect (i.e. don't take my word for it) a simpler workaround is to
(make-local-variable 'auto-fill-function) just before calling
`turn-on-auto-fill`.


        Stefan






  reply	other threads:[~2023-07-11 18:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-03 15:55 bug#64439: 28.2; auto-fill-mode gets turned on all over the place David Howells
2023-07-03 16:15 ` Eli Zaretskii
2023-07-03 17:48 ` David Howells
2023-07-03 18:29   ` Eli Zaretskii
2023-07-09  5:57     ` Jim Porter
2023-07-09  6:45       ` Eli Zaretskii
2023-07-09 18:00         ` Jim Porter
2023-07-10 11:59           ` Eli Zaretskii
2023-07-10 16:00             ` Jim Porter
2023-07-10 17:28               ` Michael Albinus
2023-07-10 17:28             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-10 20:57               ` Jim Porter
2023-07-10 21:54                 ` Jim Porter
2023-07-10 23:53                   ` Jim Porter
2023-07-11 11:31                     ` Eli Zaretskii
2023-07-11 16:07                       ` Jim Porter
2023-07-11 18:44                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-07-12  2:23                           ` Jim Porter
2023-07-12 12:13                             ` Eli Zaretskii
2023-07-03 18:14 ` Jim Porter

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=jwvv8equw5q.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=64439@debbugs.gnu.org \
    --cc=dhowells@redhat.com \
    --cc=eliz@gnu.org \
    --cc=jporterbugs@gmail.com \
    --cc=michael.albinus@gmx.de \
    --cc=monnier@iro.umontreal.ca \
    --cc=npostavs@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).