From unknown Thu Aug 21 14:13:09 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#9553 <9553@debbugs.gnu.org> To: bug#9553 <9553@debbugs.gnu.org> Subject: Status: 24.0.50; Suboptimal comment filling in f90-mode Reply-To: bug#9553 <9553@debbugs.gnu.org> Date: Thu, 21 Aug 2025 21:13:09 +0000 retitle 9553 24.0.50; Suboptimal comment filling in f90-mode reassign 9553 emacs submitter 9553 Lawrence Mitchell severity 9553 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 19 12:43:10 2011 Received: (at submit) by debbugs.gnu.org; 19 Sep 2011 16:43:12 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R5gvy-0003dV-Gq for submit@debbugs.gnu.org; Mon, 19 Sep 2011 12:43:07 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R5gvv-0003dO-Lb for submit@debbugs.gnu.org; Mon, 19 Sep 2011 12:43:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R5gr2-0002pD-Q9 for submit@debbugs.gnu.org; Mon, 19 Sep 2011 12:38:01 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:34274) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5gr2-0002p9-O0 for submit@debbugs.gnu.org; Mon, 19 Sep 2011 12:38:00 -0400 Received: from eggs.gnu.org ([140.186.70.92]:55880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5gr1-0003Ut-Eh for bug-gnu-emacs@gnu.org; Mon, 19 Sep 2011 12:38:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R5gr0-0002oj-2W for bug-gnu-emacs@gnu.org; Mon, 19 Sep 2011 12:37:59 -0400 Received: from nougat.ucs.ed.ac.uk ([129.215.13.205]:37865) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5gqx-0002o7-NC for bug-gnu-emacs@gnu.org; Mon, 19 Sep 2011 12:37:58 -0400 Received: from lmtp1.ucs.ed.ac.uk (lmtp1.ucs.ed.ac.uk [129.215.149.64]) by nougat.ucs.ed.ac.uk (8.13.8/8.13.4) with ESMTP id p8JGbZXR000811 for ; Mon, 19 Sep 2011 17:37:40 +0100 (BST) Received: from e4300lm (e4300lm.epcc.ed.ac.uk [129.215.63.156]) (authenticated user=lmitche4 mech=PLAIN bits=0) by lmtp1.ucs.ed.ac.uk (8.13.8/8.13.7) with ESMTP id p8JGbQNx014813 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Mon, 19 Sep 2011 17:37:34 +0100 (BST) From: Lawrence Mitchell To: bug-gnu-emacs@gnu.org Subject: 24.0.50; Suboptimal comment filling in f90-mode Date: Mon, 19 Sep 2011 17:37:30 +0100 Message-ID: <87ipoo8p4l.fsf@ed.ac.uk> MIME-Version: 1.0 Content-Type: text/plain X-Edinburgh-Scanned: at nougat.ucs.ed.ac.uk with MIMEDefang 2.60, Sophie, Sophos Anti-Virus, Clam AntiVirus X-Scanned-By: MIMEDefang 2.60 on 129.215.13.205 X-Scanned-By: MIMEDefang 2.52 on 129.215.149.64 X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.8 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) If auto-fill-mode is on, when typing comments in an f90-mode buffer successive lines receive more and more whitespace indent after the comment prefix: emacs -Q C-x h C-w M-x f90-mode RET M-x auto-fill-mode RET M-: (progn (insert "!!!") (dotimes (i 20) (insert " aaaa"))) RET SPC Results in: !!! aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa !!! aaaa aaaa aaaa aaaa aaaa aaaa aaaa ^ Note extra space here Second issue. f90-find-breakpoint doesn't do the correct thing in comments. It searches backwards for f90-break-delimiters (defaulting to [-+\\*/><=,% \t]). If one of these characters happens to be at the appropriate point at the end of a line, it is broken onto the next line. This can leave (for example) a comma detached from the preceeding word on its own. In comments this reads badly. emacs -Q C-x h C-w M-x f90-mode RET M-x auto-fill-mode RET M-: (progn (insert "!!!") (dotimes (i 13) (insert " aaaa")) (insert "a, aaaa")) RET SPC Results in: !!! aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaaa !!! , aaaa ^ Hanging comma ChangeLog entry: * progmodes/f90.el (f90-find-breakpoint): Only break at whitespace inside a comment. (f90-break-line): If breaking inside comment delete all whitespace around breakpoint. Patch for both issues: diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index cdb5f2a..7d23973 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el @@ -2000,7 +2000,7 @@ is non-nil, call `f90-update-line' after inserting the continuation marker." (cond ((f90-in-string) (insert "&\n&")) ((f90-in-comment) - (delete-horizontal-space 'backwards) ; remove trailing whitespace + (delete-horizontal-space) ; remove trailing whitespace (insert "\n" (f90-get-present-comment-type))) (t (insert "&") (or no-update (f90-update-line)) @@ -2012,7 +2012,9 @@ is non-nil, call `f90-update-line' after inserting the continuation marker." (defun f90-find-breakpoint () "From `fill-column', search backward for break-delimiter." - (re-search-backward f90-break-delimiters (line-beginning-position)) + (if (f90-in-comment) + (re-search-backward "\\s-" (line-beginning-position)) + (re-search-backward f90-break-delimiters (line-beginning-position))) (if (not f90-break-before-delimiters) (forward-char (if (looking-at f90-no-break-re) 2 1)) (backward-char) From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 20 00:17:35 2011 Received: (at 9553-done) by debbugs.gnu.org; 20 Sep 2011 04:17:35 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R5rm0-0005ra-0c for submit@debbugs.gnu.org; Tue, 20 Sep 2011 00:17:33 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R5rlw-0005rR-SA for 9553-done@debbugs.gnu.org; Tue, 20 Sep 2011 00:17:30 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1R5rh0-0003Jk-JI; Tue, 20 Sep 2011 00:12:22 -0400 From: Glenn Morris To: 9553-done@debbugs.gnu.org Subject: Re: bug#9553: 24.0.50; Suboptimal comment filling in f90-mode References: <87ipoo8p4l.fsf@ed.ac.uk> X-Spook: spies Merlin mailbomb South Africa Bellcore propaganda X-Ran: ?<6o-C@+tVZy:@x5nqSi,jF?[YfR@_RRFG(Z?_ (Lawrence Mitchell's message of "Mon, 19 Sep 2011 17:37:30 +0100") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.4 (------) X-Debbugs-Envelope-To: 9553-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.4 (------) Version: 24.1 Thank you; applied. From unknown Thu Aug 21 14:13:09 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 18 Oct 2011 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator