Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

I like to write complex find commands with find-cmd which is bundled with emacs (disclaimer: I wrote it):

    (find-cmd '(prune (name ".svn" ".git" ".CVS"))
              '(and (or (name "*.pl" "*.pm" "*.t")
                        (mtime "+1"))
                    (fstype "nfs" "ufs"))))
becomes:

    "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' \\) \\)"


Now that you mention -prune, I only recently figured out how to use it to exclude a specific path from a search, but my understanding is that of a trained dog.


If you extended this to run in emacs and put the results in a dired buffer on the fly, it'd be awesome!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: