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:48:41 +0200 Message-ID: <87aa8kp4ie.fsf@thinkpad.tsdh.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1319878148 27264 80.91.229.12 (29 Oct 2011 08:49:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 29 Oct 2011 08:49:08 +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:49:04 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 1RK4b9-0000ET-SV for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Oct 2011 10:49:04 +0200 Original-Received: from localhost ([::1]:44834 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RK4b9-0005ul-AY for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Oct 2011 04:49:03 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:47274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RK4b4-0005uc-Ci for help-gnu-emacs@gnu.org; Sat, 29 Oct 2011 04:48:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RK4b3-0004PJ-GY for help-gnu-emacs@gnu.org; Sat, 29 Oct 2011 04:48:58 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:60390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RK4b3-0004PC-7y for help-gnu-emacs@gnu.org; Sat, 29 Oct 2011 04:48:57 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RK4b0-0000Cg-RH for help-gnu-emacs@gnu.org; Sat, 29 Oct 2011 10:48:54 +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:48:54 +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:48:54 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 23 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:kYk0/hlcVApp9v/OfhK09INlzys= 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:82703 Archived-At: 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