Subject: Re: Should url-util require url-vars?

From: Lennart Borgman <[email-masked]>
Date: Sun, 24 Jan 2010 23:49:23 +0100

On Sun, Jan 24, 2010 at 11:40 PM, Lennart Borgman
<[email-masked]> wrote:
> On Sat, Jan 23, 2010 at 11:50 PM, Chong Yidong <[email-masked]> wrote:
>>> url-show-status is defined in url-vars.el.
>>> url-http-content-length-after-change-function calls
>>> url-display-percentage which needs url-show-status.
>>>
>>> url-display-percentage is defined in url-util.el. Maybe this library
>>> should require url-vars?
>>
>> Yes.  Fixed now, thanks.
>
>
> Thanks. Unfortunately there are more trouble. And I suspect serious
> trouble. Please reopen the bug.
>
>
> This is what I get in my *Messages* buffer on w32 after explicitly
> loading url-vars.el (I have not rebuilt Emacs yet with your changes):
>
>  (featurep 'url-vars)=t, url-show-status=nil
>  error in process filter:
> url-http-content-length-after-change-function: Symbol's value as
> variable is void: url-show-status
>
> The first line is just from
>
>  (message "(featurep 'url-vars)=%s, url-show-status=%s" (featurep
> 'url-vars) url-show-status)
>
> The second line looks very strange to me since url-show-status was
> defined on the first line and it is defined in url-vars.el.

Hm, my bad. I did something like this:

  (let ((url-show-status nil)) ;; do not show download messages
    (require 'url-vars)
    (message "(featurep 'url-vars)=%s, url-show-status=%s" (featurep
'url-vars) url-show-status)
    (url-retrieve ...))

This prevented url-show-status to be defined when loading url-vars.
Placing (require 'url-vars) above the let statement fixed this.

Sorry for the trouble.