GNU bug report logs - #56796
29.0.50; Hard newlines not respected in code comments?

Previous Next

Package: emacs;

Reported by: Visuwesh <visuweshm <at> gmail.com>

Date: Wed, 27 Jul 2022 15:50:02 UTC

Severity: wishlist

Found in version 29.0.50

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Visuwesh <visuweshm <at> gmail.com>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 56796 <at> debbugs.gnu.org
Subject: Re: bug#56796: 29.0.50; Hard newlines not respected in code comments?
Date: Thu, 28 Jul 2022 10:26:46 +0300
> From: Visuwesh <visuweshm <at> gmail.com>
> Date: Wed, 27 Jul 2022 21:19:29 +0530
> 
> Are hard newlines supposed to be respected when they are in code
> comments?

The answer is "it depends", AFAICS.

The main problem is that fill-comment-paragraph doesn't seem to honor
use-hard-newlines.  So any major mode whose fill-paragraph-function
uses that for filling comments will fail to pay attention to hard
newlines in comments.  In your scenario, if I set both
fill-paragraph-function and fill-paragraph-handle-comment to nil, hard
newlines in comments are honored as expected.

use-hard-newlines is weird: it is documented only for Enriched mode,
but that is at least incomplete, because we call functions from
fill.el high and low in many major modes, so at least some of them
inherit the use-hard-newlines-specific code when they call functions
which do.  For example, AFAICT use-hard-newlines is supported in Lisp
doc strings.

Adding Stefan to CC, who write fill-comment-paragraph.  If we want
use-hard-newlines to be supported in comments, we should modify
fill-comment-paragraph to honor it in some way, perhaps simply
deferring to fill-region in that case.




This bug report was last modified 2 years and 316 days ago.

Previous Next


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