executing a random command
Posted: Sun Apr 02, 2017 10:38 am
I am writing a function that will implement a random colour theme in emacs. Have a look at this example:
The last part, , of course, doesn't work, even though either or work. How do I randomly pick one of these two commands and then execute it?
Code: Select all
(defun random-colour-theme () ;; written 2017-04-02
"Pick a random colour theme."
(interactive)
(setq randomNumber (random 2))
(setq nameOfRandomColorTheme (nth randomNumber '(
"color-theme-xemacs"
"color-theme-xp")))
(nameOfRandomColorTheme)
)
Code: Select all
(nameOfRandomColorTheme)
Code: Select all
(color-theme-xp)
Code: Select all
(color-theme-xemacs)