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

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

bug#45922: 27.1; Better auto-fill for strings in python-mode


From: Lars Ingebrigtsen
Subject: bug#45922: 27.1; Better auto-fill for strings in python-mode
Date: Sat, 07 May 2022 18:56:51 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

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 via email to

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