Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extend/Customize existing color-theme in emacs

Using emacs-24.1, how can we extend/customize existing color-theme in emacs ? I tried doing this

(custom-theme-set-faces
'tango
'(ido-first-match ((t (:foreground "008800" :weight bold))))

It worked fine when I had tango loaded. But when I put this in .emacs.d/init.el file, it failed because tango was not loaded by then and emacs complained of undefined tango. This certainly is not going to help as I tend to change theme regularly using (load-theme ...). What I'm looking at is some kind of hook to run when the theme is loaded. Is it possible ?

Ofcourse, I can modify tango-theme.el file but that is not my goal. I want to extend the existing theme. I tried this in my init file

(load-theme 'tango-dark)

    (custom-theme-set-faces
    'tango-dark
    '(ido-first-match ((t (:foreground "#00cdef" :weight bold))))

(deftheme tango)

    (custom-theme-set-faces
    'tango
    '(ido-first-match ((t (:foreground "#008800" :weight bold))))

This worked fine for tango theme.. But tango-dark is show the same color as tango. So, how to customize existing themes even before loading them or set the custom faces at the time of loading the theme.

like image 686
Surya Avatar asked Oct 17 '25 10:10

Surya


1 Answers

When I want to define a new theme, I modify a given theme, and afterwards I call (color-theme-print). This function will generate a function that helps to restore my modified color theme.Put/include the generated function in .emacs.

color-theme-print is used to generate new color themes.

like image 153
alinsoar Avatar answered Oct 19 '25 07:10

alinsoar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!