all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#5437: C-q reformat and Autofill error
@ 2010-01-21 16:50 Jayson Williams
  2010-01-22 16:41 ` Chong Yidong
  0 siblings, 1 reply; 2+ messages in thread
From: Jayson Williams @ 2010-01-21 16:50 UTC (permalink / raw
  To: bug-gnu-emacs

Hi,

I am using GNU Emacs 23.1.50.1 (i486-pc-linux-gnu, GTK+ Version
2.18.0) of 2009-09-27 on palmer, modified by Debian.

I believe I have found a minor bug in how M-q and auto-fill-mode
reformat certain lines.

In the following scenario, when in auto-fill-mode, and where multiple
lines of text are typed that trigger auto fill (for example)

The quick brown fox jumped over the lazy dogs back. The quick brown
fox jumped over the lazy dogs back. The quick brown fox jumped over
the lazy dogs back. The quick brown fox jumped over the lazy dogs
back.

When I edit the beginning of the first line with an "-" character, and
reformat using M-q, I expected all the lines to be indented, like
below.

original text edited, and before M-q:

- The quick brown fox jumped over the lazy dogs back. The quick brown
fox jumped over the lazy dogs back. The quick brown fox jumped over
the lazy dogs back. The quick brown fox jumped over the lazy dogs
back.

after M-q

- The quick brown fox jumped over the lazy dogs back. The quick brown
  fox jumped over the lazy dogs back. The quick brown fox jumped over
  the lazy dogs back. The quick brown fox jumped over the lazy dogs
  back.

Instead, after adding the '-' at the beginning, and reformatting with
M-q, what I get is normal wrapping of the text that looks like this.

- The quick brown fox jumped over the lazy dogs back. The quick brown
fox jumped over the lazy dogs back. The quick brown fox jumped over
the lazy dogs back. The quick brown fox jumped over the lazy dogs
back.

This appears to be a bug, because it only seems to happens when the
first line of the text is edited after the fact. If I include the '-'
character when I first start typing the multiple lines, I get the
indented wrapping that I expected. Additionally if I join the lines
back together, and then type M-q, I get the expected indented
wrapping.

Hope that made enough sense. Please let me know if I can clarify any
further, or if this is in fact not a bug.

VR
Jayson







^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#5437: C-q reformat and Autofill error
  2010-01-21 16:50 bug#5437: C-q reformat and Autofill error Jayson Williams
@ 2010-01-22 16:41 ` Chong Yidong
  0 siblings, 0 replies; 2+ messages in thread
From: Chong Yidong @ 2010-01-22 16:41 UTC (permalink / raw
  To: Jayson Williams; +Cc: 5437

> When I edit the beginning of the first line with an "-" character, and
> reformat using M-q, I expected all the lines to be indented
>
> Instead, after adding the '-' at the beginning, and reformatting with
> M-q, what I get is normal wrapping of the text
>
> This appears to be a bug, because it only seems to happens when the
> first line of the text is edited after the fact. If I include the '-'
> character when I first start typing the multiple lines, I get the
> indented wrapping that I expected. Additionally if I join the lines
> back together, and then type M-q, I get the expected indented
> wrapping.

This is not a bug, it's part of the indentation logic.  Emacs has no way
of knowing whether you intend to indent like this:

- foo goo...
bar baz...

or like this:

- foo goo...
  bar baz...

Clearly, each indentation could be valid under different circumstances,
and Emacs must not impose one single choice when M-q is typed.

So, if you start out with a long line that is not already indented, it
will try option 2.  But if you start out with either choice, it will
stick with that choice.






^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-22 16:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-21 16:50 bug#5437: C-q reformat and Autofill error Jayson Williams
2010-01-22 16:41 ` Chong Yidong

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.