From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jonathan Groll Newsgroups: gmane.emacs.help Subject: Re: Refilling paragraphs to remove hard returns? Date: Fri, 7 May 2010 07:38:12 +0200 Message-ID: <20100507053812.GB24563@groll.co.za> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed X-Trace: dough.gmane.org 1273236324 7067 80.91.229.12 (7 May 2010 12:45:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 7 May 2010 12:45:24 +0000 (UTC) To: Jesse Sheidlower , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 07 14:45:21 2010 connect(): No such file or directory Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OAMvf-0007Q3-Bz for geh-help-gnu-emacs@m.gmane.org; Fri, 07 May 2010 14:45:19 +0200 Original-Received: from localhost ([127.0.0.1]:34821 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OAMve-0003Mt-Oh for geh-help-gnu-emacs@m.gmane.org; Fri, 07 May 2010 08:45:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1OAGGQ-0006nL-3o for help-gnu-emacs@gnu.org; Fri, 07 May 2010 01:38:18 -0400 Original-Received: from [140.186.70.92] (port=59359 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OAGGO-0006la-Fp for help-gnu-emacs@gnu.org; Fri, 07 May 2010 01:38:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OAGGN-0007Iy-13 for help-gnu-emacs@gnu.org; Fri, 07 May 2010 01:38:16 -0400 Original-Received: from mail.groll.co.za ([166.84.7.40]:35047) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OAGGM-0007Ih-Um for help-gnu-emacs@gnu.org; Fri, 07 May 2010 01:38:14 -0400 Original-Received: by mail.groll.co.za (Postfix, from userid 1004) id B125F5F19E; Fri, 7 May 2010 07:38:12 +0200 (SAST) Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (Linux mail 2.6.28-xen3-U-64 x86_64) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) 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:73556 Archived-At: On Wed, May 05, 2010 at 07:50:55AM -0400, Jesse Sheidlower wrote: > >I imagine this is a common problem, so I don't know why I'm >having so much trouble finding an answer. > >Suppose I have a text document that I've worked on in >text-mode. It is filled using the usual fill tools, so it >wraps at 72 characters, with a hard return after each line. >Paragraphs are separated by an extra hard return; there's no >other indentation. > >I now need to give this document to someone who wants to work >on it in a word processor, who complains that there are hard >returns after every line. What's the easy way to remove these? > >Going forward, I could work on such documents in >longlines-mode. But it's not clear how to fix what I have. The >trick mentioned in the Emacs wiki of resetting fill-column to >a large number and then refilling the region doesn't work, >because each paragraph is seen as one line, rather than the >block of text set off by two newlines. Yes, I can regex >replace all examples of return (not followed by another >return) with a space, but I'd think there must be something >more organic. > >What trick am I missing? I'm not sure why no-one has mentioned it but my Emacs (GNU Emacs 23.1.90.1) comes standard (I think!) with unfill-individual-paragraphs: unfill-individual-paragraphs is an interactive Lisp function in `ourcomments-util.el'. (unfill-individual-paragraphs) Unfill individual paragraphs in the current region. This sounds exactly like what you need. Cheers, Jonathan