Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3948734
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:24:36+00:00 2026-05-20T01:24:36+00:00

I commonly do find-grep-dired to find an expression in a project directory. That gives

  • 0

I commonly do find-grep-dired to find an expression in a project directory. That gives me a nice dired view of all the files that contain that expression. But my next step is invariably to open one of those files and do an isearch-forward with the same search expression. How can I save myself from typing in the search words twice each time (or more than twice if there are multiple files I want to edit)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T01:24:37+00:00Added an answer on May 20, 2026 at 1:24 am

    This should work for you:

    1. Run find-grep-dired as usual
    2. Press * t (dired-toggle-marks) to mark all files.
    3. Press A to start dired-do-search. When prompted, instead of typing, press M-p, this will bring up your find-grep regexp since both functions use the same prompting history list
    4. You will be taken to the first match in the first file. Here’s the fun part, simply press M-, to go to the next match spanning all of your matched files.
    5. Profit? (sorry, couldn’t resist)

    And if you want it all in one shot, here you go:

    (defun find-grep-dired-do-search (dir regexp)
      "First perform `find-grep-dired', and wait for it to finish.
    Then, using the same REGEXP as provided to `find-grep-dired',
    perform `dired-do-search' on all files in the *Find* buffer."
      (interactive "DFind-grep (directory): \nsFind-grep (grep regexp): ")
      (find-grep-dired dir regexp)
      (while (get-buffer-process (get-buffer "*Find*"))
        (sit-for 1))
      (with-current-buffer "*Find*"
        (dired-toggle-marks)
        (dired-do-search regexp)))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I commonly find myself extracting common behavior out of classes into helper/utility classes that
Commonly when I look around the Internet, I find that people are generally using
I know it is commonly used as a lock object, but is that really
I cannot find comparison of these parsing technique. Which one is most commonly used?
To quote Wikipedia : Two commonly used languages that support many kinds of implicit
This is probably a kinda commonly asked question but I could do with help
How do I find out the most commonly or popularly used count down timer
Commonly, in a lot of frameworks, you can find examples of creating a query
I am trying to find the official (or a good enough) reason that the
I need to find a list of commonly mistyped keys on a keyboard for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.