comparison lisp/itimer.el @ 2309:d8c340c9adb6

[xemacs-hg @ 2004-09-26 02:20:30 by james] Do not use set-itimer-name when unique names are needed.
author james
date Sun, 26 Sep 2004 02:20:31 +0000
parents 0da64f4bd0bc
children 91b3aa59f49b
comparison
equal deleted inserted replaced
2308:13a357b64110 2309:d8c340c9adb6
362 nil nil t))) 362 nil nil t)))
363 restart) 363 restart)
364 ;; hard to imagine the user specifying these interactively 364 ;; hard to imagine the user specifying these interactively
365 nil 365 nil
366 nil )) 366 nil ))
367 (check-string name)
367 (check-nonnegative-number value) 368 (check-nonnegative-number value)
368 (if restart (check-nonnegative-number restart)) 369 (if restart (check-nonnegative-number restart))
369 (let ((itimer (list name value restart function is-idle 370 ;; Make proposed itimer name unique if it's not already.
370 with-args function-arguments (list 0 0 0)))) 371 (let ((oname name)
371 ;; Make proposed itimer name unique if it's not already. 372 (num 2))
372 (set-itimer-name itimer name) 373 (while (get-itimer name)
373 (activate-itimer itimer)) 374 (setq name (format "%s<%d>" oname num))
375 (itimer-increment num)))
376 (activate-itimer (list name value restart function is-idle
377 with-args function-arguments (list 0 0 0)))
374 (car itimer-list)) 378 (car itimer-list))
375 379
376 (defun make-itimer () 380 (defun make-itimer ()
377 "Create an unactivated itimer. 381 "Create an unactivated itimer.
378 The itimer will not begin running until activated with `activate-itimer'. 382 The itimer will not begin running until activated with `activate-itimer'.