From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Globbing file name match function? Date: Sun, 05 Jun 2022 14:23:10 +0300 Message-ID: <83k09v9wwx.fsf@gnu.org> References: <87bkv75prr.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2705"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jun 05 13:25:14 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 1nxoNe-0000VC-7j for ged-emacs-devel@m.gmane-mx.org; Sun, 05 Jun 2022 13:25:14 +0200 Original-Received: from localhost ([::1]:42418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxoNc-0006k5-TQ for ged-emacs-devel@m.gmane-mx.org; Sun, 05 Jun 2022 07:25:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxoLs-0005Me-Qf for emacs-devel@gnu.org; Sun, 05 Jun 2022 07:23:25 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:41828) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxoLs-0008Ld-FF; Sun, 05 Jun 2022 07:23:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=7iO4bulnezPOYDibi74/gtXp5oTgNtap1hmtWZHMUMc=; b=nmjaym3zEnkQ v+D0+Zcn28MrxhJmjpWzwohlXudeM8CokIRDOhzLPPj0BKYoPJKL3sFLr+hsBEfEpAt7w2iQGPOCr gqJmjleF4wQ3ItZoRe0WU65+zZyaTqakol8LCFOh9wQQESs9D3xVoW3mX7BRFET39Q/76LIiG30Ay 3mdZm80uc7hPkCiKtDTM3z6o98LfPJLDZI6A8RajgoObv0jwoUd87gPVFJu7pjPRLeKFqVTDEboSN aza4Kt2tiuk/FwMkELvtwtQ3VyUVPuxLfhQ44n430b9ffV8rAMvgJHUxVLKzFF/67OMjQKnyFu3TX oiZEv7RzNbVNCnnNbKyAUw==; Original-Received: from [87.69.77.57] (port=1926 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxoLr-000431-PA; Sun, 05 Jun 2022 07:23:24 -0400 In-Reply-To: <87bkv75prr.fsf@gnus.org> (message from Lars Ingebrigtsen on Sun, 05 Jun 2022 13:11:04 +0200) 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:290691 Archived-At: > From: Lars Ingebrigtsen > Date: Sun, 05 Jun 2022 13:11:04 +0200 > > I've been poking around for a couple of minutes to see whether we have a > function to list files matching a regexp a la how a shell matches them. > That is: > > $ ls ~/src/emacs/*/lisp/abbrev.el > /home/larsi/src/emacs/27.1/lisp/abbrev.el > /home/larsi/src/emacs/bisect/lisp/abbrev.el > /home/larsi/src/emacs/emacs-28/lisp/abbrev.el > /home/larsi/src/emacs/foo/lisp/abbrev.el > ... > > This is with a glob, but ideally you'd be able to drop in a regexp > anywhere in the file name. Do we have that anywhere in Emacs? ls-lisp.el does. It converts a wildcard to regexp, and then uses directory-files with MATCH set to the regexp. Do you mean specifically a wildcard in the middle of a file name, which stands for matching subdirectories?