From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: What's wrong with this seemingly simple function for unwrapping text? Date: Fri, 12 Jan 2007 12:28:36 +0100 Organization: University Koblenz-Landau Campus Koblenz Message-ID: <87ac0o1o2j.fsf@baldur.tsdh.de> References: <1168599607.154137.166990@q2g2000cwa.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1168605628 27647 80.91.229.12 (12 Jan 2007 12:40:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 12 Jan 2007 12:40:28 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 12 13:40:25 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 1H5Lhk-00012y-TO for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Jan 2007 13:40:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H5Lhk-0005ys-O5 for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Jan 2007 07:40:20 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!news.uni-kl.de!cache.uni-koblenz.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 81 Original-NNTP-Posting-Host: dslb-084-063-018-171.pools.arcor-ip.net Original-X-Trace: cache.uni-koblenz.de 1168601317 26795 84.63.18.171 (12 Jan 2007 11:28:37 GMT) Original-X-Complaints-To: news@cache.uni-koblenz.de Original-NNTP-Posting-Date: Fri, 12 Jan 2007 11:28:37 +0000 (UTC) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAD1BMVEW2mhnYvEn26qD+/vbC t5CEWCLiAAAACXBIWXMAAAsSAAALEgHS3X78AAAATnRFWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYA CmV4aWYKICAgICAgMjAKNDU3ODY5NjYwMDAwNGQ0ZDAwMmEwMDAwMDAwODAwMDAwMDAwMDAwMAqJ uBZbAAAACXZwQWcAAAAwAAAAMADO7oxXAAABkElEQVQ4y3WTDZLCIAyFQ08A6AFK0gNowgG6de9/ pn2Bau22ZRyF+ZKXX8lOjqZs1K9i+gUmStKAxmzTsjlECtwBEUfKb1CJKDvQkfwEWUFZCsD0shpi I8MbZAWoQWNI+KS3S2VhACaolwSAXzGkUD0ok7q4liwID4vFJAGEG1DIorDV4pGmXBCKka7GJPb0 ItwlIMHsHkJQMftlPKQQIVDA+wmAXgi70pg5pTyiGwC5t2SCw0LBOHNJ3oDH2sQf2CciETXNMLKx A82IhtCtbV6kQsJfT+aYuJB8+jtIA/OQiK3QNpDUgZeMtDYA7QZQl0fsUn6rK4heE+I36+WFvnMH paVobYJ6l5Ztr0M+IlgQr0vMvlKRPj0X5R1oDuXmXnICpDV9B6ooeugX//oCs2ry8dlzDyCASd2O HtNg2CC/jbwDMybYd24PoMSx8HugG3gMUoZtIhuYuRV3ANXX8XUCvIBRjkDjDStgR1CD/PuDrmDM dg7i6xwclVZQDkoriHwB7nYBlgugcgXsSurk/AEJvb3wF7X09QAAABp6VFh0SlBFRy1Db2xvcnNw YWNlAAB42jMCAAAzADMRFn5jAAAAJ3pUWHRKUEVHLVNhbXBsaW5nLWZhY3RvcnMAAHjaM6ow0jGs MARhABGDAulkDxtiAAAAAElFTkSuQmCC User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.92 (gnu/linux) Cancel-Lock: sha1:OvoWYsdK25OhshPp0WqT1eYqqP8= Original-Xref: shelby.stanford.edu gnu.emacs.help:144653 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:40257 Archived-At: "Endless Story" writes: Hi, > (defun unwrap-text () > (interactive) > (setq fill-column 5000) > (mark-whole-buffer) ^^^^^^^^^^^^^^^^^ ,----[ C-h f mark-whole-buffer RET ] | mark-whole-buffer is an interactive compiled Lisp function in `simple.el'. | It is bound to C-x h, . | (mark-whole-buffer) | | Put point at beginning and mark at end of buffer. | You probably should not use this function in Lisp programs; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | it is usually a mistake for a Lisp function to use any subroutine | that uses or sets the mark. `---- > (fill-region) ^^^^^^^^^^^ That function has two mandatory arguments. ,----[ C-h f fill-region RET ] | fill-region is an interactive compiled Lisp function in `fill.el'. | It is bound to . | (fill-region FROM TO &optional JUSTIFY NOSQUEEZE TO-EOP) | ^^^^ ^^ | Fill each of the paragraphs in the region. | A prefix arg means justify as well. | Ordinarily the variable `fill-column' controls the width. | | Noninteractively, the third argument JUSTIFY specifies which | kind of justification to do: `full', `left', `right', `center', | or `none' (equivalent to nil). t means handle each paragraph | as specified by its text properties. | | The fourth arg NOSQUEEZE non-nil means to leave | whitespace other than line breaks untouched, and fifth arg TO-EOP | non-nil means to keep filling to the end of the paragraph (or next | hard newline, if variable `use-hard-newlines' is on). | | Return the fill-prefix used for filling the last paragraph. | | If `sentence-end-double-space' is non-nil, then period followed by one | space does not end a sentence, so don't break a line there. `---- > (setq fill-column '70) ^ The quote is quite irritating. > ) > > 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? See above. > 2) Is there some built-in way for doing what I want to do? Don't think so, but this should work: --8<---------------cut here---------------start------------->8--- (defun unwrap-text () (interactive) (let ((fill-column 9999)) (fill-region (point-min) (point-max)))) --8<---------------cut here---------------end--------------->8--- Regards, Tassilo -- * delYsid has mortgage, opportunity and penis in his score file. thats pretty effective against spam aren't you worried about missing opportunities to mortgage your penis?