Modifying an existing emacs color theme - emacs

I like the Emacs color theme clarity. I start the theme with M-x color-theme-clarity. However, I would rather have the background was always black, rather than the mixed black and white as seen in my screenshot. It seems like if there is a line that has never had text on it, it will be white rather than black. How do I fix this?
Thank you and best regards.

That is odd. I also use the clarity color theme and I sometimes notice that if I switch to it from another theme some of the colors are off in certain areas.
Try setting it as the initial color theme in your .emacs file so that it is the first theme used when Emacs is opened:
(require 'color-theme)
(setq color-theme-is-global t)
(color-theme-clarity)
This might help if the issue is caused by a conflict with a previously used theme.

This has been driving me crazy for a while, finally I think I have found the culprit.
It seems that it only happens when you have custom-set-faces settings in your .emacs configuration file. Try comment the settings to see if fixes the problem.
If the the problem is indeed caused by custom-set-faces you can simply set :background "yourcolour" :foreground "yourcolour2" of the custom-set-faces to fix it. "youcolour" and "yourcolour2" should be the colours used by your preferred theme.

Related

Emacs region syntax highlighting

emacs users out there. I've been tinkering my emacs and encountered a small problem. I have global-font-lock-mode set to t, so i get nice syntax highlighting and it's working fine but when i select a region, highlighting is disabled. Is there a way to fix that?
upd: The issue seems to appear with Solarized theme only. the zenburn theme works nicely.
The Solarized theme sets both the background colour and the foreground colour of the region face. The Zenburn theme only sets the background colour. You could create your own theme by modifying the Solarized theme.

Emacs Prelude: Background Color

I installed the Emacs Prelude as suggested in https://github.com/bbatsov/prelude . I find the background-color grey of the Zenburn theme to be disturbing. I wish to change the background-color to black. I tried (set-background-color "black") ,but it is not working. The background-color still remains grey. Can someone help on how to fix this ?
I'm assuming you didn't eval (set-background-color "black") (or didn't restart Emacs), since it worked just fine when I tested it with Prelude.
Placing the code in personal.el (as mentioned in the README) will work as well.
Btw, if you don't like Zenburn you might try a different theme, rather than playing its colours. You can see a list of available themes with M-x load-theme. There are details about this in the README as well.
The cleanest way to do this is to edit .emacs.d/init.el and add the following:
(disable-theme 'zenburn)
This will give you a "fresh start" with default color settings. You are then free to change the colors as you wish.
If you like a black background, you might want to install the popular Cyberpunk theme.
M-x package-install RET
cyberpunk themeRET

How to customize a face on Emacs, but only when hl-line is active?

I am using Emacs 24, console (8 colors) with the Solarized theme.
I want to make the comments less intrusive using:
(set-face-foreground 'font-lock-comment-delimiter-face "black")
(set-face-foreground 'font-lock-comment-face "black")
That way the comments would be colored with the same color as the hl-line face we can see on the picture. However, when moving to a line containing comments, I would like them to be inverted (black background from the hl-line, normal foreground instead of black) so I can still read them.
As an alternative, you can also temporarily hide comments. See command hide/show-comments-toggle in library hide-comnt.el. Bind it to a handy key --- pretty simple.
Please see the code in the attached link: Emacs colors. why it is gray on current line? zenburn theme

Emacs Linum-mode no fringe in Cocoa

I have the issue visualized here:
The problem is the fringe is not colouring the background of my linum line numbers. I'm using Emacs 24.3.1 with Solarized color theme.
I've looked over various threads, which claims to fix this issue. However, I couldn't get any of them to work.
Any clues?
Try M-x customize-face linum and then Show All Attributes. Change the value of the Background variable and it should change. Easier than having to edit the actual theme file.
(set-face-attribute 'fringe nil :background "white" :foreground "white")
Set the fringe color to whatever you want.

Multiterm background color is wrong

I added multi-term to my emacs config. It works great, but any text in console and some whitespaces (including these in vim from ssh) have white background and since I use deeper-blue style with dark background it does not look nice. How to fix this?
Here is screen: http://tinypic.com/view.php?pic=rh1q9v&s=6
Colors in term.el does not work well sometimes, depending on the timing it is loaded. Calling this after setting your color theme may solve the problem.
(setq term-default-fg-color (face-foreground 'default))
(setq term-default-bg-color (face-background 'default))