unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Re: line adjustment at the end of a sentence
@ 2012-09-26 10:56 T.F. Torrey
  2012-09-26 12:00 ` Tom Kramer
       [not found] ` <mailman.9790.1348681903.855.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 32+ messages in thread
From: T.F. Torrey @ 2012-09-26 10:56 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: Tom Kramer

Hello Tom,

This same behavior caused me confusion a while back, and it took me a
bit to track it down and get my head around it.  The behavior comes from
Emacs's idea about what ends a sentence.

By default, Emacs expects two spaces after a punctuation mark ending a
sentence.  This comes from the variable sentence-end-double-space, which
has a default value of t, meaning two spaces will appear after the end
of a sentence.  If you set it to nil, you will probably get behavior
closer to what you expect.

In more detail, if I understand it correctly, by default, Emacs expects
punctuation ending sentences to be followed by two spaces or a carriage
return.  When this is the case, using a single space after an
abbreviation such as "Dr. Watson" is significant, because it isn't the
end of a sentence.  It would be wrong to fill the paragraph such that
two spaces appear between "Dr." and "Watson", so the single space must
be preserved.  The line can not be broken between "Dr." and "Watson",
because that would lose the information that it was originally a single
space, and adding text and re-filling the paragraph might put both on
the same line erroneously as two sentences as "Dr.  Watson".  So, in
your example, and in my own experience, Emacs treats the space as
unbreakable, even if the line extends beyond what looks reasonable.  It
may be a bug that it does not break the line before the "Dr." (in this
example), but it could just as easily be a deliberate design.

If you change sentence-end-double-space to nil, then the single space
between "Dr." and "Watson" is no longer significant, and Emacs will
break the line between them just fine, because reconnecting them with a
single space between would never be wrong.

As others have noted, using two spaces after periods will also work
well, and has other benefits.  Once you understand what's going on,
though, it's kind of cool.

Best regards,
Terry
-- 
T.F. Torrey

> From: Eli Zaretskii <eliz@gnu.org>
> To: help-gnu-emacs@gnu.org
> Date: Tue, 25 Sep 2012 23:50:37 +0200
> Subject: Re: line adjustment at the end of a sentence
> Message: 8
>
>> Date: Tue, 25 Sep 2012 17:25:47 -0400
>> From: Tom Kramer <kramer@cme.nist.gov>
>> 
>> 1. Start emacs from a command window by typing emacs -Q test
>> 
>> 2. Type the following, which will wrap around as you type.
>> 
>> 9/19/12 Worked 9.5 hours. Spent 1 hour misc. Spent 0.5 hour RTFI. 
>> Watched Mitutoyo vid of IMTS QIF demo. Exchanged email messages with Bob 
>> Brown.
>> 
>> 3. Type Esc-q The paragraph is set on three lines and looks like the 
>> following:
>> 
>> 9/19/12 Worked 9.5 hours. Spent 1 hour misc. Spent 0.5 hour
>> RTFI. Watched Mitutoyo vid of IMTS QIF demo. Exchanged email messages
>> with Bob Brown.
>> 
>> Note that the second line is much longer (69 characters) than the first 
>> (59 characters), and there is plenty of space for RTFI to fit on the 
>> first line.
>> 
>> That demonstrates the problem.
>
> Not reproducible here.  I get this instead:
>
> 9/19/12 Worked 9.5 hours. Spent 1 hour misc. Spent 0.5 hour RTFI.
> Watched Mitutoyo vid of IMTS QIF demo. Exchanged email messages
> with Bob Brown.
>
> which is quite reasonable.
>
> Something else is at work here, or there's something in your recipe
> that you didn't tell us.



^ permalink raw reply	[flat|nested] 32+ messages in thread
[parent not found: <mailman.9731.1348608357.855.help-gnu-emacs@gnu.org>]
* line adjustment at the end of a sentence
@ 2012-09-25 21:25 Tom Kramer
  2012-09-25 21:50 ` Eli Zaretskii
  2012-09-25 23:28 ` Peter Dyballa
  0 siblings, 2 replies; 32+ messages in thread
From: Tom Kramer @ 2012-09-25 21:25 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1435 bytes --]

Hello emacs help -

I understand from Óscar Fuentes that Eli Zaretskii posted a reply to my 
earlier email on this subject suggesting that I provide a recipe for 
recreating the problem. Here is a recipe and some discussion. If anyone 
writes a reply to this email, I hope s/he will send me a copy. I am not 
on the regular mailing list for emacs help. Thanks.

1. Start emacs from a command window by typing emacs -Q test

2. Type the following, which will wrap around as you type.

9/19/12 Worked 9.5 hours. Spent 1 hour misc. Spent 0.5 hour RTFI. 
Watched Mitutoyo vid of IMTS QIF demo. Exchanged email messages with Bob 
Brown.

3. Type Esc-q The paragraph is set on three lines and looks like the 
following:

