GNU bug report logs - #67718
30.0.50; prog-fill-reindent-defun vs. fill-paragraph for strings and comments

Previous Next

Package: emacs;

Reported by: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de>

Date: Fri, 8 Dec 2023 21:55:01 UTC

Severity: normal

Found in version 30.0.50

Full log


Message #8 received at 67718 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de>, 67718 <at> debbugs.gnu.org
Cc: Juri Linkov <juri <at> linkov.net>
Subject: Re: 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
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.




This bug report was last modified 1 year and 184 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.