changeset 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 13a357b64110
children f6ea7b737c3d
files lisp/ChangeLog lisp/itimer.el
diffstat 2 files changed, 14 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Sep 25 21:51:28 2004 +0000
+++ b/lisp/ChangeLog	Sun Sep 26 02:20:31 2004 +0000
@@ -1,3 +1,8 @@
+2004-09-25  Jerry James  <james@xemacs.org>
+
+	* itimer.el (start-itimer): Cannot use set-itimer-name now that
+	that function does not uniquify names.
+
 2004-09-22  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* startup.el (load-init-file):
--- a/lisp/itimer.el	Sat Sep 25 21:51:28 2004 +0000
+++ b/lisp/itimer.el	Sun Sep 26 02:20:31 2004 +0000
@@ -364,13 +364,17 @@
 	 ;; hard to imagine the user specifying these interactively
 	 nil
 	 nil ))
+  (check-string name)
   (check-nonnegative-number value)
   (if restart (check-nonnegative-number restart))
-  (let ((itimer (list name value restart function is-idle
-		      with-args function-arguments (list 0 0 0))))
-    ;; Make proposed itimer name unique if it's not already.
-    (set-itimer-name itimer name)
-    (activate-itimer itimer))
+  ;; Make proposed itimer name unique if it's not already.
+  (let ((oname name)
+	(num 2))
+    (while (get-itimer name)
+      (setq name (format "%s<%d>" oname num))
+      (itimer-increment num)))
+  (activate-itimer (list name value restart function is-idle
+			 with-args function-arguments (list 0 0 0)))
   (car itimer-list))
 
 (defun make-itimer ()