Paste number 39628: need fn to randomly select a color-theme

Paste number 39628: need fn to randomly select a color-theme
Pasted by: metaperl
When:4 years, 9 months ago
Share:Tweet this! | http://paste.lisp.org/+UKS
Channel:#xemacs
Paste contents:
Raw Source | XML | Display As
I have a list of color-theme functions. Each of theme simply sets the color-theme for my XEmacs. I would like to have an interactive function which randomly selects a function from the list calls it.

(setq color-theme-favorites '(classic infodoc tty-dary))

;;; now somebody write the function to:

(defun color-theme-random ()
   (interactive)
   (let* ((choice (random color-theme-favorites))
           (choice-str (symbol-2-string choice))
           (fn-str (strcat "color-theme-" choice-str))
           (fn (str-2-symbol))
      (apply fn)))

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.