From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Reitter Newsgroups: gmane.emacs.devel Subject: Re: paragraphs.el: do forward-sentence and friends not work? Date: Fri, 13 Jun 2008 15:14:31 +0100 Message-ID: References: <7BC345E9-711F-48AE-AF7F-CD3C51E96A47@gmail.com> <692473D9-ADB4-4485-ADA7-B46DF6CCCD9E@gmail.com> <87wsp87hkj.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v924) Content-Type: multipart/signed; boundary=Apple-Mail-97-983554496; micalg=sha1; protocol="application/pkcs7-signature" X-Trace: ger.gmane.org 1213366508 31111 80.91.229.12 (13 Jun 2008 14:15:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 Jun 2008 14:15:08 +0000 (UTC) To: Emacs-Devel devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 13 16:15:51 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K7A3z-0001cB-NH for ged-emacs-devel@m.gmane.org; Fri, 13 Jun 2008 16:15:36 +0200 Original-Received: from localhost ([127.0.0.1]:36605 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K7A3B-0000gC-HF for ged-emacs-devel@m.gmane.org; Fri, 13 Jun 2008 10:14:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K7A37-0000fh-Fi for emacs-devel@gnu.org; Fri, 13 Jun 2008 10:14:41 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K7A35-0000fU-Qp for emacs-devel@gnu.org; Fri, 13 Jun 2008 10:14:41 -0400 Original-Received: from [199.232.76.173] (port=56515 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K7A35-0000fR-Nv for emacs-devel@gnu.org; Fri, 13 Jun 2008 10:14:39 -0400 Original-Received: from py-out-1112.google.com ([64.233.166.177]:10549) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K7A35-0006Jt-Bs for emacs-devel@gnu.org; Fri, 13 Jun 2008 10:14:39 -0400 Original-Received: by py-out-1112.google.com with SMTP id p76so1650827pyb.1 for ; Fri, 13 Jun 2008 07:14:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:mime-version:subject:date:references :x-mailer; bh=knMdUfwzhpoucXmj8a3QGd2IeO8ymcnsSMtx2O5XUFs=; b=uhJNqXaiwjXw1uC61UNSdrM4jNWTodSZJ6XoKVG1UBPwIbBHHsAAIRkGdrdb4ArzBe b5lcUjwLHl/J7GI824VKBg5NoIalIlbx+JwmZVS4C7+4i4Q9osB2d5F+2FicR2fAAimr ffdEHWyTpfcD2CmM7nwxY+MqYDj4l7nP6a+6c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type:mime-version:subject :date:references:x-mailer; b=kNieostr/9pvsTlppQWa2kZgPeUIiamm/eK4GjrX9vBkJo7956gkpUnHaFcNdf0GP2 mGGEA7j69IMPY5fruGElqGCkp1DlA7I73h5YRSFAEsTiXZMVRUqUzzZEobjUh1jm8KIQ fZaNJLxkcYfp8sBa0+jWlHzgvq3TeJkHVKOJ0= Original-Received: by 10.114.74.1 with SMTP id w1mr3056294waa.229.1213366477038; Fri, 13 Jun 2008 07:14:37 -0700 (PDT) Original-Received: from ?192.168.1.72? ( [93.96.127.15]) by mx.google.com with ESMTPS id 66sm3084098wra.39.2008.06.13.07.14.34 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 13 Jun 2008 07:14:35 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.924) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:99098 Archived-At: --Apple-Mail-97-983554496 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit 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 "]+" "\\)" --Apple-Mail-97-983554496 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIFxDCCAn0w ggHmoAMCAQICEEfSZyInpN9bVdFPsdICbiIwDQYJKoZIhvcNAQEFBQAwYjELMAkGA1UEBhMCWkEx JTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQ ZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDTA3MTIwOTIzMDM0OFoXDTA4MTIwODIzMDM0 OFowYjEQMA4GA1UEBBMHUmVpdHRlcjEOMAwGA1UEKhMFRGF2aWQxFjAUBgNVBAMTDURhdmlkIFJl aXR0ZXIxJjAkBgkqhkiG9w0BCQEWF2RhdmlkLnJlaXR0ZXJAZ21haWwuY29tMIGfMA0GCSqGSIb3 DQEBAQUAA4GNADCBiQKBgQDIS4kZGULD+CxprkxDnEccAnZ2GQQxfn55aiAPoy5kJ+uLhelaZP4p lgx3Vq8xYK1bjsLepGYp8qzVlHsyQPb6OfvRzrUXHxlJrHME0+Lblx37PBLxGDxc5W8qfZFJpej8 Dk3LUMga8laR9CRghbALoTV3UThUSMqk1cVwTY99KQIDAQABozQwMjAiBgNVHREEGzA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