help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: delete-file using wildcard


From: ishi soichi
Subject: Re: delete-file using wildcard
Date: Sat, 29 Oct 2011 17:57:37 +0900

Thanks! It helped.

soichi

2011/10/29 Tassilo Horn <address@hidden>
ishi soichi <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]