[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#67718: 30.0.50; prog-fill-reindent-defun vs. fill-paragraph for stri
From: |
Dmitry Gutov |
Subject: |
bug#67718: 30.0.50; prog-fill-reindent-defun vs. fill-paragraph for strings and comments |
Date: |
Sun, 10 Dec 2023 05:11:02 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 |
On 08/12/2023 23:53, Jens Schmidt wrote:
"any" prog mode
"after a string"|
This might be a good idea.
|
"on an empty line before a string"
It's not obvious to me that filling would be preferable to reindenting,
in this case.
This one could differ in a treesitter mode, I guess.
sql-mode doesn't even have <-comments, so you always have to move
point*into* a comment to get it filled. BTW, exactly like
javascript-mode, which is a bit more important, probably:
So we could look for 1-2 more different comment syntaxes, right? And
maybe string openers.
Would you like to propose a small patch?
(foo bar baz ?\|; baz bar foo)
So this goes the other direction: If you M-q here and expect the
line or surrounding function to be indented, you will get
disappointed, because the heuristics detects this as a comment
that needs to be filled.
In this case it's easy enough to understand what's going on, I think,
and move out of the string. But other suggestions welcome.