From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Why is Elisp's defvar weird? And is eval_sub broken? Date: Thu, 19 Feb 2015 08:23:55 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1424352268 28925 80.91.229.3 (19 Feb 2015 13:24:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Feb 2015 13:24:28 +0000 (UTC) Cc: emacs-devel@gnu.org To: Kelly Dean Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 19 14:24:15 2015 Return-path: Envelope-to: ged-emacs-devel@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 1YOR5S-0004Iu-DK for ged-emacs-devel@m.gmane.org; Thu, 19 Feb 2015 14:24:14 +0100 Original-Received: from localhost ([::1]:56327 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOR5R-00082g-PY for ged-emacs-devel@m.gmane.org; Thu, 19 Feb 2015 08:24:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOR5E-00082T-J7 for emacs-devel@gnu.org; Thu, 19 Feb 2015 08:24:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YOR5B-0000hv-F6 for emacs-devel@gnu.org; Thu, 19 Feb 2015 08:24:00 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:42726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOR5B-0000hZ-9N for emacs-devel@gnu.org; Thu, 19 Feb 2015 08:23:57 -0500 Original-Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id t1JDNt4l020920; Thu, 19 Feb 2015 08:23:55 -0500 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 1C5E9AE11B; Thu, 19 Feb 2015 08:23:55 -0500 (EST) In-Reply-To: (Kelly Dean's message of "Thu, 19 Feb 2015 10:32:27 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5222=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5222> : inlines <2238> : streams <1392853> : uri <1859314> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:183295 Archived-At: > If they're locally special, then I have to declare them in my code too, > before I let-bind them so I can call desktop-create-buffer (which barfs if > I don't), even though I don't use them. > For my code, see line 942 (and 97 for the macro that generates the declar= ations) of: > http://prtime.org/emacs/usablizer.el > That's no problem, but I wanted to make sure you really do want variables= to > have to be re-declared like that. Your code is clearly meant to be inside desktop.el, so it's perfectly normal to have to add various extra declarations to reproduce some context before calling internal functions. > This is where I was previously just doing setq (followed by makunbound af= ter > calling desktop-create-buffer), until I discovered that I can do defvar > followed by =ABlet=BB. A general rule is that if you need makunbound you're probably doing something wrong. Stefan