From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: Re: Emacs equivalent of the ":g" command in vi Date: Fri, 22 Jul 2011 12:03:35 -0700 Message-ID: <87ipqui1dk.fsf@ericabrahamsen.net> References: <14F21CEC-7265-4DE4-888A-A10FCFFF6826@Web.DE> <8762mufxx7.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1311361452 12502 80.91.229.12 (22 Jul 2011 19:04:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 22 Jul 2011 19:04:12 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 22 21:04:08 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QkL15-0006fa-Ty for geh-help-gnu-emacs@m.gmane.org; Fri, 22 Jul 2011 21:04:08 +0200 Original-Received: from localhost ([::1]:38483 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkL15-0006Qn-GP for geh-help-gnu-emacs@m.gmane.org; Fri, 22 Jul 2011 15:04:07 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:57179) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkL10-0006Qc-7D for help-gnu-emacs@gnu.org; Fri, 22 Jul 2011 15:04:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QkL0z-0006wJ-57 for help-gnu-emacs@gnu.org; Fri, 22 Jul 2011 15:04:02 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:38885) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkL0y-0006w8-QV for help-gnu-emacs@gnu.org; Fri, 22 Jul 2011 15:04:01 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QkL0v-0006ZI-7T for help-gnu-emacs@gnu.org; Fri, 22 Jul 2011 21:03:57 +0200 Original-Received: from 63.226.249.211 ([63.226.249.211]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 22 Jul 2011 21:03:57 +0200 Original-Received: from eric by 63.226.249.211 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 22 Jul 2011 21:03:57 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 23 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 63.226.249.211 User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:rHDlYh7HYw16DG4g3CuY86zRowo= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:81736 Archived-At: On Fri, Jul 22 2011, C K Kashyap wrote: > > which could be as simple as in vi/vim.) > I think he want to delete lines matching a regexp, so C-k is not > what he > wants here. > > `query-replace-regexp' can be used with a regexp like this: > > ^.*\(your_regexp\).*$ > > and you replace with nothing (empty prompt). > > -- > > > replace-regexp is indeed closer to what I am looking for. However, > I'd like the result to not leave blank lines. > > Regards, > Kashyap  Isn't this what flush-lines and keep-lines are for?