comparison lisp/url/url-history.el @ 67310:e6faadb77218

(url-history-list): Var deleted. (url-history-save-interval): Simplify. (url-history-setup-save-timer): Simplify.
author Richard M. Stallman <rms@gnu.org>
date Sun, 04 Dec 2005 17:53:02 +0000
parents fb7449e080a0
children 80952520899f
comparison
equal deleted inserted replaced
67309:ee8894ca3f64 67310:e6faadb77218
61 (defcustom url-history-save-interval 3600 61 (defcustom url-history-save-interval 3600
62 "*The number of seconds between automatic saves of the history list. 62 "*The number of seconds between automatic saves of the history list.
63 Default is 1 hour. Note that if you change this variable outside of 63 Default is 1 hour. Note that if you change this variable outside of
64 the `customize' interface after `url-do-setup' has been run, you need 64 the `customize' interface after `url-do-setup' has been run, you need
65 to run the `url-history-setup-save-timer' function manually." 65 to run the `url-history-setup-save-timer' function manually."
66 :set (function (lambda (var val) 66 :set #'(lambda (var val)
67 (set-default var val) 67 (set-default var val)
68 (and (featurep 'url) 68 (if (bound-and-true-p url-setup-done)
69 (fboundp 'url-history-setup-save-timer) 69 (url-history-setup-save-timer)))
70 (let ((def (symbol-function
71 'url-history-setup-save-timer)))
72 (not (and (listp def) (eq 'autoload (car def)))))
73 (url-history-setup-save-timer))))
74 :type 'integer 70 :type 'integer
75 :group 'url-history) 71 :group 'url-history)
76 72
77 (defvar url-history-timer nil) 73 (defvar url-history-timer nil)
78 74
90 ;;;###autoload 86 ;;;###autoload
91 (defun url-history-setup-save-timer () 87 (defun url-history-setup-save-timer ()
92 "Reset the history list timer." 88 "Reset the history list timer."
93 (interactive) 89 (interactive)
94 (ignore-errors 90 (ignore-errors
95 (cond ((fboundp 'cancel-timer) (cancel-timer url-history-timer)) 91 (cancel-timer url-history-timer))
96 ((fboundp 'delete-itimer) (delete-itimer url-history-timer))))
97 (setq url-history-timer nil) 92 (setq url-history-timer nil)
98 (if (and (eq url-history-track t) url-history-save-interval) 93 (if (and (eq url-history-track t) url-history-save-interval)
99 (setq url-history-timer 94 (setq url-history-timer (run-at-time url-history-save-interval
100 (cond 95 url-history-save-interval
101 ((fboundp 'run-at-time) 96 'url-history-save-history))))
102 (run-at-time url-history-save-interval
103 url-history-save-interval
104 'url-history-save-history))
105 ((fboundp 'start-itimer)
106 (start-itimer "url-history-saver" 'url-history-save-history
107 url-history-save-interval
108 url-history-save-interval))))))
109 97
110 ;;;###autoload 98 ;;;###autoload
111 (defun url-history-parse-history (&optional fname) 99 (defun url-history-parse-history (&optional fname)
112 "Parse a history file stored in FNAME." 100 "Parse a history file stored in FNAME."
113 ;; Parse out the mosaic global history file for completions, etc. 101 ;; Parse out the mosaic global history file for completions, etc.