unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Акимжанчег <zelenaruta@gmail.com>, 45922@debbugs.gnu.org
Subject: bug#45922: 27.1; Better auto-fill for strings in python-mode
Date: Sat, 07 May 2022 18:56:51 +0200	[thread overview]
Message-ID: <87h761l1rg.fsf@gnus.org> (raw)
In-Reply-To: <jwvczgp2tur.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sat, 07 May 2022 12:25:21 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> The Python auto fill basically just calls `do-auto-fill', so I wondered
>> whether there was something simple to tell that function to not consider
>> any points where ppss-string-terminator is non-nil as a break point, but
>> apparently not?
>
> `fill-nobreak-predicate`?

Ah, yes, perfect.  With this, it works like the original bug reporter
wanted:

              (setq-local fill-nobreak-predicate
              (lambda ()
                (ppss-string-terminator (syntax-ppss))))

But this reminds me that auto-fill-mode in programming modes is a bad
idea in general: Even if it doesn't chop anything inside the string,
it'll still lead to invalid code.

So I think the answer to this bug report is really -- don't use
auto-fill in python-mode, and I'm closing it as a wontfix.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2022-05-07 16:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-16 21:49 bug#45922: 27.1; Better auto-fill for strings in python-mode Акимжанчег
2021-01-17 11:58 ` Tomas Nordin
     [not found]   ` <CAJBTzO=rE4n4iZdBNv2HE=zi+_O1r=bqwFdsCku1-3VZOgqOWg@mail.gmail.com>
2021-01-17 20:18     ` Tomas Nordin
2022-05-07 15:51 ` Lars Ingebrigtsen
2022-05-07 16:25   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-07 16:56     ` Lars Ingebrigtsen [this message]
2022-05-07 17:28       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=87h761l1rg.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=45922@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=zelenaruta@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).