GNU logs - #7413, boring messages


Message sent to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#7413: Suggestion for adaptive-fill
Resent-From: Simon Tatham <anakin@HIDDEN>
Original-Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Resent-To: owner <at> debbugs.gnu.org
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 16 Nov 2010 10:18:02 +0000
Resent-Message-ID: <handler.7413.B.12899026354667 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 7413
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: 7413 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.12899026354667
          (code B ref -1); Tue, 16 Nov 2010 10:18:02 +0000
Received: (at submit) by debbugs.gnu.org; 16 Nov 2010 10:17:15 +0000
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1PIIbA-0001DE-01
	for submit <at> debbugs.gnu.org; Tue, 16 Nov 2010 05:17:15 -0500
Received: from eggs.gnu.org ([140.186.70.92])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <simon@HIDDEN>) id 1PIIaE-0001CQ-9m
	for submit <at> debbugs.gnu.org; Tue, 16 Nov 2010 05:16:15 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <simon@HIDDEN>) id 1PIIf2-0006dB-Hd
	for submit <at> debbugs.gnu.org; Tue, 16 Nov 2010 05:21:13 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED,
	T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.1
Received: from lists.gnu.org ([199.232.76.165]:44943)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <simon@HIDDEN>) id 1PIIf2-0006d6-Fa
	for submit <at> debbugs.gnu.org; Tue, 16 Nov 2010 05:21:12 -0500
Received: from [140.186.70.92] (port=39116 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1PIIf0-0001V8-RK
	for bug-gnu-emacs@HIDDEN; Tue, 16 Nov 2010 05:21:12 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <simon@HIDDEN>) id 1PIIez-0006cF-7a
	for bug-gnu-emacs@HIDDEN; Tue, 16 Nov 2010 05:21:10 -0500
Received: from atreus.tartarus.org ([80.252.125.10]:55053)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <simon@HIDDEN>) id 1PIIez-0006Z2-0u
	for bug-gnu-emacs@HIDDEN; Tue, 16 Nov 2010 05:21:09 -0500
Received: from simon by atreus.tartarus.org with local (Exim 4.69)
	(envelope-from <simon@HIDDEN>)
	id 1PIIes-0000Un-9N; Tue, 16 Nov 2010 10:21:02 +0000
X-Mailer: Jed/Timber v0.2
From: Simon Tatham <anakin@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Message-Id: <E1PIIes-0000Un-9N@HIDDEN>
Date: Tue, 16 Nov 2010 10:21:02 +0000
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Spam-Score: -6.6 (------)
X-Mailman-Approved-At: Tue, 16 Nov 2010 05:17:11 -0500
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.6 (------)

I'd like to suggest a small extra piece of configurability for
Emacs's adaptive fill functionality.

Adaptive fill mode is capable of filling a paragraph in a source
code file which has comment characters down the left, and replacing
them after filling:

   # This is a
   # comment.

And it can also fill a paragraph which uses '-' as a bullet
character, and automatically line up subsequent lines below the
character after the bullet rather than below the bullet:

   - Like
     this.

But one thing it won't currently _quite_ cope with is both at once:

   #  - This is a bulleted paragraph
   #    in a source comment.

If the paragraph already has more than one line, even this will
work, because the fill-context-prefix function in fill.el observes
that the second line's prefix is derived from the first by replacing
some characters with spaces, and therefore decides it's a sensible
prefix to keep using. But if the paragraph is only one line long and
needs to be broken on to multiple lines, then fill-context-prefix
cannot infer from "   #  - " that the second line's prefix should be
"   #    ", because currently its only options for handling a
one-line prefix are to use the prefix unmodified or replace the
_whole_ thing with spaces.

So my suggestion is that it would be useful to have a user-definable
function hook checked for the one-line case, perhaps called
'adaptive-fill-infer-prefix-function' or some such, which is given
the fill prefix for a one-line paragraph and returns the appropriate
prefix to use when breaking it on to a second line and beyond.

Secondarily, I suggest that a default implementation of that
function might want to consider the case where the start of the
prefix matches comment-start-skip and the remainder matches
first-line-regexp, and in that situation replace only the latter
part with spaces.

I've currently implemented similar functionality in my .emacs by
applying `defadvice' to the fill-context-prefix function, but my
feeling is that if I have to use defadvice on an internal emacs
function then it's worth at least suggesting a change so I don't
have to in future :-)

(I'll send you my defadvice-based code if you like, but it's more a
hack than a finished patch at the moment.)

Cheers,
Simon
-- 
Simon Tatham         "infinite loop _see_ loop, infinite"
<anakin@HIDDEN>     - Index, Borland Pascal Language Guide




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Simon Tatham <anakin@HIDDEN>
Subject: bug#7413: Acknowledgement (Suggestion for adaptive-fill)
Message-ID: <handler.7413.B.12899026354667.ack <at> debbugs.gnu.org>
References: <E1PIIes-0000Un-9N@HIDDEN>
X-Gnu-PR-Message: ack 7413
X-Gnu-PR-Package: emacs
Reply-To: 7413 <at> debbugs.gnu.org
Date: Tue, 16 Nov 2010 10:18:02 +0000

Thank you for filing a new bug report with GNU.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-gnu-emacs@HIDDEN

If you wish to submit further information on this problem, please
send it to 7413 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
7413: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D7413
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems



Last modified: Mon, 25 Nov 2019 12:00:02 UTC

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