unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "B. T. Raven" <ecinmn@alcisp.com>
Subject: Re: What's wrong with this seemingly simple function for unwrapping text?
Date: Fri, 12 Jan 2007 09:01:03 -0600	[thread overview]
Message-ID: <8b320$45a7a2d4$49fa728$13273@DIALUPUSA.NET> (raw)
In-Reply-To: 1168599607.154137.166990@q2g2000cwa.googlegroups.com


"Endless Story" <usable.thought@gmail.com> wrote in message
news:1168599607.154137.166990@q2g2000cwa.googlegroups.com...
> I like autofill mode, but it has one disadvantage: the filled lines
> require unfilling if I want to copy the text over into a Word
> processor, e.g. Word or OpenOffice. This can be rather tedious, so I
> thought I would write a simple function and put it in my .init file to
> make everything easy:
>
> (defun unwrap-text ()
>   (interactive)
>   (setq fill-column 5000)
>   (mark-whole-buffer)
>   (fill-region)
>   (setq fill-column '70)
> )
>
> When the function gets to fill-region, it bombs out, complaining about
> 'wrong number of variables.'  So my questions are:
>
> 1) For any lisp experts, what's going wrong here?
> 2) Is there some built-in way for doing what I want to do?
>

Tassilo already fixed your problem but here are two more, in case you
might not always want to affect the whole buffer:

(defun unfill-paragraph ()   "Do the opposite of fill-paragraph; stuff all
lines in the current paragraph into a single long line."
  (interactive)
  (let ((fill-column 90002000))
    (fill-paragraph nil)))

(defun unfill-region ()   "Do the opposite of fill-region; stuff all
paragraphs in the current region into long lines."
  (interactive)
  (let ((fill-column 90002000))
    (fill-region (point) (mark))))

Ed

  parent reply	other threads:[~2007-01-12 15:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-12 11:00 What's wrong with this seemingly simple function for unwrapping text? Endless Story
2007-01-12 11:28 ` Tassilo Horn
2007-01-12 15:01 ` B. T. Raven [this message]
2007-01-13 12:18   ` Endless Story

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='8b320$45a7a2d4$49fa728$13273@DIALUPUSA.NET' \
    --to=ecinmn@alcisp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).