Emacs blue (on dark background) is too dark.
classA is readable with difficulty in the example below:
How to fix the dark blue colour?
Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.Visit Stack Exchange
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.Sign up to join this community
Put the cursor on the blue word, and say
C-u C-x =. Find the
face entry and click on its value. Then click on
customize this face and change the foreground value to e.g.
If you are in a console or are doing
emacs -nw in a terminal, instead of clicking, put the cursor on the appropriate element and press
emacs -nwmode to the right pane? <kbd> RET </kbd> the same as <kbd> ENTER </kbd>? Oct 6, 2017 at 8:49
C-x owill cycle through the windows. And yes,
RETis the commonly used emacs name for the key that is usually labeled
Enter. Oct 6, 2017 at 8:53
C-u M-x what-cursor-position RETbut you should fix your setup: C-x is much too valuable as a prefix to waste. Jul 12, 2018 at 18:01
frame-background-mode to your init file:
(setq frame-background-mode 'dark)
Faces in Emacs can have different values, depending on display attributes such as the number of colors supported or whether they're displayed on a light/dark background. Emacs can guess the latter without any issues in graphical mode, for textual frames however the guessing isn't nearly as good. If it turns out to be wrong, you'll get dark blue on black (because it mistakenly assums a light background on which there would be enough contrast to the dark blue), like in the screenshot above.
To check whether that's the case for you, inspect the value of
frame-background-mode and customize it if needed.
frame-background-mode? Dec 12, 2017 at 9:16
F1 vfollowed by its name.
NickD has a good answer but doesn't update your menu bar which may also have the same dark blue (can you see what it says when you type
ctrl + s?). This method will also fix hard to read menus.
alt + x customize-themes
ctrl + x, ctrl + sto save the settings
ctrl + x, ctrl + cto quit
This theme is saved to your
.emacs file and will be used when you use emacs in the future. Here are more exhaustive instructions.
To change the colors of a part of a text, you put the cursor there, press
C-u C-x =, and find the face name:
Knowing the face name you can change the foreground (
M-x set-face-foreground), or the background (
M-x set-face-background). There's also (
(set-face-attribute 'package-name nil :foreground "cyan1")
package-name with the desired face name.
nil means "for existing and newly created frames."
To display the list of colors use
You can execute non-interactive functions (like
M-:, in a scratch buffer (
C-x C-e), or put them into
The same applies to interactive functions (like
set-face-background). But they can also be executed via
frame-background-modewill fix it and other faces.