unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* unfill/defill
@ 2003-03-31  7:23 Chris
  2003-03-31  8:41 ` unfill/defill David Kastrup
  2003-03-31 13:11 ` unfill/defill Gareth Rees
  0 siblings, 2 replies; 3+ messages in thread
From: Chris @ 2003-03-31  7:23 UTC (permalink / raw)


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...

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: unfill/defill
  2003-03-31  7:23 unfill/defill Chris
@ 2003-03-31  8:41 ` David Kastrup
  2003-03-31 13:11 ` unfill/defill Gareth Rees
  1 sibling, 0 replies; 3+ messages in thread
From: David Kastrup @ 2003-03-31  8:41 UTC (permalink / raw)


Chris <chrisl_ak@hotmail.com> writes:

> 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...

M-1000000 C-x f M-x fill-region RET

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: unfill/defill
  2003-03-31  7:23 unfill/defill Chris
  2003-03-31  8:41 ` unfill/defill David Kastrup
@ 2003-03-31 13:11 ` Gareth Rees
  1 sibling, 0 replies; 3+ messages in thread
From: Gareth Rees @ 2003-03-31 13:11 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-03-31 13:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-31  7:23 unfill/defill Chris
2003-03-31  8:41 ` unfill/defill David Kastrup
2003-03-31 13:11 ` unfill/defill Gareth Rees

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).