From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: delete-file using wildcard Date: Sat, 29 Oct 2011 10:50:12 +0200 Message-ID: <8762j8p4fv.fsf@thinkpad.tsdh.de> References: <87aa8kp4ie.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1319878520 29291 80.91.229.12 (29 Oct 2011 08:55:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 29 Oct 2011 08:55:20 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 29 10:55:16 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 1RK4h9-0002DZ-FM for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Oct 2011 10:55:15 +0200 Original-Received: from localhost ([::1]:49850 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RK4h8-0006g5-TZ for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Oct 2011 04:55:14 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:50482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RK4h4-0006fw-QW for help-gnu-emacs@gnu.org; Sat, 29 Oct 2011 04:55:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RK4h3-0005el-CJ for help-gnu-emacs@gnu.org; Sat, 29 Oct 2011 04:55:10 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:40524) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RK4h3-0005ed-61 for help-gnu-emacs@gnu.org; Sat, 29 Oct 2011 04:55:09 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RK4h1-0002AA-Ky for help-gnu-emacs@gnu.org; Sat, 29 Oct 2011 10:55:07 +0200 Original-Received: from 91-67-169-145-dynip.superkabel.de ([91.67.169.145]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 29 Oct 2011 10:55:07 +0200 Original-Received: from tassilo by 91-67-169-145-dynip.superkabel.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 29 Oct 2011 10:55:07 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 27 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 91-67-169-145-dynip.superkabel.de User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (gnu/linux) Cancel-Lock: sha1:vXyCQ+jldN3XA3pWGUMdBIGYjmg= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 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:82704 Archived-At: Tassilo Horn writes: > 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))) Argh, of course one would use `car' instead of `nth' here. 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