Path: utzoo!attcan!uunet!husc6!bu-cs!tower From: tower@bu-cs.BU.EDU (Leonard H. Tower Jr.) Newsgroups: comp.unix.wizards,comp.unix.questions Subject: Re: grep replacement Summary: try GNU Emacs' M-x grep RET Message-ID: <23158@bu-cs.BU.EDU> Date: 6 Jun 88 21:44:34 GMT References: <7882@alice.UUCP> <5630@umn-cs.cs.umn.edu> <6866@elroy.Jpl.Nasa.Gov> Reply-To: tower@bu-it.bu.edu (Leonard H. Tower Jr.) Followup-To: comp.unix.wizards Organization: Distributed Systems Group, Boston University, 111 Cummington Street, Boston, MA 02215, USA +1 (617) 353-2780 Lines: 24 X-Home: 36 Porter Street, Somerville, MA 02143, USA +1 (617) 623-7739 Xref: utzoo comp.unix.wizards:9133 comp.unix.questions:7431 Path: utzoo!attcan!uunet!husc6!bu-cs!tower From: tower@bu-cs.BU.EDU (Leonard H. Tower Jr.) Newsgroups: comp.unix.wizards,comp.unix.questions Subject: Re: grep replacement Summary: try GNU Emacs' M-x grep RET Message-ID: <23158@bu-cs.BU.EDU> Date: 6 Jun 88 21:44:34 GMT References: <7882@alice.UUCP> <5630@umn-cs.cs.umn.edu> <6866@elroy.Jpl.Nasa.Gov> Reply-To: tower@bu-it.bu.edu (Leonard H. Tower Jr.) Followup-To: comp.unix.wizards Organization: Distributed Systems Group, Boston University, 111 Cummington Street, Boston, MA 02215, USA +1 (617) 353-2780 Lines: 24 X-UUCP-Path: ..!harvard!bu-cs!tower In article <6866@elroy.Jpl.Nasa.Gov> alan@cogswell.Jpl.Nasa.Gov (Alan S. Mazer) writes: | |One thing I would _love_ is to be able to find the context of what I've |found, for example, to find the two (n?) surrounding lines. I have wanted |to do this many times and there is no good way. GNU Emacs has a command that will walk you through each match of a grep run and show you the context around it: grep: Run grep, with user-specified args, and collect output in a buffer. While grep runs asynchronously, you can use the C-x ` command to find the text that grep hits refer to. M-x grep RET to invoke it. I suspect other Unix Emacs have a similar feature. Information on how to obtain GNU Emacs, other GNU software, or the GNU project itself is available from: gnu@prep.ai.mit.edu enjoy -len