From: David Reitter <david.reitter@gmail.com>
To: Emacs-Devel devel <emacs-devel@gnu.org>
Subject: Re: paragraphs.el: do forward-sentence and friends not work?
Date: Fri, 13 Jun 2008 15:14:31 +0100 [thread overview]
Message-ID: <A3CE6A34-758B-4BC8-93AA-3F3131A437ED@gmail.com> (raw)
In-Reply-To: <jwvzlu3ob07.fsf-monnier+emacs@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 2877 bytes --]
On 14 Feb 2008, at 14:43, Stefan Monnier wrote:
>>> Using two spaces after end of sentence enables Emacs to distinguish
>>> between periods that end sentences and periods for abbreviations.
>>> That is why it should be the default.
>
>> We can improve this to make it work without depending on the double-
>> space.
>
> But the period-single-space vs period-double-space distinction
> allows us
> to get it right 100% in many more languages than just English.
>
>
> Stefan "Who switched to non-French spacing even when writing
> French"
Following up on this discussion: one could arrive at the solution
below, which does NOT change the default of `sentence-end-double-
space' (it is t), but introduces a customization variable that allows
users to configure the behavior for recognition only.
By default it is nil, which allows Emacs to recognize sentence ends
even if the period is followed by only one space, as is common in many
languages.
Would this have ill effects? Does `fill-nobreak-p' (in fill.el) need
to respect this variable as well?
*** lisp/textmodes/paragraphs.el 17 Apr 2008 10:52:44 +0100 1.87.2.4
--- lisp/textmodes/paragraphs.el 13 Jun 2008 15:04:21 +0100
***************
*** 130,135 ****
--- 130,148 ----
:group 'fill)
;;;###autoload(put 'sentence-end-double-space 'safe-local-variable
'booleanp)
+ (defcustom sentence-end-double-space-for-recognition nil
+ "Non-nil means a single space does not end a sentence.
+ This is relevant for the recognition of sentence ends. See also
+ `sentence-end-without-period' and `colon-double-space'. If non-nil,
+ the value of `sentence-end-double-space' is used.
+
+ This value is used by the function `sentence-end' to construct the
+ regexp describing the end of a sentence, when the value of the
variable
+ `sentence-end' is nil. See Info node `(elisp)Standard Regexps'."
+ :type 'boolean
+ :group 'fill)
+ ;;;###autoload(put 'sentence-end-double-space-for-recognition 'safe-
local-variable 'booleanp)
+
(defcustom sentence-end-without-period nil
"Non-nil means a sentence will end without a period.
For example, a sentence in Thai text ends with double space but
***************
*** 188,194 ****
(concat (if sentence-end-without-period "\\w \\|")
"\\("
sentence-end-base
! (if sentence-end-double-space
"\\($\\| $\\|\t\\| \\)" "\\($\\|[\t ]\\)")
"\\|[" sentence-end-without-space "]+"
"\\)"
--- 201,208 ----
(concat (if sentence-end-without-period "\\w \\|")
"\\("
sentence-end-base
! (if (and sentence-end-double-space
! sentence-end-double-space-for-recognition)
"\\($\\| $\\|\t\\| \\)" "\\($\\|[\t ]\\)")
"\\|[" sentence-end-without-space "]+"
"\\)"
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2193 bytes --]
next prev parent reply other threads:[~2008-06-13 14:14 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-13 17:08 paragraphs.el: do forward-sentence and friends not work? David Reitter
2008-02-13 17:27 ` Andreas Schwab
2008-02-13 17:32 ` David Reitter
2008-02-13 17:36 ` Bastien
2008-02-13 20:00 ` Stephen J. Turnbull
2008-02-14 4:42 ` Richard Stallman
2008-02-14 9:45 ` David Reitter
2008-02-14 14:22 ` Robert J. Chassell
2008-02-14 14:43 ` Stefan Monnier
2008-02-14 15:52 ` David Reitter
2008-02-14 16:04 ` Miles Bader
2008-02-15 5:48 ` Jonathan Rockway
2008-06-13 14:14 ` David Reitter [this message]
2008-02-15 0:02 ` Richard Stallman
2008-02-14 9:10 ` David Reitter
2008-02-14 9:22 ` Miles Bader
2008-02-14 9:46 ` David Reitter
2008-02-14 10:07 ` Miles Bader
2008-02-14 10:44 ` Stephen J. Turnbull
2008-02-14 12:27 ` David Reitter
2008-02-14 22:25 ` Stephen J. Turnbull
2008-02-13 20:36 ` Stefan Monnier
2008-02-13 20:52 ` Thorsten Bonow
2008-02-13 23:06 ` Miles Bader
2008-02-14 2:18 ` Robert J. Chassell
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=A3CE6A34-758B-4BC8-93AA-3F3131A437ED@gmail.com \
--to=david.reitter@gmail.com \
--cc=emacs-devel@gnu.org \
/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.