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: Tassilo Horn
Subject: Re: delete-file using wildcard
Date: Sat, 29 Oct 2011 10:48:41 +0200
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (gnu/linux)

ishi soichi <soichi777@gmail.com> 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]