[OS X Emacs] Switching custom themes in Aquamacs

Win Treese treese at acm.org
Mon Mar 24 11:18:58 EDT 2014

I occasionally want to switch custom themes with Aquamacs 3.0
(usually between the dark and light variants of solarized). Here’s
the function I came up with to do it, which includes setting the
Aquamacs default frame parameters for new frames (which doesn’t
seem to be needed in, say, the homebrew install of Emacs 24).

(defun my-switch-theme (&optional new-theme)
  "Switch to a different theme and set it as default for new frames."
  (let ((current-theme (car custom-enabled-themes)))
    (when current-theme
	(disable-theme current-theme)))
  (if new-theme
      (load-theme new-theme)
    (call-interactively 'load-theme))
  (if (boundp 'aquamacs-version)

Perhaps this will be useful to others. Feedback or improvements

Thanks for all the work on Aquamacs 3.0!


More information about the MacOSX-Emacs mailing list