all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Miles Bader <miles@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: How to kill line beginning with specific string
Date: Thu, 19 Nov 2009 19:45:16 +0900	[thread overview]
Message-ID: <buo1vjuaj43.fsf@dhlpc061.dev.necel.com> (raw)
In-Reply-To: mailman.11032.1258625728.2239.help-gnu-emacs@gnu.org

Peter Dyballa <Peter_Dyballa@Web.DE> writes:
>> Is there a simple way for me to search for and kill all of these lines
>> without having to repeatedly enter the search mode and type ctrl-k 
>> when the
>> line is found?
>
> You can check with C-M-s ^2000 .*C-qC-j – it will high-light the
> matching lines. Once you're content you can use replace-regexp to
> replace all that matches the regular expression with nothing.

Perhaps more easily, use the `flush-lines' command, and give it a regexp
of "^" + your string:

E.g., to kill lines beginning with "my prefix":

   M-x flush-lines RET ^my prefix RET

[Note that flush-lines operates on all lines _following point_, so you
might want to move to the beginning of the buffer first.]

-Miles

-- 
Cynic, n. A blackguard whose faulty vision sees things as they are, not as
they ought to be. Hence the custom among the Scythians of plucking out a
cynic's eyes to improve his vision.


  parent reply	other threads:[~2009-11-19 10:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-18 18:51 How to kill line beginning with specific string brooklynwhite
2009-11-19  6:43 ` Dirk-Jan C. Binnema
2009-11-19 17:12   ` brooklynwhite
2009-11-19 10:14 ` Peter Dyballa
     [not found] ` <mailman.11032.1258625728.2239.help-gnu-emacs@gnu.org>
2009-11-19 10:45   ` Miles Bader [this message]
     [not found] <mailman.11014.1258611938.2239.help-gnu-emacs@gnu.org>
2009-11-19  8:47 ` Giorgos Keramidas

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

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

  git send-email \
    --in-reply-to=buo1vjuaj43.fsf@dhlpc061.dev.necel.com \
    --to=miles@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.