GNU bug report logs - #9553
24.0.50; Suboptimal comment filling in f90-mode

Previous Next

Package: emacs;

Reported by: Lawrence Mitchell <wence <at> gmx.li>

Date: Mon, 19 Sep 2011 16:44:05 UTC

Severity: normal

Found in version 24.0.50

Fixed in version 24.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9553 in the body.
You can then email your comments to 9553 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#9553; Package emacs. (Mon, 19 Sep 2011 16:44:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lawrence Mitchell <wence <at> gmx.li>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 19 Sep 2011 16:44:05 GMT) Full text and rfc822 format available.

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

From: Lawrence Mitchell <wence <at> gmx.li>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.50; Suboptimal comment filling in f90-mode
Date: Mon, 19 Sep 2011 17:37:30 +0100
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)




Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Tue, 20 Sep 2011 04:18:02 GMT) Full text and rfc822 format available.

Notification sent to Lawrence Mitchell <wence <at> gmx.li>:
bug acknowledged by developer. (Tue, 20 Sep 2011 04:18:02 GMT) Full text and rfc822 format available.

Message #10 received at 9553-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 9553-done <at> debbugs.gnu.org
Subject: Re: bug#9553: 24.0.50; Suboptimal comment filling in f90-mode
Date: Tue, 20 Sep 2011 00:12:22 -0400
Version: 24.1

Thank you; applied.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 18 Oct 2011 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 199 days ago.

Previous Next


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