Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to treat my custom emacs theme as a "safe theme"?

Tags:

emacs

I'm using emacs 24 and solarized color theme.

When Emacs starts up, it prompt me with "Loading a theme can run Lisp code, really load?".

When I answer with "yes", it continues to "Treat this theme as safe in future sessions?".

If I say "y", the theme gets loaded, and

(custom-set-variables     (custome-safe-themes (quote ("..." default)))) 

gets added to ~/.emacs automatically.

However, those questions come back every time I open Emacs!

What's the proper way to turn those off?

like image 553
Daniel Duan Avatar asked Dec 17 '11 15:12

Daniel Duan


People also ask

How do I save my Emacs theme?

When a Custom theme is enabled, all of its settings (variables and faces) take effect in the Emacs session. To apply the choice of theme(s) to future Emacs sessions, type C-x C-s ( custom-theme-save ) or use the ' [Save Theme Settings] ' button.

What is the default Emacs theme?

Just to clarify: I start Emacs with my customization of the default theme (load "faces") . All is good.


1 Answers

If you use M-x customize-themes to set and save your preferred theme, then everything should work nicely.

If, instead, you've added code to your .emacs to enable the theme, but that code appears earlier in the file than the custom-set-variables command, then that might be the problem.

You can force Emacs to load a theme without prompting you to confirm its safety by using the load-theme function's NO-CONFIRM flag:

(load-theme 'solarized-light t) 
like image 185
sanityinc Avatar answered Sep 27 '22 19:09

sanityinc