From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: tomas@tuxteam.de Newsgroups: gmane.emacs.help Subject: Re: highlight all lines with a certain prefix Date: Tue, 7 Jul 2009 08:54:34 +0200 Message-ID: <20090707065434.GA7950@tomas> References: <3b9893450907052313g39937432ja25e27f1ed360735@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; x-action=pgp-signed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1246950865 23328 80.91.229.12 (7 Jul 2009 07:14:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 7 Jul 2009 07:14:25 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: n179911 Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 07 09:14:18 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MO4sI-0001k7-DS for geh-help-gnu-emacs@m.gmane.org; Tue, 07 Jul 2009 09:13:58 +0200 Original-Received: from localhost ([127.0.0.1]:50476 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MO4sH-00089H-7i for geh-help-gnu-emacs@m.gmane.org; Tue, 07 Jul 2009 03:13:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MO4Vd-0007VB-0I for help-gnu-emacs@gnu.org; Tue, 07 Jul 2009 02:50:33 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MO4VY-0007Sx-BU for help-gnu-emacs@gnu.org; Tue, 07 Jul 2009 02:50:32 -0400 Original-Received: from [199.232.76.173] (port=45278 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MO4VY-0007Sr-6q for help-gnu-emacs@gnu.org; Tue, 07 Jul 2009 02:50:28 -0400 Original-Received: from alextrapp1.equinoxe.de ([217.22.192.104]:56201 helo=www.elogos.de) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MO4VX-0004vh-Hk for help-gnu-emacs@gnu.org; Tue, 07 Jul 2009 02:50:27 -0400 Original-Received: by www.elogos.de (Postfix, from userid 1000) id 2DA6490008; Tue, 7 Jul 2009 08:54:34 +0200 (CEST) Content-Disposition: inline In-Reply-To: <3b9893450907052313g39937432ja25e27f1ed360735@mail.gmail.com> User-Agent: Mutt/1.5.15+20070412 (2007-04-11) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:65811 Archived-At: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sun, Jul 05, 2009 at 11:13:04PM -0700, n179911 wrote: > Hi, >=20 > In emacs, is there a way which highlight lines with certain prefix in a= file? > For example I want to highlight all lines with '-' or ' -' (a lot > of spaces followed by a '-' of a file? 1) Incremental search might be what you want. Hit C-s (Control key plus 's'), type the string you are looking for. All matches within the window are highlighted while you type. If you hit C-s again, the current position is advanced to the next hit. 2) If you want to see as many hits as possible, type M-x occur (Meta-x, where Meta is typically the Alt key, sometimes the ESC key), then the word 'occur' in the minibuffer, then . You are prompted for a regular expression, All hits are showed in a new window. Each hit is a link to the position in the original buffer. As a variation to (1) there is "incremental regular expression search" (look for "isearch-forward-regexp" and "isearch-backward-regexp" in the docs). HTH - -- tom=C3=A1s -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFKUvEqBcgs9XrR2kYRArq0AJsGxCnKgAt3n+GbPJoyVhgq/uJBgACdFOrE UPmKpiWZx+iaEaejJYb62dE=3D =3D4Rhm -----END PGP SIGNATURE-----