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: Is there equivalent internal function for this list-has-elements? Date: Sun, 18 Oct 2020 23:21:05 +0200 Message-ID: <87k0vnw7r2.fsf@fastmail.fm> References: <20201018205850.GA13219@tuxteam.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15254"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.5.5; emacs 27.1.50 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 18 23:22:34 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 1kUG8O-0003s0-L6 for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 18 Oct 2020 23:22:32 +0200 Original-Received: from localhost ([::1]:57170 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUG8N-0008WB-Nc for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 18 Oct 2020 17:22:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45560) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUG78-0007wB-Hl for help-gnu-emacs@gnu.org; Sun, 18 Oct 2020 17:21:15 -0400 Original-Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:59525) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUG75-0006a4-1m for help-gnu-emacs@gnu.org; Sun, 18 Oct 2020 17:21:14 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 3A46F60D for ; Sun, 18 Oct 2020 17:21:08 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 18 Oct 2020 17:21:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= references:from:to:subject:in-reply-to:date:message-id :mime-version:content-type; s=fm1; bh=ZulUFV1gWR7PuHNYILdjAeBVGL RMQ1QuI0Rh4IdMJCE=; b=NgfXROL3aDAQYYgLQBjFo2uQMl8EDfHC7bMupSmUd4 eLyspcl+uLpkhtsMisOXv1rbUZqSRHI206r2OMj8sWVFv8QhVd36JEJ0LRchhfEF 5IovKRta6LqG/OWUpBkLuVxSkJlrd+39IAT1MR3LeNCRT1C0F5RreJPtXhLQiR/Q D3uSrId2pjAKY6Sgx/vFOKVL03J1OO8lTT067dJXJTtxJynecjeJnfCYbzhAy8GL dctcxx3eXwuTa8GlGpKGyRRIyTPxE72TQ+7bDQdaKDoAbi+o2Fa2hv1kYLleNmsT aRiy51aUU9PafpSczUNwxt1jG4zIeJb+e6L3lDGOFEsg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=ZulUFV 1gWR7PuHNYILdjAeBVGLRMQ1QuI0Rh4IdMJCE=; b=lIrLCIA3/2o/SCwH2kftwG Um6E0JHYnr72ewRctMW7r1Kl4WEEtAG8BRPatE2plh8rVld/M/jXy08s13joV6++ gYpgZT4mLXhUTlYftQidFVE41SCNEB2dPXYJ/5BnAXcOUFJxciirQpFv/zTqbaFK En6+ts5GVbmVMyA/w7q55poCEMZZPgTbdPmutzmMNrzsVpap0Qi9cAepIJlBJhLS Sj0TfEejDuzemoININB7Iy9FeW1crCRJWWt6o5a0u+9VUJFw2OgYu6K99ZQUjiYU 1VEmmmTugz4BoLQwQExFykJG0Q/M4rOXU09BmyyCEQs2zVexFhvJAAgvY2o1ZCtA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrieelgdduieduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpehffgfhvffujgffkfggtgesthdtre dttdertdenucfhrhhomheplfhoohhsthcumfhrvghmvghrshcuoehjohhoshhtkhhrvghm vghrshesfhgrshhtmhgrihhlrdhfmheqnecuggftrfgrthhtvghrnhephfduffeuhfdule fhgfelueekgeduveettdduudfhfeetueegvdevtdduudfgffefnecukfhppeelgedrvddt kedrudefrdeffeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehjohhoshhtkhhrvghmvghrshesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Original-Received: from Swift.fastmail.com (94-208-13-33.cable.dynamic.v4.ziggo.nl [94.208.13.33]) by mail.messagingengine.com (Postfix) with ESMTPA id 354243280059 for ; Sun, 18 Oct 2020 17:21:07 -0400 (EDT) In-reply-to: <20201018205850.GA13219@tuxteam.de> Received-SPF: pass client-ip=64.147.123.25; envelope-from=joostkremers@fastmail.fm; helo=wout2-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/18 17:21:08 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.01, RCVD_IN_MSPIKE_WL=-0.01, 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:124560 Archived-At: On Sun, Oct 18 2020, tomas@tuxteam.de wrote: > If I understand this one correctly, it can be expressed as: > > (seq-filter > (lambda (elt) (string-match needle elt)) > haystack) Small nit-pick, but it's generally better to use `string-match-p` if you're just testing whether a string matches a regexp. `string-match` modifies the match data, `string-match-p` doesn't. -- Joost Kremers Life has its moments