From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Filipp Gunbin Newsgroups: gmane.emacs.devel Subject: Re: Counting sentences in `count-words' Date: Tue, 24 May 2022 18:57:58 +0300 Message-ID: References: <87o7zsiekm.fsf@elite.giraud> <83y1yv8cdp.fsf@gnu.org> <878rquizld.fsf@elite.giraud> <83czg694ft.fsf@gnu.org> <87y1ytd9if.fsf@elite.giraud> <87r14lh5lr.fsf@gmail.com> <87mtf8acl5.fsf@elite.giraud> <83bkvo7bkf.fsf@gnu.org> <874k1go68k.fsf@gnus.org> <878rqsa144.fsf@elite.giraud> <83zgj85spj.fsf@gnu.org> <871qwk9ykq.fsf@elite.giraud> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13122"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) Cc: Eli Zaretskii , larsi@gnus.org, emacs-devel@gnu.org To: Manuel Giraud Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 24 18:48:07 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ntXhV-00035e-Bo for ged-emacs-devel@m.gmane-mx.org; Tue, 24 May 2022 18:48:06 +0200 Original-Received: from localhost ([::1]:49980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntXhS-0005a4-OW for ged-emacs-devel@m.gmane-mx.org; Tue, 24 May 2022 12:48:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47252) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntWv7-0000PI-G2 for emacs-devel@gnu.org; Tue, 24 May 2022 11:58:05 -0400 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:56203) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntWv5-0008A2-3T; Tue, 24 May 2022 11:58:05 -0400 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id C698E5C0368; Tue, 24 May 2022 11:58:01 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 24 May 2022 11:58:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1653407881; x=1653494281; bh=eAWESD/6yT m29y1SfPNEBfM+0pXm/DVO0ePICEEqIzQ=; b=kGLUTR/p8btHPGAm+yOA/59KFe II4zT87nefWUqUQjN5gVWQompeEp0mI6zxidTrjGCe+MuTUx3qV29yK9oeU5E8F8 WhxIaxRt9rRhedJzcIASX5G8cyrI7zlRZZgJSMBulXBfWqInsBmYAb3OP7Dvw4hZ Ag/jx8zym4OhHgafvldtAdMc8oQ4xnCYu+SzgZ5g2Qh/cTAdx8wQZptZkmbKI7Z8 MSuVowX9sMdONB5Rl4bdzTzdoKia5GeiGf4uN/b4O0UIf+wK8bKsuwRNnh42HELo 5cO5iElyLf83vFcOaUoBXrMX/IFbBqSc7MWdwl4zXOiZtRD3blfBFYbukGjw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1653407881; x=1653494281; bh=eAWESD/6yTm29y1SfPNEBfM+0pXm /DVO0ePICEEqIzQ=; b=Zrbh3e8a8d3tb3+0pXbnd0yvgfY30/VEzG4AQhs7+8Fo ldguFiS1fjf2ELxg6v2rjWBo0zC5xhtYFCT5ApEzM/0XOvh0jqm0BxQiyX4NIqJS jZIW4z6ZVkvNPTtVnLJ5E5TIIRPiz6wV9lT3WzPrfegckv5yu8tTZO7HqdwOckEy J5RuKLkWjlsbCBO0mEpJhhjZNYFHkMCJcTQmpw+GKY4S+n5WSltOotF7F199T9Pg H04lulcUZ7mGClArodu+2g/viiwzD8dYNNN1BtjajQfSknRVFR0q63ZOUUdyEN/s aHO5Hqzw/9aMz4oyhzkvmZMEz5bRhbyx44hFX959HQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrjeefgdelhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufgjfhgffffkgggtsehttdertddtredtnecuhfhrohhmpefhihhlihhp phcuifhunhgsihhnuceofhhguhhnsghinhesfhgrshhtmhgrihhlrdhfmheqnecuggftrf grthhtvghrnhepfffhjeevieeiiedutefgheffleeiveeffeeftdekleehledufeeuuedu heevieffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epfhhguhhnsghinhesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Feedback-ID: id48c41f1:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 24 May 2022 11:58:00 -0400 (EDT) In-Reply-To: <871qwk9ykq.fsf@elite.giraud> (Manuel Giraud's message of "Mon, 23 May 2022 15:18:45 +0200") Mail-Followup-To: Manuel Giraud , Eli Zaretskii , larsi@gnus.org, emacs-devel@gnu.org Received-SPF: pass client-ip=66.111.4.27; envelope-from=fgunbin@fastmail.fm; helo=out3-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:290199 Archived-At: On 23/05/2022 15:18 +0200, Manuel Giraud wrote: > Eli Zaretskii writes: > >> It may be better to move count-sentences to paragraphs.el. > > Ok. Here is a new version of the patch. > With just a single newline in file, (count-sentences (point-min) (point-max)) loops indefinitely. I guess there're two options for safe movement: - Either rely on what movement function returns - in this case forward-sentence doesn't specify return value, so no luck - Or track the point yourself, and check whether you've moved. I think you should do this here. Filipp