all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tom Tromey <tromey@redhat.com>
Subject: python mode M-q fills code
Date: 26 Jul 2002 19:36:09 -0600	[thread overview]
Message-ID: <87n0se2bqu.fsf@fleche.redhat.com> (raw)

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:
<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	other threads:[~2002-07-27  1:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-27  1:36 Tom Tromey [this message]
2002-07-28  2:42 ` python mode M-q fills code Richard Stallman
2002-08-12 22:17   ` Tom Tromey
2002-08-13 20:49     ` Alex Schroeder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87n0se2bqu.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.