From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "B. T. Raven" Newsgroups: gmane.emacs.help Subject: Re: Whitespace deletion Date: Fri, 09 Dec 2005 17:44:35 GMT Organization: EarthLink Inc. -- http://www.EarthLink.net Message-ID: <7ojmf.1585$3Z.638@newsread1.news.atl.earthlink.net> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1134158500 27402 80.91.229.2 (9 Dec 2005 20:01:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 9 Dec 2005 20:01:40 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Dec 09 21:01:34 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EkoOq-0008E3-4M for geh-help-gnu-emacs@m.gmane.org; Fri, 09 Dec 2005 20:59:25 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EkoPA-0002xY-Oc for geh-help-gnu-emacs@m.gmane.org; Fri, 09 Dec 2005 14:59:44 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!newsread1.news.atl.earthlink.net.POSTED!0847253b!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 53 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Original-NNTP-Posting-Host: 4.159.38.61 Original-X-Complaints-To: abuse@earthlink.net Original-X-Trace: newsread1.news.atl.earthlink.net 1134150275 4.159.38.61 (Fri, 09 Dec 2005 09:44:35 PST) Original-NNTP-Posting-Date: Fri, 09 Dec 2005 09:44:35 PST Original-Xref: shelby.stanford.edu gnu.emacs.help:136205 Original-To: help-gnu-emacs@gnu.org 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:31819 Archived-At: "August Karlstrom" wrote in message news:L40mf.39868$d5.196261@newsb.telia.net... > Hi, > > Is there an Emacs command that works like just-one-space, but also > deletes newlines? > > Example: > > I want to -!- > > join these two lines > > should become > > I want to -!-join these two lines > > > Regards, > > August > The resultant ...-!-join... looks pathological. Is -!- shorthand for some variable text or is it constant? Can there be white space after -!- but before the newline? If not then, after placing point somewhere on the second line, you could wrap some commands in a macro (underscore = space to make it visible): C-x ( C-a M-SPC Backspace Backspace M-SPC C-r _- M-SPC C-x ) If that doesn't do it then you probably have to write something in elisp. Here are some regexes I use a lot (not programming though, just in text mode): C-M-% \(^C-qC-j\)+ RET \1 RET ;; collapse multiple blank lines into one C-M-% ^C-qC-j+ RET RET ;;remove all blank lines C-M-% _\([;!?]\) RET \1 RET ;; remove space before sem, bang, quest C-M-% _+ RET _ RET ;; collapse all instances of multiple spaces to one space Ed