From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Neon Absentius Newsgroups: gmane.emacs.help Subject: Re: regexp to collapse multiple blank lines into one Date: Mon, 10 Oct 2005 19:06:37 +0000 Message-ID: <20051010190637.GZ29712@SDF.LONESTAR.ORG> References: <9rd2f.11472$vw6.9111@newsread1.news.atl.earthlink.net> <20051010172845.GX29712@SDF.LONESTAR.ORG> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1128971339 25959 80.91.229.2 (10 Oct 2005 19:08:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 10 Oct 2005 19:08:59 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 10 21:08:53 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EP2zm-0007Kx-Kb for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Oct 2005 21:07:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EP2zm-0002dq-2C for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Oct 2005 15:07:34 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EP2z3-0002PF-Th for help-gnu-emacs@gnu.org; Mon, 10 Oct 2005 15:06:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EP2z2-0002Oq-Cp for help-gnu-emacs@gnu.org; Mon, 10 Oct 2005 15:06:49 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EP2z2-0002On-9s for help-gnu-emacs@gnu.org; Mon, 10 Oct 2005 15:06:48 -0400 Original-Received: from [192.94.73.21] (helo=sdf.lonestar.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EP2z1-0001jZ-Oy for help-gnu-emacs@gnu.org; Mon, 10 Oct 2005 15:06:48 -0400 Original-Received: from sdf.lonestar.org (IDENT:absent@ukato.freeshell.org [192.94.73.7]) by sdf.lonestar.org (8.13.1/8.12.10) with ESMTP id j9AJ6bYf006263 for ; Mon, 10 Oct 2005 19:06:37 GMT Original-Received: (from absent@localhost) by sdf.lonestar.org (8.13.1/8.12.8/Submit) id j9AJ6bGR029111 for help-gnu-emacs@gnu.org; Mon, 10 Oct 2005 19:06:37 GMT Original-To: help-gnu-emacs@gnu.org Mail-Followup-To: Neon Absentius , help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i 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:30112 Archived-At: On Mon, Oct 10, 2005 at 12:33:50PM -0600, Kevin Rodgers wrote: > > In any case, replacing \(^ C-q C-j \)+ with \1 is 10 key strokes, which > is actually more typing than if you were to replace ^ C-q C-j + with C-q > C-j (6 keys). > Yes indeed. I didn't think of it. I just wrote the first think that came to my mind and it worked. About the keystrokes though I think that C-q shoud count for more than 1 keystroke; perhaps not 2 keystrokes but 1.5 so your solution has really 8 keystrokes :). Still my solution is not that bad because it is general: a simple modification of it will work whenever one whishes to replace multiple occurences of a regexp with a single occurence. Also on most files using ^ C-q C-j \{2,\} will save you a lot a keystrokes because one won't have to press all these "y". -- There is no national science just as there is no national multiplication table; what is national is no longer science. -- Anton Checov