From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: gareth.rees@pobox.com (Gareth Rees) Newsgroups: gmane.emacs.help Subject: Re: unfill/defill Date: 31 Mar 2003 05:11:19 -0800 Organization: http://groups.google.com/ Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1049116543 14540 80.91.224.249 (31 Mar 2003 13:15:43 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 31 Mar 2003 13:15:43 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 31 15:15:41 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18zz8W-0003m9-00 for ; Mon, 31 Mar 2003 15:15:40 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18zz89-0005JP-03 for gnu-help-gnu-emacs@m.gmane.org; Mon, 31 Mar 2003 08:15:17 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews1.google.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs Original-Lines: 30 Original-NNTP-Posting-Host: 193.112.141.206 Original-X-Trace: posting.google.com 1049116280 2716 127.0.0.1 (31 Mar 2003 13:11:20 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: 31 Mar 2003 13:11:20 GMT Original-Xref: shelby.stanford.edu gnu.emacs.help:111521 comp.emacs:78475 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:8020 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:8020 chrisl_ak@hotmail.com wrote: > I sometimes need to take a few paragraphs (2-20) from a text file > created in Emacs using auto-fill and put them into another > application. All paragraphs are separated by a blank line. What is the > simplest way to "unfill" or "defill" these paragraphs so that each > paragraph is one long line? Ideally I could highlight the whole region > with the paragraphs I need and unfill them all at once, but retain a > blank line between each one... You can "unfill" all the paragraphs in the region by setting `fill-column' to a large number and executing `fill-region', then removing blank lines between paragraphs. For example (defun unfill-region (start end) (interactive "r") (save-excursion (save-restriction (let ((fill-column (point-max))) (fill-region (point-min) (point-max) nil t) (goto-char (point-min)) (while (search-forward "\n\n" nil t) (replace-match "\n")))))) (It seems to me that on operating systems that have "rich text" clipboard formats, such as Windows and Macintosh, you ought to be able to do this by turning on Enriched Mode and then just copying and pasting. But Emacs 21 doesn't provide this.) -- Gareth Rees