From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.help Subject: Re: count char in string [The Emacs Challenge Competition - round 2, with fallout] Date: Fri, 30 Oct 2020 12:36:18 +0100 Message-ID: <874kmcuerx.fsf@fastmail.fm> References: <87r1pj41wa.fsf@zoho.eu> <875z6tqh10.fsf@pmatoe> <86sg9wdinl.fsf@x201.butler.org> <86y2joas27.fsf@x201.butler.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3827"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.5.5; emacs 27.1.50 Cc: help-gnu-emacs@gnu.org To: Leo Butler Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 30 12:37:09 2020 Return-path: Envelope-to: geh-help-gnu-emacs@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 1kYSiS-0000rp-Qd for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 30 Oct 2020 12:37:08 +0100 Original-Received: from localhost ([::1]:59604 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYSiR-0001Tc-QC for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 30 Oct 2020 07:37:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37090) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYShk-0001S2-Lo for help-gnu-emacs@gnu.org; Fri, 30 Oct 2020 07:36:24 -0400 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:45005) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYShi-0001BZ-Qu for help-gnu-emacs@gnu.org; Fri, 30 Oct 2020 07:36:24 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 344BE5C01BB; Fri, 30 Oct 2020 07:36:22 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 30 Oct 2020 07:36:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= references:from:to:cc:subject:in-reply-to:date:message-id :mime-version:content-type; s=fm1; bh=Cpx+9x05wbpOSPRNZ44LGCfaSJ M9+BJP8sBs3RYytBY=; b=qYqJuUCzAtRwkM4+VPfBMTcbu2XXp6yEAR9k8RoLdX r2M8a9IM9xILS+YbBieHSAdqmo1JuSYcRVRn/hHJ7+wYIY8nY9weEGlT74YSCzpE Wxas7LMpVwsAjk//++cs2bspyCaCX1EeEPPhyssE5MVrYz3hC8hoVlnfGz2UyGVr 26y8ambBaonQv2wv7SP0ngEWDBOrXPOoCLlv6s72DxvryOeGNM4ZLiX6E0fgAo0U XafnEa00KsQvYeAiQtK8FoBRH6MiU6M+k9j85ajKuc3gP6vIn6fa6RtB6R/PUSna 9VpyGcgfUYX5rbSCrSxuSkIzVAtckMQOcDKOlwfG6B9g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=Cpx+9x 05wbpOSPRNZ44LGCfaSJM9+BJP8sBs3RYytBY=; b=F0yidz9DybarKGQvfO3Uu/ kq/1AcmmMFAA5loayF4EHmvYUY/eue3OpeAXrdxWmrDHwnIRTpgM1RkQb9TiEqic 9TaQOq3HwSNie6F7+JFTX51HBrVjPXI0BlJDn9YFcYzldI7yseyVRumb9ezWmgip RCPSUPZ/Zgq/XNKeaLaueNG6+izN17XdkT44q5YaSta0dpkwYmBGExSsdI35aTJn JN4L5tLusDoaBPE94EO1WiqH4T6Onxsl4ycJte2mWK/dYEUOHdYAzLqDTWMqroEd Eg2act47LZ3lnBwiglr11jKWJWJ7TOkl/OwuxWBJ/kXhEWhi5Mwa9i6cZFolNDVw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrleehgddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpehffgfhvffujgffkfggtgesthdtredttdertdenucfhrhhomheplfhoohhsthcu mfhrvghmvghrshcuoehjohhoshhtkhhrvghmvghrshesfhgrshhtmhgrihhlrdhfmheqne cuggftrfgrthhtvghrnhephfduffeuhfdulefhgfelueekgeduveettdduudfhfeetueeg vdevtdduudfgffefnecukfhppeelhedrledtrddvvdegrddvfeefnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhoohhsthhkrhgvmhgvrhhs sehfrghsthhmrghilhdrfhhm X-ME-Proxy: Original-Received: from Swift.fastmail.com (ip5f5ae0e9.dynamic.kabel-deutschland.de [95.90.224.233]) by mail.messagingengine.com (Postfix) with ESMTPA id 2A4743280064; Fri, 30 Oct 2020 07:36:21 -0400 (EDT) In-reply-to: <86y2joas27.fsf@x201.butler.org> Received-SPF: pass client-ip=66.111.4.29; envelope-from=joostkremers@fastmail.fm; helo=out5-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/30 06:53:04 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:124816 Archived-At: On Fri, Oct 30 2020, Leo Butler wrote: > Jean Louis writes: > >> M-x how-many > > Nice. Thank you. That beats all the solutions offered, imo. Except that the original challenge was to count characters in a string, but `how-many` counts occurrences in the current buffer. ;-) -- Joost Kremers Life has its moments