Multiterm background color is wrong - emacs

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))

Related

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 and emacsclient colors

When I started to use emacs as daemon and emacsclient with new frame as interface, all was just fine. But then I wanted to adopt emacsclient for running in urxvt terminal. I’ve installed color-scheme package from my distro’s package manager and added initializing code to my ~/.emacs.d/init.el I switched between various color themes, but then realized that colors are actually depend of color palette of the terminal emacsclient is running in. So I deleted the color-theme package and removed lines related to it from my init.el. But something went wrong and I was left with default black foreground color, totally black cursor (I use only default X cursor which is black arrow outlined white, but what I got was looking almost like this, but totally black) and decreased font-size.
I was digging to fix all that as fast as possible, and started to use
'(default-frame-alist (quote ((menu-bar-lines . 0) (left-fringe . 0) (right-fringe) (tool-bar-lines . 0) (background-color . "#2e3436") (foreground-color . "#d3d7cf") (cursor-color . "#ffffff"))))
This is what appeared in my custom-set-variables of my init.el after I finally hit on an appropriate item crawling the customize menu. However, now I need to specify more and more of things to make them look as in usual emacs (not as deamon, there colors and font are still fine). Then a question appeared: ‘Why before installation of color-theme frames of emacsclient were always inherit the default look of emacs I described through customize menu and saved to init.el?’
Deleted all frame-related stuff from init.el and it works like before now.

Modifying an existing emacs color theme

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.

Emacs custom background color by mode

I use emacs to edit a number of file types, and would like an easy visual queue to tell .c files from .vhd or .py files, for instance. How can I add a custom background color to the major mode for that language?
You can do this via hooks. Among other things you can hook is when a new major mode starts. Put something like this into your .emacs file, and emacs will set your background color to purple every time you go into Python mode.
(add-hook 'python-mode-hook
(lambda ()
(set-background-color "purple")))
Resetting the background color to the default in the case that you switch back to a mode that doesn't have an explicit set-background hook for it is left as an exercise for the reader.
You can also manually set the background color with M-x set-background-color
For posterity, as this thread is 4 years old, it is now possible in Emacs 24.4+ to change faces on a buffer local level. Simply define a face and use (face-remap-add-relative) to swap out whatever face you want with it.
Define a defface:
(defface my-special-face '((t :background "aqua")))
Then add a hook to the mode of your choice:
(add-hook 'python-mode-hook
(lambda ()
(face-remap-add-relative 'default 'my-special-face)))
You cannot set the background color on a buffer-by-buffer basis. See the SU question How can I change the background colour of a single emacs buffer?.
The first answer there shows how you can change the background for a single Emacs frame, which might work for you if you have one frame per file (or per mode).