9/19/12 Worked 9.5 hours. Spent 1 hour misc. Spent 0.5 hour
RTFI. Watched Mitutoyo vid of IMTS QIF demo. Exchanged email messages
with Bob Brown.

Note that the second line is much longer (69 characters) than the first 
(59 characters), and there is plenty of space for RTFI to fit on the 
first line.

That demonstrates the problem. To check that the problem is caused by 
the end of the line, copy the word
messages from the end of the second line to the end of the first line 
and type Esc-q again. Note that nothing
changes even though the first line is now much longer than it would have 
been if it ended with RTFI.

I am using emacs on Linux, but I have had exactly the same problem with 
other OSs.

Tom Kramer


[-- Attachment #2: Type: text/html, Size: 2337 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread
* line adjustment at the end of a sentence
@ 2012-09-25 12:54 Tom Kramer
  2012-09-25 16:29 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 32+ messages in thread
From: Tom Kramer @ 2012-09-25 12:54 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1510 bytes --]

Hello emacs help -

I have had the following simple problem with emacs for over two decades, 
so I figured it was time to ask if there is a solution. The problem is: 
when a sentence ends at the end of a line, if the paragraph containing 
the sentence is adjusted by hitting Esc-Q, the last word of the sentence 
is moved to the next line, so that extra white space appears. Here is an 
example. It is set in fixed width font as I am typing. If you do not get 
it in fixed-width font, reset it in fixed-width font.

I type the following and then I use Esc-Q to reset the paragraph.

9/19/12 Worked 9.5 hours. Spent 1 hour misc. Spent 0.5 hour RTFI. Watched
Mitutoyo vid of IMTS QIF demo. Exchanged email messages with Bob Brown.

The paragraph is reset automatically as follows. The word Brown has been 
moved from the
end of the second line to the beginning of a third line.

9/19/12 Worked 9.5 hours. Spent 1 hour misc. Spent 0.5 hour RTFI. Watched
Mitutoyo vid of IMTS QIF demo. Exchanged email messages with Bob
Brown.

This makes no sense. The word Brown fits easily within the right fill 
column (75 in Text Fill mode). The reset paragraph looks terrible. I get 
annoyed and move Brown back to the end of the second line. I have just 
wasted fifteen seconds or so. This happens about once each working day. 
A quarter minute for 200 days a year for 20 years is 1000 minutes I have 
wasted on this dumb problem.

Is there a way to get emacs to stop doing that? Thanks.

Tom Kramer
kramer@cme.nist.gov





[-- Attachment #2: Type: text/html, Size: 2269 bytes --]

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

end of thread, other threads:[~2012-12-02  3:03 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-26 10:56 line adjustment at the end of a sentence T.F. Torrey
2012-09-26 12:00 ` Tom Kramer
2012-09-26 17:12   ` Ludwig, Mark
2012-09-26 17:44     ` Yuri Khan
2012-09-26 19:23       ` Eli Zaretskii
2012-09-26 17:50     ` Drew Adams
     [not found]     ` <mailman.9789.1348681498.855.help-gnu-emacs@gnu.org>
2012-09-27  0:34       ` Stefan Monnier
2012-09-27  5:26         ` Drew Adams
2012-09-27 12:19           ` Stefan Monnier
2012-09-27 14:57             ` Drew Adams
2012-09-27 16:37               ` Stefan Monnier
2012-09-27 17:00                 ` Drew Adams
     [not found]                 ` <mailman.9862.1348765244.855.help-gnu-emacs@gnu.org>
2012-09-27 18:04                   ` Stefan Monnier
     [not found] ` <mailman.9790.1348681903.855.help-gnu-emacs@gnu.org>
2012-09-26 20:35   ` Barry Margolin
2012-09-27  3:21     ` Eric Abrahamsen
2012-09-29 14:09       ` Sivaram Neelakantan
     [not found]       ` <mailman.9978.1348927764.855.help-gnu-emacs@gnu.org>
2012-09-29 17:13         ` Stefan Monnier
2012-10-14  1:21           ` David Combs
2012-10-14 15:58             ` Joe Fineman
2012-10-14 18:13               ` PJ Weisberg
     [not found]               ` <mailman.10975.1350238417.855.help-gnu-emacs@gnu.org>
2012-11-25  1:05                 ` David Combs
2012-12-02  3:03                   ` J. David Boyd
2012-10-19 22:03             ` Stefan Monnier
     [not found] <mailman.9731.1348608357.855.help-gnu-emacs@gnu.org>
2012-09-25 21:41 ` Pascal J. Bourguignon
  -- strict thread matches above, loose matches on Subject: below --
2012-09-25 21:25 Tom Kramer
2012-09-25 21:50 ` Eli Zaretskii
2012-09-25 23:28 ` Peter Dyballa
2012-09-25 12:54 Tom Kramer
2012-09-25 16:29 ` Eli Zaretskii
2012-09-25 18:40 ` Óscar Fuentes
2012-09-25 21:18 ` Pascal J. Bourguignon
2012-09-25 21:53   ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).