From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.devel Subject: Re: How can url-show-status be void when (featurep 'url-vars) is t? Date: Mon, 28 Jun 2010 23:45:59 -0600 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1277790381 26002 80.91.229.12 (29 Jun 2010 05:46:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 29 Jun 2010 05:46:21 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 29 07:46:20 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OTTeG-0000o3-6K for ged-emacs-devel@m.gmane.org; Tue, 29 Jun 2010 07:46:20 +0200 Original-Received: from localhost ([127.0.0.1]:44283 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OTTeF-0005SI-Hi for ged-emacs-devel@m.gmane.org; Tue, 29 Jun 2010 01:46:19 -0400 Original-Received: from [140.186.70.92] (port=52152 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OTTe6-0005SC-Nb for emacs-devel@gnu.org; Tue, 29 Jun 2010 01:46:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OTTe5-0002QO-EV for emacs-devel@gnu.org; Tue, 29 Jun 2010 01:46:10 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:52437) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OTTe5-0002Q8-40 for emacs-devel@gnu.org; Tue, 29 Jun 2010 01:46:09 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OTTe0-0000jw-HK for emacs-devel@gnu.org; Tue, 29 Jun 2010 07:46:04 +0200 Original-Received: from c-71-237-24-138.hsd1.co.comcast.net ([71.237.24.138]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 29 Jun 2010 07:46:04 +0200 Original-Received: from kevin.d.rodgers by c-71-237-24-138.hsd1.co.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 29 Jun 2010 07:46:04 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 47 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: c-71-237-24-138.hsd1.co.comcast.net User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:126493 Archived-At: Lennart Borgman wrote: > On Sun, Jun 27, 2010 at 8:08 PM, Andreas Schwab wrote: >> Lennart Borgman writes: >> >>> Any ideas how then url-show-status can be void after loading url-vars? >> ELISP> (let (url-show-status) (load "url-vars")) >> t >> ELISP> (boundp 'url-show-status) >> nil > > Ah, thanks. I managed to move (require 'url-vars) inside the let-clause. > > That is pretty easy to do when you are restructuring something. I did > not notice until many months later so I had forgotten about the change > of course. `C-h f defvar' If SYMBOL has a local binding, then this form affects the local binding. This is usually not what you want. Thus, if you need to load a file defining variables, with this form or with `defconst' or `defcustom', you should always load that file _outside_ any bindings for these variables. (`defconst' and `defcustom' behave similarly in this respect.) > Wouldn't it be possible for defvar, defcustom etc to detect that situation? defvar does this: { /* Check if there is really a global binding rather than just a let binding that shadows the global unboundness of the var. */ volatile struct specbinding *pdl = specpdl_ptr; while (--pdl >= specpdl) { if (EQ (pdl->symbol, sym) && !pdl->func && EQ (pdl->old_value, Qunbound)) { message_with_string ("Warning: defvar ignored because %s is let-bound", SYMBOL_NAME (sym), 1); break; } } } -- Kevin Rodgers Denver, Colorado, USA