GNU bug report logs -
#45922
27.1; Better auto-fill for strings in python-mode
Previous Next
Reported by: Акимжанчег <zelenaruta <at> gmail.com>
Date: Sat, 16 Jan 2021 22:49:02 UTC
Severity: normal
Tags: moreinfo, wontfix
Found in version 27.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 45922 <at> debbugs.gnu.org (full text, mbox):
Hello Акимжанчег
Акимжанчег <zelenaruta <at> gmail.com> writes:
> Date: Sun, 17 Jan 2021 03:45:31 +0600
> Message-ID: <875z3wd090.fsf <at> gmail.com>
> --text follows this line--
>
> 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'.
> This can be fixed with two different methods:
> 1. Adding a `+' between the strings, so that it looks like
> ```
> matrix = self.getprop("Coordinate Transformation"
> +"Matrix").split(", ")
> ```
> 2. Dividing the string to 2 separate strings:
> ```
> matrix = self.getprop("Coordinate Transformation"
> "Matrix").split(", ")
From the recepie it would seem like fill-column is set to something low.
But probably you have some indentation there prior to 'matrix = ...'?
I don't think there is something in python mode that do what you are
suggesting as of now. For curiosity, do you see this kind of support in
other editors?
nit: the 2 suggestions would loose a space in the string
This bug report was last modified 3 years and 16 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.