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
View this message in rfc822 format
Stefan Monnier <monnier <at> 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
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.