Is there a mode or some way to use grep inside emacs then jump to the referenced?












1















I'm looking for a useful way to use grep from inside emacs. I generally run a grep command to find references in the source tree and then use emacs to open the file and then jump to the line indicated with the -n flag to grep. However, I'm guessing with emacs I could do better. It would be nice if the resulting view maintained the colorization provided by normal grep in the terminal. Granted this wouldn't be universal, but at least the intent.



Is there a mode or some way to use grep inside emacs then jump to the referenced?










share|improve this question




















  • 2





    What have you tried? E.g. the first entry in the "Tools" menu says "Search files (Grep)" which sounds like it might arguably be vaguely related.

    – Stefan
    Nov 20 '18 at 20:21






  • 2





    C-h r i grep. It's not hard to ask Emacs - one of the things that makes Emacs useful. i in the manuals is your friend.

    – Drew
    Nov 20 '18 at 20:25


















1















I'm looking for a useful way to use grep from inside emacs. I generally run a grep command to find references in the source tree and then use emacs to open the file and then jump to the line indicated with the -n flag to grep. However, I'm guessing with emacs I could do better. It would be nice if the resulting view maintained the colorization provided by normal grep in the terminal. Granted this wouldn't be universal, but at least the intent.



Is there a mode or some way to use grep inside emacs then jump to the referenced?










share|improve this question




















  • 2





    What have you tried? E.g. the first entry in the "Tools" menu says "Search files (Grep)" which sounds like it might arguably be vaguely related.

    – Stefan
    Nov 20 '18 at 20:21






  • 2





    C-h r i grep. It's not hard to ask Emacs - one of the things that makes Emacs useful. i in the manuals is your friend.

    – Drew
    Nov 20 '18 at 20:25
















1












1








1








I'm looking for a useful way to use grep from inside emacs. I generally run a grep command to find references in the source tree and then use emacs to open the file and then jump to the line indicated with the -n flag to grep. However, I'm guessing with emacs I could do better. It would be nice if the resulting view maintained the colorization provided by normal grep in the terminal. Granted this wouldn't be universal, but at least the intent.



Is there a mode or some way to use grep inside emacs then jump to the referenced?










share|improve this question
















I'm looking for a useful way to use grep from inside emacs. I generally run a grep command to find references in the source tree and then use emacs to open the file and then jump to the line indicated with the -n flag to grep. However, I'm guessing with emacs I could do better. It would be nice if the resulting view maintained the colorization provided by normal grep in the terminal. Granted this wouldn't be universal, but at least the intent.



Is there a mode or some way to use grep inside emacs then jump to the referenced?







emacs grep






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 20 '18 at 20:27









sds

38.8k1493168




38.8k1493168










asked Nov 20 '18 at 18:41









lucidquietlucidquiet

2,44752961




2,44752961








  • 2





    What have you tried? E.g. the first entry in the "Tools" menu says "Search files (Grep)" which sounds like it might arguably be vaguely related.

    – Stefan
    Nov 20 '18 at 20:21






  • 2





    C-h r i grep. It's not hard to ask Emacs - one of the things that makes Emacs useful. i in the manuals is your friend.

    – Drew
    Nov 20 '18 at 20:25
















  • 2





    What have you tried? E.g. the first entry in the "Tools" menu says "Search files (Grep)" which sounds like it might arguably be vaguely related.

    – Stefan
    Nov 20 '18 at 20:21






  • 2





    C-h r i grep. It's not hard to ask Emacs - one of the things that makes Emacs useful. i in the manuals is your friend.

    – Drew
    Nov 20 '18 at 20:25










2




2





What have you tried? E.g. the first entry in the "Tools" menu says "Search files (Grep)" which sounds like it might arguably be vaguely related.

– Stefan
Nov 20 '18 at 20:21





What have you tried? E.g. the first entry in the "Tools" menu says "Search files (Grep)" which sounds like it might arguably be vaguely related.

– Stefan
Nov 20 '18 at 20:21




2




2





C-h r i grep. It's not hard to ask Emacs - one of the things that makes Emacs useful. i in the manuals is your friend.

– Drew
Nov 20 '18 at 20:25







C-h r i grep. It's not hard to ask Emacs - one of the things that makes Emacs useful. i in the manuals is your friend.

– Drew
Nov 20 '18 at 20:25














1 Answer
1






active

oldest

votes


















4














Believe it or not, M-x grep and M-x rgrep (r for recursive) are already there - and can be accessed from menu Tools --> Search files (Grep).



See 27.4 Searching with Grep under Emacs.



You might also find M-x dired-do-find-regexp-and-replace and M-x project-query-regexp useful.






share|improve this answer

























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53399491%2fis-there-a-mode-or-some-way-to-use-grep-inside-emacs-then-jump-to-the-referenced%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    4














    Believe it or not, M-x grep and M-x rgrep (r for recursive) are already there - and can be accessed from menu Tools --> Search files (Grep).



    See 27.4 Searching with Grep under Emacs.



    You might also find M-x dired-do-find-regexp-and-replace and M-x project-query-regexp useful.






    share|improve this answer






























      4














      Believe it or not, M-x grep and M-x rgrep (r for recursive) are already there - and can be accessed from menu Tools --> Search files (Grep).



      See 27.4 Searching with Grep under Emacs.



      You might also find M-x dired-do-find-regexp-and-replace and M-x project-query-regexp useful.






      share|improve this answer




























        4












        4








        4







        Believe it or not, M-x grep and M-x rgrep (r for recursive) are already there - and can be accessed from menu Tools --> Search files (Grep).



        See 27.4 Searching with Grep under Emacs.



        You might also find M-x dired-do-find-regexp-and-replace and M-x project-query-regexp useful.






        share|improve this answer















        Believe it or not, M-x grep and M-x rgrep (r for recursive) are already there - and can be accessed from menu Tools --> Search files (Grep).



        See 27.4 Searching with Grep under Emacs.



        You might also find M-x dired-do-find-regexp-and-replace and M-x project-query-regexp useful.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 21 '18 at 17:02

























        answered Nov 20 '18 at 18:52









        sdssds

        38.8k1493168




        38.8k1493168






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53399491%2fis-there-a-mode-or-some-way-to-use-grep-inside-emacs-then-jump-to-the-referenced%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

            Alcedinidae

            Origin of the phrase “under your belt”?