changeset 67237:40f77d1e999e

(url-history-track): Call url-history-setup-save-timer in :set function. :type allows three alternatives. (url-history-setup-save-timer): Test url-history-track.
author Richard M. Stallman <rms@gnu.org>
date Thu, 01 Dec 2005 19:15:05 +0000
parents 7a5248410af9
children 72c35eea2ce0
files lisp/url/url-history.el
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/url/url-history.el	Thu Dec 01 19:14:15 2005 +0000
+++ b/lisp/url/url-history.el	Thu Dec 01 19:15:05 2005 +0000
@@ -38,11 +38,17 @@
   :group 'url)
 
 (defcustom url-history-track nil
-  "*Controls whether to keep a list of all the URLS being visited.
-If non-nil, url will keep track of all the URLS visited.
+  "*Controls whether to keep a list of all the URLs being visited.
+If non-nil, the URL package will keep track of all the URLs visited.
 If set to t, then the list is saved to disk at the end of each Emacs
 session."
-  :type 'boolean
+  :set #'(lambda (var val)
+	   (set-default var val)
+	   (and (bound-and-true-p 'url-setup-done)
+		(url-history-setup-save-timer)))
+  :type '(choice (const :tag "off" nil)
+		 (const :tag "on" t)
+		 (const :tag "within session" 'session))
   :group 'url-history)
 
 (defcustom url-history-file nil
@@ -89,7 +95,7 @@
     (cond ((fboundp 'cancel-timer) (cancel-timer url-history-timer))
 	  ((fboundp 'delete-itimer) (delete-itimer url-history-timer))))
   (setq url-history-timer nil)
-  (if url-history-save-interval
+  (if (and (eq url-history-track t) url-history-save-interval)
       (setq url-history-timer
 	    (cond
 	     ((fboundp 'run-at-time)