From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nikolaj Schumacher Newsgroups: gmane.emacs.help Subject: Re: Bind the value of a function to a variable Date: Thu, 02 Oct 2008 00:21:54 +0200 Message-ID: References: <87od24wl3x.fsf@gmail.com> <87hc7wp7zo.fsf_-_@gmail.com> <877i8sx8g4.fsf_-_@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1222900015 1912 80.91.229.12 (1 Oct 2008 22:26:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 1 Oct 2008 22:26:55 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Rodolfo Medina Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 02 00:27:53 2008 connect(): Connection refused 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 1KlAAi-00006c-MW for geh-help-gnu-emacs@m.gmane.org; Thu, 02 Oct 2008 00:27:52 +0200 Original-Received: from localhost ([127.0.0.1]:41216 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KlA9f-0000PE-Kh for geh-help-gnu-emacs@m.gmane.org; Wed, 01 Oct 2008 18:26:47 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KlA52-0005lR-9u for help-gnu-emacs@gnu.org; Wed, 01 Oct 2008 18:22:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KlA50-0005k8-5P for help-gnu-emacs@gnu.org; Wed, 01 Oct 2008 18:21:59 -0400 Original-Received: from [199.232.76.173] (port=39527 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KlA50-0005k0-0m for help-gnu-emacs@gnu.org; Wed, 01 Oct 2008 18:21:58 -0400 Original-Received: from dd18200.kasserver.com ([85.13.138.168]:37323) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KlA4z-0007b7-Ck for help-gnu-emacs@gnu.org; Wed, 01 Oct 2008 18:21:57 -0400 Original-Received: from thursday (BAH2e71.bah.pppool.de [77.135.46.113]) by dd18200.kasserver.com (Postfix) with ESMTP id 12B29183181AF; Thu, 2 Oct 2008 00:22:01 +0200 (CEST) In-Reply-To: <877i8sx8g4.fsf_-_@gmail.com> (Rodolfo Medina's message of "Wed\, 01 Oct 2008 23\:21\:47 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2.50 (darwin) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:58267 Archived-At: Rodolfo Medina 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