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

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

Re: find.el --- Build a valid find(1) command with sexps


From: Michael Olson
Subject: Re: find.el --- Build a valid find(1) command with sexps
Date: Mon, 31 Mar 2008 20:34:39 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Phil Jackson <address@hidden> writes:

> Hi all,
>
> I don't think I've ever written out a (semi-complex) find(1) command
> that has worked first time. I've written this module so that now I can
> screw it up in sexp notation too.
>
> As the commentary states:
>
>     (find (prune (name ".svn" ".git" ".CVS"))
>           (and (or (name "*.pl" "*.pm" "*.t")
>                    (mtime "+1"))
>                (fstype "nfs" "ufs")))
>
> will become (un-wrapped):
>
>     "find '/home/phil/' \\( \\( -name '.svn' -or -name '.git' -or
>      -name '.CVS' \\) -prune -or -true \\) \\( \\( \\( -name '*.pl'
>      -or -name '*.pm' -or -name '*.t' \\) -or -mtime '+1' \\) -and \\(
>      -fstype 'nfs' -or -fstype 'ufs' \\) \\)"

Neat!  One minor quibble: the name `find' is already taken by cl-seq.el,
where it has a different meaning.  Maybe this new function could be
called `make-find-cmd' or something similar.

-- 
|       Michael Olson  |  FSF Associate Member #652     |
| http://mwolson.org/  |  Hobbies: Lisp, HCoop          |
| Projects: Emacs, Muse, ERC, EMMS, ErBot, DVC, Planner |
`-------------------------------------------------------'

Attachment: pgpdhoWwdYvrM.pgp
Description: PGP signature


reply via email to

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