From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: elisp errors Date: Thu, 22 Jan 2009 22:48:11 -0500 Organization: A noiseless patient Spider Message-ID: References: <26488aad-8ff8-4dda-bda5-ce5036de3617@w39g2000prb.googlegroups.com> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1232685657 22305 80.91.229.12 (23 Jan 2009 04:40:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Jan 2009 04:40:57 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 23 05:42:09 2009 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 1LQDrn-0002hk-4p for geh-help-gnu-emacs@m.gmane.org; Fri, 23 Jan 2009 05:42:03 +0100 Original-Received: from localhost ([127.0.0.1]:56383 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LQDqV-0006ln-Op for geh-help-gnu-emacs@m.gmane.org; Thu, 22 Jan 2009 23:40:43 -0500 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!news.motzarella.org!motzarella.org!news.motzarella.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 59 Original-X-Trace: news.eternal-september.org U2FsdGVkX1+CXC+BHKHNZm3ZeXGyyMV+/sJ75Gw3Y/0XXg+rgWdTl+NnU0QiQo1zBU7UuXkXGqT9rWP3iNDClFxPO7gZQ+/Gi6lm+lx217PNKR2SsVcP1RUW3g6Ui7dorKlqFqhjdnI= Original-X-Complaints-To: Please send complaints to abuse@motzarella.org with full headers Original-NNTP-Posting-Date: Fri, 23 Jan 2009 03:48:12 +0000 (UTC) X-Auth-Sender: U2FsdGVkX19WAutooFEYoBdmTIA7xYxwpB8GRTd3QUY= Cancel-Lock: sha1:UylRMZp7Bu4IhFBR7ceSpcRb4Eg= User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Mail-Copies-To: nobody Original-Xref: news.stanford.edu gnu.emacs.help:166256 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:61577 Archived-At: In article <26488aad-8ff8-4dda-bda5-ce5036de3617@w39g2000prb.googlegroups.com>, synhedionn@gmail.com wrote: > hi, > I try to evaluate, for doing indentation of poub.y(so C-mode): > (defun indentTabs() > (interactive) > ( save-excursion ; cf > http://www.cs.tut.fi/lintula/manual/elisp/emacs-lisp-intro-1.05/emacs-lisp-int > ro_13.html#SEC145 > restores point to its original position > ( message "coucou" ) > (goto-char (point-min)) > (let ((cpt 100)) ;double parenthese obligee > (while (> cpt 0) > ( > ((c-indent-command)); widget-forward ;TAB > ( move-beginning-of-line 0) > ( next-line 1) > > (setq cpt (1- cpt)) ; (1- cpt)) > ; ( message "cpt=%d"( 3 ) );!! parentheses autour cpt > ( message "fin partielle" ) > )) ) ) ) > > I do C-x C-e at end of command > Then , in my poub.y : M-x indentTabs > But error: Invalid read syntax: expected lambda expression (((c-indent- > command)); widget-forward ;TAB ) > What does it mean(evaluate by own your correction suggestion, please)? You have too many parentheses around the body of your while loop, and then another extra set around the call to c-indent-command. It should be: (while (> cpt 0) (c-indent-command) (move-beginning-of-line 0) (next-line 1) (setq cpt (1- cpt)) (message "fin partielle")) This can also be simplified as: (dotimes (i 100) (c-indent-command) (move-beginning-of-line 0) (next-line 1) (message "fin partielle")) Also, do you really want to write that message every time through the loop instead of at the very end? -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group ***