From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ishi soichi Newsgroups: gmane.emacs.help Subject: Re: delete-file using wildcard Date: Sun, 30 Oct 2011 05:30:59 +0900 Message-ID: References: <4F4638449BDD48829B817613BC251B5B@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=90e6ba3fcc233656e304b075e289 X-Trace: dough.gmane.org 1319920273 19712 80.91.229.12 (29 Oct 2011 20:31:13 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 29 Oct 2011 20:31:13 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 29 22:31:09 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RKFYZ-0004G1-W1 for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Oct 2011 22:31:08 +0200 Original-Received: from localhost ([::1]:56309 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RKFYZ-0004Z7-FI for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Oct 2011 16:31:07 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:60618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RKFYU-0004Yw-Dw for help-gnu-emacs@gnu.org; Sat, 29 Oct 2011 16:31:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RKFYS-0003md-Qf for help-gnu-emacs@gnu.org; Sat, 29 Oct 2011 16:31:02 -0400 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:34017) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RKFYS-0003mZ-HN for help-gnu-emacs@gnu.org; Sat, 29 Oct 2011 16:31:00 -0400 Original-Received: by iagf6 with SMTP id f6so7273241iag.0 for ; Sat, 29 Oct 2011 13:30:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=sTHufLnpeRHLdCrwY8TkLA0n6E2iNmw8ncUPCq+bJoo=; b=TFaCP9DoDGD1x/9upDgLc2gnw3X+mrOrErFRDbbAGgGqaEM2zSV7Se6bGMOGx0PriQ kC+YDFw3JlmW7tMvtqcfxuHiRYcM08FqjN52BE1lfrjvhxapkg0oLjEvTOGT7iw/vozL 53TKdsXRtllEH+p1haTKJL9dFi4tEGxb6vNR0= Original-Received: by 10.42.133.201 with SMTP id i9mr12173514ict.1.1319920259716; Sat, 29 Oct 2011 13:30:59 -0700 (PDT) Original-Received: by 10.42.167.132 with HTTP; Sat, 29 Oct 2011 13:30:59 -0700 (PDT) In-Reply-To: <4F4638449BDD48829B817613BC251B5B@us.oracle.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.169 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:82715 Archived-At: --90e6ba3fcc233656e304b075e289 Content-Type: text/plain; charset=ISO-8859-1 Thanks for many solutions. I appreciate it! soichi 2011/10/29 Drew Adams > > I would like to delete files in a directory. > > When doing so with Linux command, we usually do, rm * > > at that directory. > > the wildcard command does not seem work similarly in Emacs Lisp. > > (delete-file (subseq (file-expand-wildcards "~/Desktop/*") -1)) > > doesn't work. Could anyone help me out? > > Others have provided some solutions. To do it interactively, Dired is your > friend, as Jambunathan suggested. > > Another interactive solution is `icicle-delete-file'. It's a multi-command > version of `delete-file', which means that you can act on (delete, in this > case) > any number of files and directories with the same command invocation. > > For your example, just do this: M-x icicle-delete-file TAB C-! > > You can type a pattern to match, before hitting TAB (or S-TAB, if the > pattern is > a regexp). The key `C-!' means act on *all* matching candidates. > Whatever file > names currently match your minibuffer input (they are shown in > *Completions*), > those files are deleted. Or use `C-mouse-2' or `C-RET' to act on only one > candidate at a time. > > Change your input (pattern) to act on different files. You can also > change to > another directory, using `C-c C-d'. All during the same command > invocation. > Use C-g to end the command (or RET to act on one final candidate). > > http://www.emacswiki.org/emacs/Icicles_-_Multi-Commands#toc3 > > --90e6ba3fcc233656e304b075e289 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks for many solutions.
I appreciate it!

so= ichi

2011/10/29 Drew Adams <drew.adams@oracle.com&= gt;
> I would like to dele= te files in a directory.
> When doing so with Linux command, we usually do, rm *
> at that directory.
> the wildcard command does not seem work similarly in Emacs Lisp.
> (delete-file (subseq (file-expand-wildcards "~/Desktop/*") -= 1))
> doesn't work. =A0Could anyone help me out?

Others have provided some solutions. =A0To do it interactively, Dired= is your
friend, as Jambunathan suggested.

Another interactive solution is `icicle-delete-file'. =A0It's a mul= ti-command
version of `delete-file', which means that you can act on (delete, in t= his case)
any number of files and directories with the same command invocation.

For your example, just do this: M-x icicle-delete-file TAB C-!

You can type a pattern to match, before hitting TAB (or S-TAB, if the patte= rn is
a regexp). =A0The key `C-!' means act on *all* matching candidates. =A0= Whatever file
names currently match your minibuffer input (they are shown in *Completions= *),
those files are deleted. =A0Or use `C-mouse-2' or `C-RET' to act on= only one
candidate at a time.

Change your input (pattern) to act on different files. =A0You can also chan= ge to
another directory, using `C-c C-d'. =A0All during the same command invo= cation.
Use C-g to end the command (or RET to act on one final candidate).

http://www.emacswiki.org/emacs/Icicles_-_Multi-Commands#toc= 3


--90e6ba3fcc233656e304b075e289--