From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: Refilling paragraphs to remove hard returns? Date: Wed, 5 May 2010 06:12:20 -0700 (PDT) Organization: http://groups.google.com Message-ID: <8841ab9d-750c-48af-8cfa-567f55ac5a2f@31g2000prc.googlegroups.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1273087690 28438 80.91.229.12 (5 May 2010 19:28:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 5 May 2010 19:28:10 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 05 21:28:08 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 1O9kGL-0008Pq-FU for geh-help-gnu-emacs@m.gmane.org; Wed, 05 May 2010 21:28:05 +0200 Original-Received: from localhost ([127.0.0.1]:59510 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9kGK-0008D8-KP for geh-help-gnu-emacs@m.gmane.org; Wed, 05 May 2010 15:28:04 -0400 Original-Path: usenet.stanford.edu!postnews.google.com!31g2000prc.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs Original-Lines: 55 Original-NNTP-Posting-Host: 76.102.12.87 Original-X-Trace: posting.google.com 1273065140 22139 127.0.0.1 (5 May 2010 13:12:20 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 5 May 2010 13:12:20 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 31g2000prc.googlegroups.com; posting-host=76.102.12.87; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.1.249.1064 Safari/532.5,gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:177948 comp.emacs:99806 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:73473 Archived-At: On May 5, 4:50=C2=A0am, jes...@panix.com (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? > > Thanks. > > Jesse Sheidlower there's unfill-region or something builtin in emacs i think since 22, but isn't loaded by default... (or was it in ) anyway, there's code here: =E2=80=A2 Suggestions on Emacs's Line-Cutting Commands http://xahlee.org/emacs/modernization_fill-paragraph.html or, if you want a simple code, use this: (defun remove-line-breaks () "Remove line endings in a paragraph." (interactive) (let ((fill-column (point-max))) (fill-paragraph nil))) from: =E2=80=A2 Emacs Lisp Examples http://xahlee.org/emacs/elisp_examples.html Xah =E2=88=91 http://xahlee.org/ =E2=98=84