all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Calling a function every random number of minutes, where random  amount changes
@ 2007-11-29 15:51 metaperl.com
  2007-11-29 19:37 ` vk0vk0vk0
  0 siblings, 1 reply; 3+ messages in thread
From: metaperl.com @ 2007-11-29 15:51 UTC (permalink / raw)
  To: help-gnu-emacs

The code below randomly selects one of my favorite color-themes. I
would like to set something up so that (color-theme-random) is called
after n minutes have elapsed. Where n is non-constant and randomly
chosen between 5 and 60.

In other words, after 7 minutes it calll the function. Then after 30
minutes it calls it again. Then 12 minutes... and so on and so on.

(require 'color-theme)

(random t)

(defvar *color-theme-favorites*
  '(

    arjen andreas billw blippblopp blue-mood blue-sea calm-forest
    classic comidia dark-blue dark-blue2 deep-blue
    euphoria feng-shui fischmeister goldenrod gray1 gray30
    high-contrast hober infodoc jb-simple jonadabian
    jsc-dark jsc-light
kingsajz
    late-night lawrence lethe
    marine marquardt midnight mistyday montz oswald parus
    robin-hood simple-1 subtle-blue tty-dark
    word-perfect
    xp

    ))

(defun color-theme-random()
     (interactive)



     (let* ((choice (nth (random (length *color-theme-favorites*))
			 *color-theme-favorites*))
	    (fn (intern (format "color-theme-%s" choice))))
       (funcall fn)))

(color-theme-random)

(provide 'color-theme-random)
;;;

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-11-29 21:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-29 15:51 Calling a function every random number of minutes, where random amount changes metaperl.com
2007-11-29 19:37 ` vk0vk0vk0
2007-11-29 21:51   ` metaperl.com

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.