I have the following code in my .emacs:
(if (null window-system) (progn (require 'color-theme) (color-theme-initialize) (color-theme-simple-1)))
When I open Emacs on the console, I can verify that the progn
block runs (by a (message "Got here.")
), and I see a flash that suggests that the color theme was loaded, but if it was loaded, it is overridden by something else. If, after loading, I open my .emacs file and submit the block above using C-x C-e
, it works. I've tried doing:
(add-hook 'after-init-hook (lambda () (progn (require 'color-theme) (color-theme-initialize) (color-theme-simple-1))))
but that acts the same.
It may be relevant that I'm using Emacs 24, and that this code is not in my .emacs, but in ~/Dropbox/.emacs, which is loaded from my .emacs.
An additional note: I've tried M-x customize-themes
, but none of those work acceptably on the console. They either produce a nearly unreadable light theme, or most of the text is invisible.
Alt + x load-theme , then press Tab to show a list of available themes. Alternatively, Alt + x customize-themes to set a color theme. M-x customize-themes. Click to see the change immediately.
Default Themes of Emacs For users that do not want to get into the hassle of changing their initialization file, they can simply add one of these default themes to their Emacs. Users can check the default themes of Emacs by pressing Alt + x and entering customize-themes.
You can enable a specific Custom theme in the current Emacs session by typing M-x load-theme . This prompts for a theme name, loads the theme from the theme file, and enables it. If a theme file has been loaded before, you can enable the theme without loading its file by typing M-x enable-theme .
I would like to change the (color) theme in KDevelop to a dark theme as advertised on the KDevelop website. This setting is places in settings -> color theme where a list of color themes should be available. With Ubuntu 20.04 there is just a single option bringing the application back to the default color theme.
Emacs 24 has built-in theming, which doesn't use statements like (require 'color-theme)
. As Drew points out in the comments, there are differences between color themes and custom themes, and the new direction is towards the latter. Try M-x customize-themes
to take a look. From .emacs, you can do things like (load-theme 'wombat t)
.
It may still be going wrong for you. One thing that can mess it up like this is changing the face -- maybe in the custom-set-faces part of your .emacs file. Emacs's interactive customization automatically includes the color information (both background and foreground) of whatever theme you happen to be using at the time you set it, so this can definitely make trouble with color themes. If that is what's causing it, you can just set the particular attribute you care about with something like
(set-face-attribute 'default nil :height 120)
That will change the font size without changing the colors.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With