all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: tftorrey@tftorrey.com (T.F. Torrey)
To: help-gnu-emacs@gnu.org
Cc: Tom Kramer <kramer@cme.nist.gov>
Subject: Re: line adjustment at the end of a sentence
Date: Wed, 26 Sep 2012 03:56:44 -0700	[thread overview]
Message-ID: <87pq59gihf.fsf@lapcat.tftorrey.com> (raw)
In-Reply-To: "eliz\@gnu.org"

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.



             reply	other threads:[~2012-09-26 10:56 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-26 10:56 T.F. Torrey [this message]
2012-09-26 12:00 ` line adjustment at the end of a sentence 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

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=87pq59gihf.fsf@lapcat.tftorrey.com \
    --to=tftorrey@tftorrey.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=kramer@cme.nist.gov \
    /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.