From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Tom Tromey Newsgroups: gmane.emacs.bugs Subject: python mode M-q fills code Date: 26 Jul 2002 19:36:09 -0600 Sender: bug-gnu-emacs-admin@gnu.org Message-ID: <87n0se2bqu.fsf@fleche.redhat.com> Reply-To: tromey@redhat.com NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1027733584 2240 127.0.0.1 (27 Jul 2002 01:33:04 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 27 Jul 2002 01:33:04 +0000 (UTC) Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17YGS4-0000Zl-00 for ; Sat, 27 Jul 2002 03:33:00 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17YGSO-0002Sp-00; Fri, 26 Jul 2002 21:33:20 -0400 Original-Received: from mail.peakpeak.com ([207.174.178.17] helo=gash2.peakpeak.com) by fencepost.gnu.org with smtp (Exim 3.35 #1 (Debian)) id 17YGR9-0002Mo-00 for ; Fri, 26 Jul 2002 21:32:04 -0400 Original-Received: from fleche.redhat.com (ta0199.peakpeak.com [204.144.244.199]) by gash2.peakpeak.com (8.9.3/8.9.3) with ESMTP id TAA19397; Fri, 26 Jul 2002 19:32:00 -0600 Original-Received: by fleche.redhat.com (Postfix, from userid 1000) id 38A984F828F; Fri, 26 Jul 2002 19:36:09 -0600 (MDT) Original-To: bug-gnu-emacs@gnu.org X-Attribution: Tom X-Zippy: I'm shaving!! I'M SHAVING!! Original-Lines: 92 Errors-To: bug-gnu-emacs-admin@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.bugs:2936 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:2936 This bug report will be sent to the Free Software Foundation, not to your local site managers! Please write in English, because the Emacs maintainers do not have translators to read other languages for them. Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list, and to the gnu.emacs.bug news group. In GNU Emacs 21.2.1 (i386-redhat-linux-gnu, X toolkit, Xaw3d scroll bars) of 2002-04-08 on porky.devel.redhat.com configured using `configure i386-redhat-linux --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --with-gcc --with-pop --with-sound' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.iso885915 locale-coding-system: iso-latin-9 default-enable-multibyte-characters: nil Please describe exactly what actions triggered the bug and the precise symptoms of the bug: I'd like it if M-q consistently and usefully filled comments across all programming modes. Right now in Python mode it does not. Here is how to see the problem: Open a new Python buffer. C-x C-f /tmp/q.py Enter a comment and then some code, like this: # This is a comment. # This is the second line of the comment. class q: Now move point to the first line and type M-q. I see this result: # This is a comment. This is the second line of the comment. class # q: I would much prefer to see this result: # This is a comment. This is the second line of the comment. class q: I can accomplish this by temporarily adding an empty line after the command, filling, and then removing the empty line. However, this is a lot of work. I think it would make sense if filling worked this way automatically in programming modes. The idea is that if point is in a comment, then the boundaries of the comment should be found and filled. (Perhaps this is already the standard. I haven't kept up with developments in this area.) I note that perl-mode also has this same problem. tcl-mode, however, does not. As a further refinement, it would be nice if paragraph boundaries in comments were respected. For instance filling would stop at a blank line within the comment. Recent input: y : s e l f . l o c k . r e l e a s e SPC ( ) C-f C-f M-\ C-x C-s s e l f . C-x C-s C-p C-p C-n M-b M-b C-e SPC M-q C-/ C-o C-a C-p C-p C-o C-n M-q C-p C-k M-} C-k C-x C-s C-h k M-q C-x 1 M-x s e n d - b u e m r e p o r t - m e m Recent messages: call-interactively: End of buffer Wrote /home/tromey/projects/build/Build/File.py Mark set Closes block: ...try: call-interactively: End of buffer [2 times] Wrote /home/tromey/projects/build/Build/File.py [2 times] Undo! Wrote /home/tromey/projects/build/Build/File.py Type C-x 1 to remove help window. C-M-v to scroll the help. Loading emacsbug...done Tom