all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How can url-show-status be void when (featurep 'url-vars) is t?
@ 2010-06-27  0:32 Lennart Borgman
  2010-06-27 18:08 ` Andreas Schwab
  2010-06-27 18:13 ` Chong Yidong
  0 siblings, 2 replies; 8+ messages in thread
From: Lennart Borgman @ 2010-06-27  0:32 UTC (permalink / raw)
  To: Emacs-Devel devel

It looks impossible to me that url-show-status is void as a variable
when url-vars.elc has been loaded, but that is what I see here. Also
url-show-status seems to have been initialized by defcustom since it
has (standard-value (t)) in the property list.

url-show-status is a boolean defcustom without any :set function. So
custom-initialize-reset should have created the variable by calling
set-default.

Any ideas how then url-show-status can be void after loading url-vars?



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How can url-show-status be void when (featurep 'url-vars) is t?
  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-27 18:13 ` Chong Yidong
  1 sibling, 1 reply; 8+ messages in thread
From: Andreas Schwab @ 2010-06-27 18:08 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Emacs-Devel devel

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

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How can url-show-status be void when (featurep 'url-vars) is t?
  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 18:13 ` Chong Yidong
  1 sibling, 0 replies; 8+ messages in thread
From: Chong Yidong @ 2010-06-27 18:13 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Emacs-Devel devel

Lennart Borgman <lennart.borgman@gmail.com> writes:

> It looks impossible to me that url-show-status is void as a variable
> when url-vars.elc has been loaded, but that is what I see here. Also
> url-show-status seems to have been initialized by defcustom since it
> has (standard-value (t)) in the property list.
>
> url-show-status is a boolean defcustom without any :set function. So
> custom-initialize-reset should have created the variable by calling
> set-default.
>
> Any ideas how then url-show-status can be void after loading url-vars?

I can't reproduce this.  Maybe you have a rogue `provide' in your code.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How can url-show-status be void when (featurep 'url-vars) is t?
  2010-06-27 18:08 ` Andreas Schwab
@ 2010-06-27 22:06   ` Lennart Borgman
  2010-06-29  5:45     ` Kevin Rodgers
  0 siblings, 1 reply; 8+ messages in thread
From: Lennart Borgman @ 2010-06-27 22:06 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Emacs-Devel devel

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.

Wouldn't it be possible for defvar, defcustom etc to detect that situation?



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How can url-show-status be void when (featurep 'url-vars) is t?
  2010-06-27 22:06   ` Lennart Borgman
@ 2010-06-29  5:45     ` Kevin Rodgers
  2010-06-29  9:51       ` Lennart Borgman
  0 siblings, 1 reply; 8+ messages in thread
From: Kevin Rodgers @ 2010-06-29  5:45 UTC (permalink / raw)
  To: emacs-devel

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




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How can url-show-status be void when (featurep 'url-vars) is t?
  2010-06-29  5:45     ` Kevin Rodgers
@ 2010-06-29  9:51       ` Lennart Borgman
  2010-07-01  0:43         ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Lennart Borgman @ 2010-06-29  9:51 UTC (permalink / raw)
  To: Kevin Rodgers; +Cc: emacs-devel

On Tue, Jun 29, 2010 at 7:45 AM, Kevin Rodgers
<kevin.d.rodgers@gmail.com> wrote:
> 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.
>
>> 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;
>                }
>            }
>        }


Thanks, but should not that be an error?



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How can url-show-status be void when (featurep 'url-vars) is t?
  2010-06-29  9:51       ` Lennart Borgman
@ 2010-07-01  0:43         ` Stefan Monnier
  2010-07-01  6:21           ` David Kastrup
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2010-07-01  0:43 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Kevin Rodgers, emacs-devel

>>                  message_with_string ("Warning: defvar ignored because %s is
>> let-bound",
>>                                       SYMBOL_NAME (sym), 1);

> Thanks, but should not that be an error?

Feel free to turn it into an error: I think that's what it *should* do,
but backward compatibility means we should accept it.


        Stefan



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How can url-show-status be void when (featurep 'url-vars) is t?
  2010-07-01  0:43         ` Stefan Monnier
@ 2010-07-01  6:21           ` David Kastrup
  0 siblings, 0 replies; 8+ messages in thread
From: David Kastrup @ 2010-07-01  6:21 UTC (permalink / raw)
  To: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>>                  message_with_string ("Warning: defvar ignored because %s is
>>> let-bound",
>>>                                       SYMBOL_NAME (sym), 1);
>
>> Thanks, but should not that be an error?
>
> Feel free to turn it into an error: I think that's what it *should* do,
> but backward compatibility means we should accept it.

I don't think we should bother all too much about preserving
compatibility to what never was anything but an error.

-- 
David Kastrup




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-07-01  6:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.