unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: tomas@tuxteam.de
To: n179911 <n179911@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: highlight all lines with a certain prefix
Date: Tue, 7 Jul 2009 08:54:34 +0200	[thread overview]
Message-ID: <20090707065434.GA7950@tomas> (raw)
In-Reply-To: <3b9893450907052313g39937432ja25e27f1ed360735@mail.gmail.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, Jul 05, 2009 at 11:13:04PM -0700, n179911 wrote:
> Hi,
> 
> 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 <enter>. 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ás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFKUvEqBcgs9XrR2kYRArq0AJsGxCnKgAt3n+GbPJoyVhgq/uJBgACdFOrE
UPmKpiWZx+iaEaejJYb62dE=
=4Rhm
-----END PGP SIGNATURE-----




  reply	other threads:[~2009-07-07  6:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-06  6:13 highlight all lines with a certain prefix n179911
2009-07-07  6:54 ` tomas [this message]
2009-07-07 13:37 ` Thien-Thi Nguyen
     [not found] <mailman.1966.1246938928.2239.help-gnu-emacs@gnu.org>
2009-07-07  6:17 ` Stefan Kamphausen
2009-07-07 10:53 ` Alan Mackenzie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090707065434.GA7950@tomas \
    --to=tomas@tuxteam.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=n179911@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).