From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: elisp how to insert text at end of each line Date: Thu, 11 Apr 2013 12:50:33 +0200 Message-ID: <51669579.5080707@easy-emacs.de> References: <1365614909301-283410.post@n5.nabble.com> <87obdmxnhd.fsf@gmail.com> <1365675809309-283460.post@n5.nabble.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1365677357 32547 80.91.229.3 (11 Apr 2013 10:49:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 11 Apr 2013 10:49:17 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Apr 11 12:49:19 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UQF4A-0001eC-H3 for geh-help-gnu-emacs@m.gmane.org; Thu, 11 Apr 2013 12:49:18 +0200 Original-Received: from localhost ([::1]:46785 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQF47-0002kY-Ck for geh-help-gnu-emacs@m.gmane.org; Thu, 11 Apr 2013 06:49:15 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:49888) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQF3r-0002iV-Hw for help-gnu-emacs@gnu.org; Thu, 11 Apr 2013 06:49:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQF3q-0000Vc-AX for help-gnu-emacs@gnu.org; Thu, 11 Apr 2013 06:48:59 -0400 Original-Received: from moutng.kundenserver.de ([212.227.17.9]:49703) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQF3q-0000VM-1C for help-gnu-emacs@gnu.org; Thu, 11 Apr 2013 06:48:58 -0400 Original-Received: from [192.168.178.21] (brln-4db9cae2.pool.mediaWays.net [77.185.202.226]) by mrelayeu.kundenserver.de (node=mreu4) with ESMTP (Nemesis) id 0MgUqY-1UBRUs0rMk-00NrNd; Thu, 11 Apr 2013 12:48:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 In-Reply-To: <1365675809309-283460.post@n5.nabble.com> X-Provags-ID: V02:K0:2FDZgbWXu2QEXU0JBhV1IktpLBiFFLcC2MEY9gn0QUz NBmJraVSWcczgV+M9Ccc8VARaZZ8stHDxOzaSz1yOwbqqE92ax YbF3oCkTJAFeF/gE7RlkyrqaX8EW4Vv6Sf+e4hVzE9VkerBUOG yy1Gx+1ZW+V9mmoonPvGJvxSCvLQvU+Gn8zHAYUzGylIoYI8lW BmXwImZZCUCwh3GUD2bqbsJa9aTc5lIksOjCridIardquGoQN9 xMBC3q2DXvNd6D5Fffc3sR02j/rXW0Ophjy3+lelhMDp36hb4q pXAOg9kUbPIeKbsyrZivLpOX4Nua9UHsrVNexOXitYF9p6gwvi OuJtthL1LwPqB2xkHQcdb2jtapYadeW/V5uHs5eiS X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.17.9 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:90082 Archived-At: Am 11.04.2013 12:23, schrieb acomber: > That works, thanks. I implemented as a function which inserted literal text. > > But I like the idea of being able to pass parameters to the function. so I > tried this: > > (defun insert-at-end-of-line (text) > "convert word tbl to html tbl" > (interactive) > (goto-char (point-min)) > (while (not (eobp)) > (end-of-line) > (insert text) > (next-line) > ) > ) > > But then in emacs how do I pass the text parameter? > > I keep getting: > > call-interactively: Wrong number of arguments: (lambda (text) "convert word > tbl to html tbl" (interactive) (goto-char (point-min)) (while (not (eobp)) > (end-of-line) (insert text) (next-line))), 0 > > Do I have to specify somewhere that function takes parameters??? > > > > -- > View this message in context: http://emacs.1067599.n5.nabble.com/elisp-how-to-insert-text-at-end-of-each-line-tp283410p283460.html > Sent from the Emacs - Help mailing list archive at Nabble.com. > > that's probably not the best way to do it, just to play on, fill the text at the (invisible) prompt in the minibuffer (defun insert-at-end-of-line (text) "convert word tbl to html tbl" (interactive "*M") (goto-char (point-min)) (while (not (eobp)) (end-of-line) (insert text) (forward-line 1))) BTW use forward-line in programs, as next-line is designed for interactive use.