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

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

Re: filter from find-dired


From: r_mercado
Subject: Re: filter from find-dired
Date: Mon, 14 Jan 2013 17:26:50 +0000 (GMT)

Hi again,

get-directory-name is my function too. Glad to receive suggestions on 
how to improve it.

(defun get-directory-name ()
  "return the current directory"
  (interactive)
  (let (dirname components)
    (if (null (buffer-file-name (current-buffer)))
        (setq dirname (expand-file-name default-directory))
      (setq components (butlast (split-string (get-file-name) "/")))
      (setq dirname (mapconcat 'identity components "/"))
      )
    (message dirname)
    (kill-new dirname)
    dirname)
)

----Original Message----
From: r_mercado@o2.co.uk
Date: Jan 14, 2013 16:28 
To: <help-gnu-emacs@gnu.org>
Subject: filter from find-dired

Hello

I created a helper interactive function for my work that searches 
files from the current
directory that match the name "*subst*".

(defun find-substitutions ()
  "find substitution files in the current directory"
  (interactive)
  (find-name-dired (get-directory-name) "*substitutions*")
  )

I would like to filter the entries that sit under a .svn directory

How would I go about it?

In "plain" find, I found this works

find . -name .svn -prune -o -name "*subst*" -print 

find-dired with the same parameters does not filter the entries under
.svn, instead it includes all .svn directories

Thanks



reply via email to

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