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

From: Lars Ingebrigtsen <[email-masked]>
Date: Sat, 07 May 2022 17:51:14 +0200

Акимжанчег <[email-masked]> writes:

> Today I was making a program in Python for myself. One of the functions
> required me to pass a long string to it, so I did that. Auto-fill-mode
> got triggered when I pressed the space bar and the string was split from
> this:
> ```
> matrix = self.getprop("Coordinate Transformation Matrix").split(", ")
> ```
> To this:
> ```
> matrix = self.getprop("Coordinate Transformation
>                                   Matrix").split(", ")
> ```
> After that, I saw `SyntaxError: EOL while scanning string literal'.

I can reproduce this in Emacs 29, too.

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?  (It seems like such an obvious thing to have, so
perhaps there's a good reason we don't have that.)

I've added Stefan to the CCs; perhaps he has some comments.

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