help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bind the value of a function to a variable


From: Nikolaj Schumacher
Subject: Re: Bind the value of a function to a variable
Date: Thu, 02 Oct 2008 00:21:54 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2.50 (darwin)

Rodolfo Medina <rodolfo.medina@gmail.com> wrote:

> Thanks.
> I want to try to bind this to a variable, but don't know the right syntax.  I
> want to do something like:
>
> (setq scroll-default-lines (1+ (count-lines (window-start) (window-end))))
>
> , but get error.  How can I do that the right way?

What error do you get?
You are correctly /assigning/ the value to a variable.  To /bind/ a
variable, you'll need to use `let'.

(let ((scroll-default-lines
           (1+ (count-lines (window-start) (window-end)))))
  ;; use scroll-default-lines here
  (setq scroll-default-lines 'something-else))

regards,
Nikolaj Schumacher




reply via email to

[Prev in Thread] Current Thread [Next in Thread]