From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Robert Thorpe Newsgroups: gmane.emacs.help Subject: Re: Basic emacs lisp question Date: Wed, 10 Sep 2014 01:49:58 +0100 Message-ID: <87k35cmh8p.fsf@robertthorpeconsulting.com> References: <87wq9cwhmq.fsf@debian.uxu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1410310235 14998 80.91.229.3 (10 Sep 2014 00:50:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 10 Sep 2014 00:50:35 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Emanuel Berg Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 10 02:50:27 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XRW79-0003z4-M7 for geh-help-gnu-emacs@m.gmane.org; Wed, 10 Sep 2014 02:50:27 +0200 Original-Received: from localhost ([::1]:52592 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRW79-0001z7-9Y for geh-help-gnu-emacs@m.gmane.org; Tue, 09 Sep 2014 20:50:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55462) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRW6r-0001ws-Dm for help-gnu-emacs@gnu.org; Tue, 09 Sep 2014 20:50:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XRW6k-0004Fe-Nc for help-gnu-emacs@gnu.org; Tue, 09 Sep 2014 20:50:09 -0400 Original-Received: from outbound-smtp02.blacknight.com ([81.17.249.8]:35805) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRW6k-000499-Gz for help-gnu-emacs@gnu.org; Tue, 09 Sep 2014 20:50:02 -0400 Original-Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp02.blacknight.com (Postfix) with ESMTP id 885E9988DA for ; Wed, 10 Sep 2014 00:48:33 +0000 (UTC) Original-Received: (qmail 17928 invoked from network); 10 Sep 2014 00:50:00 -0000 Original-Received: from unknown (HELO RTLaptop) (rt@robertthorpeconsulting.com@[109.78.222.91]) by 81.17.254.9 with ESMTPSA (DHE-RSA-AES128-SHA encrypted, authenticated); 10 Sep 2014 00:49:59 -0000 In-Reply-To: <87wq9cwhmq.fsf@debian.uxu> (message from Emanuel Berg on Wed, 10 Sep 2014 00:31:25 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 81.17.249.8 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:99758 Archived-At: Emanuel Berg writes: > Ken writes: > >> OK, I will try changing it to let, but I don't think >> it will improve the functionality. :-) > > Well, perhaps not in isolation. The advantage of let is > rather when you have several functions (even hundreds), > all available at the same time, at the base level. And, > it might be wise to practice good form from the very > start with Elisp. Yes. It's also useful if the code could be running in two different buffers at once. By default variables created with setq on it's own have global scope, so if the code is running in two different buffers things will get confused. A useful half-way house is to make variables buffer local using make-local-variable. BR, Robert Thorpe