From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kelly Dean Newsgroups: gmane.emacs.devel Subject: Re: Why is Elisp's defvar weird? And is eval_sub broken? Date: Thu, 19 Feb 2015 10:32:27 +0000 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1424342053 19894 80.91.229.3 (19 Feb 2015 10:34:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Feb 2015 10:34:13 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 19 11:33:58 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 1YOOQf-0001FC-Jk for ged-emacs-devel@m.gmane.org; Thu, 19 Feb 2015 11:33:57 +0100 Original-Received: from localhost ([::1]:55669 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOOQe-0007HT-Ow for ged-emacs-devel@m.gmane.org; Thu, 19 Feb 2015 05:33:56 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOOQa-0007HM-Gk for emacs-devel@gnu.org; Thu, 19 Feb 2015 05:33:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YOOQW-0002Zc-Gg for emacs-devel@gnu.org; Thu, 19 Feb 2015 05:33:52 -0500 Original-Received: from relay6-d.mail.gandi.net ([2001:4b98:c:538::198]:49733) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOOQW-0002ZW-Aw for emacs-devel@gnu.org; Thu, 19 Feb 2015 05:33:48 -0500 Original-Received: from mfilter37-d.gandi.net (mfilter37-d.gandi.net [217.70.178.168]) by relay6-d.mail.gandi.net (Postfix) with ESMTP id 940F0FB8C7; Thu, 19 Feb 2015 11:33:47 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter37-d.gandi.net Original-Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by mfilter37-d.gandi.net (mfilter37-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id Hm+SOdXOjMeP; Thu, 19 Feb 2015 11:33:46 +0100 (CET) X-Originating-IP: 66.220.3.179 Original-Received: from localhost (gm179.geneticmail.com [66.220.3.179]) (Authenticated sender: kelly@prtime.org) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 0DDB0FB882; Thu, 19 Feb 2015 11:33:44 +0100 (CET) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4b98:c:538::198 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:183288 Archived-At: Stefan Monnier wrote: >> In that case, should desktop-first-buffer, desktop-buffer-ok-count, an= d >> desktop-buffer-fail-count be given init values to prevent local specia= lness, >> so that code outside desktop.el that calls desktop functions that use = those >> variables doesn't have to do defvar on them? > > We could, but AFAICT, these vars are only used in desktop.el (they > could/should use a double-dash to indicate that they're internal), so i= t > would be kind of pointless. If they're locally special, then I have to declare them in my code too, b= efore 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. 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 defv= ar followed by =C2=ABlet=C2=BB.