From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Endless Story" Newsgroups: gmane.emacs.help Subject: Re: What's wrong with this seemingly simple function for unwrapping text? Date: 13 Jan 2007 04:18:33 -0800 Organization: http://groups.google.com Message-ID: <1168690711.972010.208040@a75g2000cwd.googlegroups.com> References: <1168599607.154137.166990@q2g2000cwa.googlegroups.com> <8b320$45a7a2d4$49fa728$13273@DIALUPUSA.NET> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: sea.gmane.org 1168692073 15443 80.91.229.12 (13 Jan 2007 12:41:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 13 Jan 2007 12:41:13 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jan 13 13:41:10 2007 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.50) id 1H5iC0-0002C4-HY for geh-help-gnu-emacs@m.gmane.org; Sat, 13 Jan 2007 13:41:04 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H5iC0-00083s-DD for geh-help-gnu-emacs@m.gmane.org; Sat, 13 Jan 2007 07:41:04 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!a75g2000cwd.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 47 Original-NNTP-Posting-Host: 70.18.48.204 Original-X-Trace: posting.google.com 1168690720 6456 127.0.0.1 (13 Jan 2007 12:18:40 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sat, 13 Jan 2007 12:18:40 +0000 (UTC) In-Reply-To: <8b320$45a7a2d4$49fa728$13273@DIALUPUSA.NET> User-Agent: G2/1.0 X-HTTP-UserAgent: Opera/9.02 (Windows NT 5.1; U; en),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: a75g2000cwd.googlegroups.com; posting-host=70.18.48.204; posting-account=JP8pbg0AAADYDr61n41ZYs45c0xuivey Original-Xref: shelby.stanford.edu gnu.emacs.help:144676 Original-To: help-gnu-emacs@gnu.org 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:40280 Archived-At: Thanks to all. Via a quick Google I also found good recipes for unfilling paragraph, region, or paragraphs with region, all by Sean Burke at http://interglacial.com/~sburke/pub/emacs/sburke_dot_emacs.config B. T. Raven wrote: > "Endless Story" 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