bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

python mode M-q fills code


From: Tom Tromey
Subject: python mode M-q fills code
Date: 26 Jul 2002 19:36:09 -0600

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 address@hidden 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:
<backspace> y : <return> s e l f . l o c k . r e l 
e a s e SPC ( ) C-f <return> C-f M-\ C-x C-s <down-mouse-1> 
<mouse-1> s e l f . C-x C-s C-p C-p C-n M-b M-b <M-backspace> 
<M-backspace> <M-backspace> <M-backspace> <M-backspace> 
C-e SPC <backspace> 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 <backspace> <backspace> e m <tab> <M-backspace> 
<M-backspace> r e p o r t - m <backspace> e m <tab> 
<return>

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]