From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "B. T. Raven" Newsgroups: gmane.emacs.help Subject: Re: What's wrong with this seemingly simple function for unwrapping text? Date: Fri, 12 Jan 2007 09:01:03 -0600 Organization: UseNetServer.com Message-ID: <8b320$45a7a2d4$49fa728$13273@DIALUPUSA.NET> References: <1168599607.154137.166990@q2g2000cwa.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1168616435 3928 80.91.229.12 (12 Jan 2007 15:40:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 12 Jan 2007 15:40:35 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 12 16:40:33 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 1H5OW4-0005gb-MZ for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Jan 2007 16:40:28 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H5OW4-0001eh-Iv for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Jan 2007 10:40:28 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!bloom-beacon.mit.edu!4.24.21.218.MISMATCH!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!208.49.83.154.MISMATCH!uns-out.usenetserver.com!news.usenetserver.com!pc03.usenetserver.com!DIALUPUSA.NET!not-for-mail Original-Newsgroups: gnu.emacs.help X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Original-X-Complaints-To: abuse@usenetserver.com Original-Lines: 41 Original-X-Trace: 8b32045a7a2d4a13a028d13273 Original-Xref: shelby.stanford.edu gnu.emacs.help:144656 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:40260 Archived-At: "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