Emacs: whitespace face overriden by solarized? - emacs

I tried out the solarized theme (available from here) and really liked it. However, it somehow overwrites my whitespace settings and no matter how I configure the whitespace-face, it gets overwritten. Any ideas on how to control the color of my whitespaces while keeping the neat looking color-theme-solarized-dark?
From .emacs:
;;; Install colortheme
(add-to-list 'load-path "/home/blabla/.emacs.d/color-theme-6.6.0/")
(require 'color-theme)
(eval-after-load "color-theme"
'(progn
(color-theme-initialize)
(color-theme-hober)))
;;; Install solarized
(add-to-list 'load-path "/home/blabla/.emacs.d/emacs-color-theme-solarized")
(require 'color-theme-solarized)
(color-theme-solarized-dark)
This was my previous setup:
(custom-set-faces
'(whitespace-space ((((class color) (background light)) (:background "white" :foreground "darkgrey"))))
'(whitespace-tab ((((class color) (background light)) (:background "white" :foreground "darkgrey")))))
The only thing I found to have any effect was:
(whitespace-space ((t (:background "red"))))
Of course, that just renders an ugly background for every white space.
Using GNU Emacs 23.3.1.

The version of Solarized here has all the faces needed for whitespace-mode to look good with Solarized. It's for Emacs 24 (but may work on Emacs 23 as well if load-theme is present there) only though, but if you don't want to use it you can simply copy the relevant colors into the definition of the color theme you've downloaded.

Related

Emacs org mode: background color of latex fragments (with `org-highlight-latex-and-related`) : which variable to change?

Ok, so my org-mode latex fragments have a slightly off background color, but only when I:
(setq org-highlight-latex-and-related '(native))
As seen here
It looks similar to the background highlighting functionality as involved in ~~ (code).
Does anyone know what to do?
BONUS:
I'm using doom emacs and the gruvbox theme.
TRIED:
I don't think this is related to the fragments themselves a la org-format-latex-options (as seen in many other posts)
This is NOT helped by setting font-latex-math-face :background
HINTS:
I feel like it IS related to the face org-latex-and-related, but I can work out how the chance the background, when I 'customise' the face i get the following:
(defface org-latex-and-related
(let ((font (cond ((assq :inherit custom-face-attributes)
'(:inherit underline))
(t '(:underline t)))))
`((((class grayscale) (background light))
(:foreground "DimGray" ,#font))
(((class grayscale) (background dark))
(:foreground "LightGray" ,#font))
(((class color) (background light))
(:foreground "SaddleBrown"))
(((class color) (background dark))
(:foreground "burlywood"))
(t (,#font))))
"Face used to highlight LaTeX data, entities and sub/superscript."
:group 'org-faces
:version "24.4"
:package-version '(Org . "8.0"))
Answering my own question.
As usual, tecosaur got there first and gives a good breakdown of the internals.
The code that does the magic is
(require 'org-src)
(add-to-list 'org-src-block-faces '("latex" (:inherit default :extend t)))

archlinux emacs can't autoload monaco-fonts

I installed the monaco fonts from the AUR in archlinux, and set emacs's fonts to monaco, but it doesn't load the monaco fonts when emacs starts, I have to set the font to monaco manually when starting emacs, can anyone one give me some hint of what to do?
This is part of my .emacs.d/init.el:
(custom-set-faces
'(default ((t (:family "Monaco" :foundry "unknown" :slant normal :weight normal :height 128 :width normal)))))
I find the (custom-set-faces ...) doesn't make sense in this case, I use the following code found in https://superuser.com/ and succeed.
(set-frame-font "Monaco 14" nil t)
(add-to-list 'default-frame-alist
'(font . "Monaco 14"))

Emacs colors. why it is gray on current line? zenburn theme

I installed Prelude on my emacs24. I'm using ubuntu 12.04
It worked perfectly the first time I used it, but all the next times it doesn't.
On my current line the font color is gray so it's hard to see what I write. Previously it was a Bold case, keeping any color the line had for reserved words.
How can I fix this?
or also the empty lines with spaces are all yellow
I've been trying to fix it on the:
~/.emacs.d/elpa/zenburn-theme-20130716.1457/zenburn-theme.el
file but I can't find a solution... I think the problem could be between this lines:
;;;;; hl-line-mode
`(hl-line-face ((,class (:background ,zenburn-bg-05))
(t :weight bold)))
`(hl-line ((,class (:background ,zenburn-bg-05)) ; old emacsen
(t :weight bold)))
Thanks!
You can change the background and foreground to whatever you want, or turn it off completely. You can add bold or underline or overline or slant, or whatever floats your boat. One of my very first projects was to take the settings from color-theme and put it into my .emacs file and I haven't used a specific color theme since. Oh, and of course you want to open your .emacs or init file to see if there are any settings that conflict with the color theme you are using.
(global-hl-line-mode 1) ;; highlight current line -- see hl-line.el
(custom-set-faces
'(highlight ((t (:background "grey80" :foreground "black" :bold t)))) ;; highlight current line
)
Important:
Add to .bashrc file:
export TERM=xterm-256color
and I found the perfect configuration for me. Here it goes:
;;;;; hl-line-mode
(custom-set-faces
'(highlight ((t (:background "grey20" :foreground nil :bold t)))) ;; highligh\
t current line
)
This way you keep every color for reserved words all bold and a gray background for the current line. Everything will be beautiful =)

Customizing highlighting faces in Emacs: Only change the background color

Is there any way to define a face in Emacs (e.g. highlight such as hl-line) so that it only changes the background color (and have Emacs use the foreground color as if the word was not highlighted).
More specifically, I tried the following on the tango-dark theme
(custom-set-faces
'(region ((t (:inherit nil :background "RoyalBlue4"))))
'(highlight ((t (:inherit region :background "dark olive green"))))
'(hl-line ((t (:inherit highlight)))))
and, as can be seen below, region highlighting does respect the foreground font (i.e. it only changes the background color):
                     
but the highlighting of the current line does't:
                       
Why? and how can I get the same effect with hl-line?
Update:
This seems to a bug in the tango-dark theme (a builtin theme of Emacs). The code works well with the default theme (which loads with emacs -Q). I posted this on the official bugs mailing list.
I struggled with this some time ago, and it seems to be a bug of the color theme.
I've come up with a workaround, however. This works for me:
(load-theme 'tango-dark t)
(set-face-attribute 'highlight nil :foreground 'unspecified)
I had a bit similar problem:
(add-hook 'after-make-frame-functions
(lambda (frame)
(select-frame frame)
(when (display-graphic-p frame)
(custom-set-faces '(region ((t (:inherit nil :background "RoyalBlue4")))))
)

emacsclient unable to load color "unspecified-bg"

I'm getting the error Unable to load color "unspecified-bg" [16 times] when using emacsclient -c. I've started up emacs using emacs --daemon. This seems to mean that my custom faces won't load.
When starting emacs as usual, and then using M-x server-start, then this problem doesn't happen at all. How can I get emacsclient -c to load the faces properly?
Here's the relevant code:
(custom-set-faces '(default ((t (:inherit nil :stipple nil :background "black" :foreground "white" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 120 :width normal :foundry "unknown" :family "Inconsolata")))))
I'm not 100% sure this would fix your problem, but you really should be using color-theme for syntax highlighting. Custom is meant for beginning emacs users, so I'd suggest you try out color-theme and see if it works. Here's how I have it set up on my machine:
Download the package from the color-theme homepage.
Put the color-theme folder somewhere like ~/.emacs.d/color-theme/.
Make sure this folder is in your load-path. I took the following code from a Steve Yegge post:
In your .emacs:
(defvar emacs-root "~/.emacs.d/")
(labels
((add-path
(p)
(add-to-list
'load-path
(concat emacs-root p))))
(add-path "lisp")
(add-path "color-theme-6.6.0")
(add-path "cedet-1.0"))
(require 'color-theme)
Then you define your color theme:
;; Color-theme
(eval-after-load "color-theme"
'(progn
(color-theme-initialize)
;; Set custom color theme
(defun color-theme-mine ()
"My custom color theme"
(interactive)
(set-cursor-color "#ffffff")
(color-theme-install
'(color-theme-mine
;; Super-light grey on Dark grey
((foreground-color . "#e0e0e0")
(background-color . "#151515")
(background-mode . dark))
(font-lock-comment-face ((t (:foreground "#106010")))) ;; Forest Green
;; More definitions below
;; ...
(color-theme-mine)) ;; end eval-after-load
This will load color-them-mine when you start emacs. You can see all available color themes by typing M-x color-theme <TAB>. To see the full list of faces available, use the command M-x list-faces-display.
Sounds like this might be bug #4776: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=4776#5. If not, consider filing a bug report for this one, using M-x report-emacs-bug.