From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jambunathan K Newsgroups: gmane.emacs.help Subject: Re: delete-file using wildcard Date: Sat, 29 Oct 2011 13:42:43 +0530 Message-ID: <8162j8nrlw.fsf@gmail.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1319875985 15626 80.91.229.12 (29 Oct 2011 08:13:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 29 Oct 2011 08:13:05 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: ishi soichi Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 29 10:13:01 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 1RK42G-0007U4-Tv for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Oct 2011 10:13:01 +0200 Original-Received: from localhost ([::1]:35116 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RK42G-0002YA-DG for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Oct 2011 04:13:00 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:47937) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RK42C-0002Y5-TT for help-gnu-emacs@gnu.org; Sat, 29 Oct 2011 04:12:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RK42C-0006D4-4w for help-gnu-emacs@gnu.org; Sat, 29 Oct 2011 04:12:56 -0400 Original-Received: from mail-gy0-f169.google.com ([209.85.160.169]:55154) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RK42B-0006Cy-Pz for help-gnu-emacs@gnu.org; Sat, 29 Oct 2011 04:12:56 -0400 Original-Received: by gyf3 with SMTP id 3so5106794gyf.0 for ; Sat, 29 Oct 2011 01:12:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=cRQUzm9NHjUNThLU6R85HfvXd1U765g1DON6gcQ44sc=; b=nWg/7YXVPbil9QBDDQygw0pxGXZ/thSC8GrA/2GK+yIy62HNiBB5cb2lcgjfAzg651 srJD9yIQZzTCWrxPJJ9iJ2e0vMgr58KfpMJrCq0GbVqBr7Iu7jjMKzfpWlWfliR4JhP3 WEoKHH8zXt078uQGmN5pZT61Zutc7RBuZBDMI= Original-Received: by 10.68.209.37 with SMTP id mj5mr8827246pbc.123.1319875974799; Sat, 29 Oct 2011 01:12:54 -0700 (PDT) Original-Received: from JAMBU-NETBOOK ([115.241.98.61]) by mx.google.com with ESMTPS id l3sm14155777pbn.8.2011.10.29.01.12.49 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 29 Oct 2011 01:12:53 -0700 (PDT) In-Reply-To: (ishi soichi's message of "Sat, 29 Oct 2011 16:54:15 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (windows-nt) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.160.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:82702 Archived-At: May be you should use dired. 1. C-x C-f ~/tmp RET 2. * % \.pdf$ 3. t 4. k 5. t 6. D 1 => visit directory in dired 2 => mark all pdf files. Uses emacs style regexps 3 => toggle mark. this marks all non-pdf files 4 => kill mark. Removes the display of files marked in 3 5 => toggle mark. this marks all pdf files. This shows (just) the files that you will be operating upon 6 => Delete the chosen files Steps 3,4 and 5 are optional. Use with caution. > I have a question about Emacs Lisp, which I believe is simple enough > for most of you. > > > 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? > > soichi > > --