all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: How can url-show-status be void when (featurep 'url-vars) is t?
Date: Mon, 28 Jun 2010 23:45:59 -0600	[thread overview]
Message-ID: <i0c1ai$paa$1@dough.gmane.org> (raw)
In-Reply-To: <AANLkTinYhUMrujKN2-c9Pvmrn0i18nBhkdkJuUhmd_5v@mail.gmail.com>

Lennart Borgman wrote:
> On Sun, Jun 27, 2010 at 8:08 PM, Andreas Schwab <schwab@linux-m68k.org> wrote:
>> Lennart Borgman <lennart.borgman@gmail.com> 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




  reply	other threads:[~2010-06-29  5:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-27  0:32 How can url-show-status be void when (featurep 'url-vars) is t? Lennart Borgman
2010-06-27 18:08 ` Andreas Schwab
2010-06-27 22:06   ` Lennart Borgman
2010-06-29  5:45     ` Kevin Rodgers [this message]
2010-06-29  9:51       ` Lennart Borgman
2010-07-01  0:43         ` Stefan Monnier
2010-07-01  6:21           ` David Kastrup
2010-06-27 18:13 ` Chong Yidong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='i0c1ai$paa$1@dough.gmane.org' \
    --to=kevin.d.rodgers@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.