From: Barry Margolin <barmar@alum.mit.edu>
To: help-gnu-emacs@gnu.org
Subject: Re: elisp errors
Date: Thu, 22 Jan 2009 22:48:11 -0500 [thread overview]
Message-ID: <barmar-DDB192.22481122012009@mara100-84.onlink.net> (raw)
In-Reply-To: 26488aad-8ff8-4dda-bda5-ce5036de3617@w39g2000prb.googlegroups.com
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 ***
next prev parent reply other threads:[~2009-01-23 3:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-22 16:56 elisp errors synhedionn
2009-01-23 3:48 ` Barry Margolin [this message]
2009-01-23 20:27 ` synhedionn
2009-01-24 4:19 ` Barry Margolin
2009-02-01 2:52 ` Samuel Wales
[not found] ` <mailman.6394.1233456736.26697.help-gnu-emacs@gnu.org>
2009-02-01 2:58 ` Barry Margolin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=barmar-DDB192.22481122012009@mara100-84.onlink.net \
--to=barmar@alum.mit.edu \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.