During my search I keep having an error as follows:

Search failed with status 1: find: ‘/home/user/folder/flycheck_Driver.py’: No such file or directory

[Q] Is there any way to ignore files as following regex: flycheck_*.py?

My setup:

(defun my-find-orgfiles ()
  (setq toggle-case-fold-search 0)  ; Turn Off Smart Case Sensitivity
  (find-name-dired "~/folder" "*py"))

(global-set-key (kbd "M-m") 'my-find-orgfiles)

(add-hook 'python-mode-hook
          (lambda ()
            (setq flycheck-python-pylint-executable "~/venv/bin/pylint")
            (setq flycheck-pylintrc "~/.pylintrc")))

Than, t to toggle marked/unmarked files (thus marking them all, since none were marked). Then I use Q to use query-replace on the marked files. And enter .value to replace with value.

=> Better solution could be to let emacs create flycheck_ files in another folder?

=> Should I use dired-omit-files as from the following answer.

  • Is the question about query-replace, as the title says? If not, please correct the title.
    – Drew
    Jun 24, 2020 at 15:56
  • @Drew I updated the title. I think when I toggle all files flycheck_*.py also included as well, which leads query replacement to fail, since flycheck files are remove right away.
    – alper
    Jun 24, 2020 at 16:24

1 Answer 1


I have solved my problem as follows, with following:

find-dired "~/eBlocBroker" "-name \\*.py ! -name flycheck_\\*.py)

(defun my-find-orgfiles ()
  (find-dired "~/folder" "-name \\*.py ! -name flycheck_\\*.py ! -name __init__.py"))
(global-set-key (kbd "M-m") 'my-find-orgfiles)

Please note that comments on this answer in How to get Dired to ignore files with specific extensions helped me to solve it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.