emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: url-history.el: variable url-history-track defined but not used


From: Klaus Straubinger
Subject: Re: url-history.el: variable url-history-track defined but not used
Date: Wed, 30 Nov 2005 17:59:05 +0100 (CET)

>    +     (and (featurep 'url)
>    +          (fboundp #'url-history-setup-save-timer)
>
> Those tests are rather undesirable; it would be better for
> this to work regardless of what else is loaded.

Now that I come to think about it, in my opinion the whole of the
:set function could be reduced to

  :set #'(lambda (var val)
           (set-default var val)
           (if (bound-and-true-p url-setup-done)
               (url-history-setup-save-timer)))

because the test

                        (fboundp 'url-history-setup-save-timer)
                        (let ((def (symbol-function
                                    'url-history-setup-save-timer)))
                          (not (and (listp def) (eq 'autoload (car def)))))

seems to only test if url-history-setup-save-timer is really available.

> What is the reason for those tests?

I suspect the variable url-history-save-interval previously had been
defined somewhere else, probably in url-vars.el.

> What problem do they solve?

That function to be called is not available and that the URL library is
not loaded when the customize :set function gets called. You don't want
to save periodically the URL history if the URL library is not even
initialized.

The function url-do-setup calls (url-history-setup-save-timer)
anyway.

> Let's look for another solution.

The test for (featurep 'url) could be replaced by a test for the
variable url-setup-done as I suggested above.

All changes should be made to the :set function in the defcustom for
url-history-save-interval as well because I copied it from there in
the first place.

-- 
Klaus Straubinger




reply via email to

[Prev in Thread] Current Thread [Next in Thread]