From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Lack of tooling slowing down contributions Date: Wed, 19 Jun 2019 00:29:51 +0300 Organization: LINKOV.NET Message-ID: <87a7eezink.fsf@mail.linkov.net> References: <87ftocy5uv.fsf@cassou.me> <87a7ehea7w.fsf@mail.linkov.net> <292af6adcd90b805f8eb1c0241170221@webmail.orcon.net.nz> <87ef3ramp0.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="112400"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: Damien Cassou , Noam Postavsky , Emacs developers To: Phil Sainty Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 18 23:34:42 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hdLkW-000T4n-Qu for ged-emacs-devel@m.gmane.org; Tue, 18 Jun 2019 23:34:41 +0200 Original-Received: from localhost ([::1]:33626 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdLkV-00026n-RQ for ged-emacs-devel@m.gmane.org; Tue, 18 Jun 2019 17:34:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39758) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdLjO-00026g-Mp for emacs-devel@gnu.org; Tue, 18 Jun 2019 17:33:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdLjN-0005Ax-6e for emacs-devel@gnu.org; Tue, 18 Jun 2019 17:33:30 -0400 Original-Received: from aye.elm.relay.mailchannels.net ([23.83.212.6]:56848) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hdLjM-00057w-OO for emacs-devel@gnu.org; Tue, 18 Jun 2019 17:33:29 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 1B81A5027FB; Tue, 18 Jun 2019 21:33:27 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a65.g.dreamhost.com (100-96-38-146.trex.outbound.svc.cluster.local [100.96.38.146]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 74501502662; Tue, 18 Jun 2019 21:33:26 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a65.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Tue, 18 Jun 2019 21:33:26 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Bored-Wiry: 4a9c98c0772747c5_1560893606826_3325372499 X-MC-Loop-Signature: 1560893606826:3950970753 X-MC-Ingress-Time: 1560893606825 Original-Received: from pdx1-sub0-mail-a65.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a65.g.dreamhost.com (Postfix) with ESMTP id 1923482984; Tue, 18 Jun 2019 14:33:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=linkov.net; bh=aeB43/ 54ffCgT3tMJGILmKHcpB0=; b=ALZ+XUOoWRwE99CZ66vUYRMPw9tbsh09j2AjbJ WnK0Tgw9m2HII334eMhG2tuUMzhjuaS3QQuS+DMiDsp5kmzLx5LBpUZoi88ry0Vr jYvCPUPM/RMhRFuhSl59N6MB3cxsA6rP+EykOFnU72hPHFr9ptd/hwGiD4ZuhW04 g9uyc= Original-Received: from mail.jurta.org (m91-129-109-209.cust.tele2.ee [91.129.109.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a65.g.dreamhost.com (Postfix) with ESMTPSA id 2690582989; Tue, 18 Jun 2019 14:33:14 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a65 In-Reply-To: <87ef3ramp0.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 18 Jun 2019 00:19:31 +0300") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddrtddtgddufeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgfgsehtkeertddtreejnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtledrvddtleenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdelrddvtdelpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepphhsrghinhhthiesohhrtghonhdrnhgvthdrnhiinecuvehluhhsthgvrhfuihiivgeptd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 23.83.212.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:237871 Archived-At: >> E.g. for example, should not become "E.g. for example". >> >> P. G. Wodehouse should not end up as "P. G. Wodehouse". >> >> Prof. Moriarty should not end up as "Prof. Moriarty" > > I believe it's possible to find some simple heuristics (maybe even > just regexp-based) that would cover more than 90% of cases. A simple heuristics relying on the sentence length would cover most cases= . Here is experimental code that works surprisingly well for adding double = space to sentences longer than 5 letters: (defun canonically-double-space-region (beg end) (interactive "*r") (canonically-space-region beg end) (unless (markerp end) (setq end (copy-marker end t))) (let* ((sentence-end-double-space nil) ; to get right regexp below (end-spc-re (concat "\\([^.,]\\{5,\\}\\)\\(?:" (sentence-end) = "\\)"))) (save-excursion (goto-char beg) (while (and (< (point) end) (re-search-forward end-spc-re end t)) (unless (or (>=3D (point) end) (looking-back "[[:space:]]\\{2\\}\\|\n")) (insert " ")))))) (advice-add 'fill-paragraph :before (lambda (&rest _args) (when (use-region-p) (canonically-double-space-region (region-beginning) (region-end)))) '((name . fill-paragraph-double-space))) It's one drawback is that it doesn't handle such false negatives as short sentences. Alas. But such cases are extremely rare. False positives such as long abbreviations are rare too. BTW, I tried to replace the regexp above with =E2=80=98rx=E2=80=99 that i= s easier to read: (rx (group (>=3D 5 (not (any " .")))) (group (regexp (sentence-end)))) but it fails. Not sure if this will be fixed in bug#36237.