all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tim X <timx@nospam.dev.null>
To: help-gnu-emacs@gnu.org
Subject: Re: How come I keep getting nil on point-max?
Date: Sun, 29 Apr 2007 16:46:18 +1000	[thread overview]
Message-ID: <873b2jfzk5.fsf@lion.rapttech.com.au> (raw)
In-Reply-To: 1177786810.445099.316330@n76g2000hsh.googlegroups.com

grocery_stocker <cdalten@gmail.com> writes:

> On Apr 28, 11:42 am, Ralf Angeli <dev.n...@caeruleus.net> wrote:
>> * grocery stocker (2007-04-28) writes:
>>
>> > However, when I do
>> > (let (start (point-max)))
>>
>> > I get:
>> > nil
>>
>> > And when I do
>> > (let (start (point-max))
>> >         (message "The value is: %d" start))
>>
>> (let ((start (point-max))) ...
>>
>> --
>
> Okay, one last question. When I modify let to do the following:
> (let ((start (point-min))
>          ((end (point-max)))
>
> I get the following:
> Debugger entered--Lisp error: (invalid-function (end (point-max)))
>   ((end (point-max)))
>   eval(((end (point-max))))
>   eval-last-sexp-1(nil)
>   eval-last-sexp(nil)
> * call-interactively(eval-last-sexp)
>
> I don't get this. I thought I could assign multiple variables to let.
>

I think you need to use better indentation and re-read the elisp manual a bit
as your getting the syntax wrong. 

,----[ C-h f let RET ]
| let is a special form in `C source code'.
| (let VARLIST BODY...)
| 
| Bind variables according to VARLIST then eval BODY.
| The value of the last form in BODY is returned.
| Each element of VARLIST is a symbol (which is bound to nil)
| or a list (SYMBOL VALUEFORM) (which binds SYMBOL to the value of VALUEFORM).
| All the VALUEFORMs are evalled before any symbols are bound.
| 
| [back]
`----

so you need

(let (varlist) body)

(let (start end) 
  (message "The start is %d and end is %d" start end))

but you want to assign values when the variables are created, so you need

(let ((start (point-min))
      (end (point-max)))
  (message "The start is %d and the end is %d" start end))

HTH

Tim

-- 
tcross (at) rapttech dot com dot au

  parent reply	other threads:[~2007-04-29  6:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-28 18:31 How come I keep getting nil on point-max? grocery_stocker
2007-04-28 18:42 ` Ralf Angeli
2007-04-28 18:52   ` grocery_stocker
2007-04-28 19:03     ` Ralf Angeli
2007-04-28 20:52     ` Pascal Bourguignon
2007-04-28 19:00   ` grocery_stocker
2007-04-28 19:16     ` Joost Kremers
2007-04-29  6:46     ` Tim X [this message]
2007-04-28 19:13 ` Denis Bueno

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=873b2jfzk5.fsf@lion.rapttech.com.au \
    --to=timx@nospam.dev.null \
    --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.