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: Sat, 29 Oct 2011 17:57:37 +0900 Message-ID: References: <87aa8kp4ie.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=90e6ba6e8dbc89877204b06c32c6 X-Trace: dough.gmane.org 1319878672 30066 80.91.229.12 (29 Oct 2011 08:57:52 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 29 Oct 2011 08:57:52 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Tassilo Horn Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 29 10:57:48 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 1RK4ja-0002zg-9m for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Oct 2011 10:57:46 +0200 Original-Received: from localhost ([::1]:43690 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RK4jZ-0007WO-Mw for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Oct 2011 04:57:45 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:53762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RK4jT-0007W5-HW for help-gnu-emacs@gnu.org; Sat, 29 Oct 2011 04:57:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RK4jS-0005zm-HK for help-gnu-emacs@gnu.org; Sat, 29 Oct 2011 04:57:39 -0400 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:46659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RK4jS-0005zf-EH for help-gnu-emacs@gnu.org; Sat, 29 Oct 2011 04:57:38 -0400 Original-Received: by iagf6 with SMTP id f6so6684760iag.0 for ; Sat, 29 Oct 2011 01:57:37 -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=R6M7Auy5Z+zjUcgV4zg6YL7TWaJADbrXYNX5QA0yHlI=; b=GIuw3KXOyxteRTW8+syC/gvXFjMoLQFy4/uFLP+SCjyyVHH7Acwx+ish9/u9KKMv3r nmoPQ3XKmsaIDsiK6KSTmQaYSRtEQx7X0PLRJrEvtzbj3I9KHWgQRoLv17eQwDCpAdbt KkbBrhxAAA6FBvDHbNk1AUz7T7Nw66XNPSl1w= Original-Received: by 10.42.155.74 with SMTP id t10mr8869220icw.49.1319878657672; Sat, 29 Oct 2011 01:57:37 -0700 (PDT) Original-Received: by 10.42.167.132 with HTTP; Sat, 29 Oct 2011 01:57:37 -0700 (PDT) In-Reply-To: <87aa8kp4ie.fsf@thinkpad.tsdh.de> 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:82705 Archived-At: --90e6ba6e8dbc89877204b06c32c6 Content-Type: text/plain; charset=ISO-8859-1 Thanks! It helped. soichi 2011/10/29 Tassilo Horn > ishi soichi writes: > > Hi! > > > the wildcard command does not seem work similarly in Emacs Lisp. > > > > (delete-file (subseq (file-expand-wildcards "~/Desktop/*") -1)) > > `delete-file' wants exactly one file given as string, but the `subseq' > form returns a *list* with exactly one file name, i.e., the last file > matching the given wildcard. > > This should do the trick: > > (delete-file (nth 0 (subseq (file-expand-wildcards "~/Desktop/*") -1))) > > Bye, > Tassilo > -- > (What the world needs (I think) is not > (a Lisp (with fewer parentheses)) > but (an English (with more.))) > Brian Hayes, http://tinyurl.com/3y9l2kf > > > --90e6ba6e8dbc89877204b06c32c6 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks! It helped.

--90e6ba6e8dbc89877204b06c32c6--