Questions tagged [faces]

A 'face' in Emacs is the visual presentation of text using fonts and highlighting. A default face, for example, specifies both the font and the foreground and background colors.

Adapted from the Emacs manual:

Emacs can display text in several different styles, called "faces". Each face can specify various "face attributes", such as the font, height, weight, slant, foreground and background color, and underlining or overlining. Most major modes assign faces to the text automatically, via Font Lock mode. […]

To see what faces are currently defined, and what they look like, type M-x list-faces-display. With a prefix argument, this prompts for a regular expression, and displays only faces with names matching that regular expression […].

It's possible for a given face to look different in different frames. For instance, some text terminals do not support all face attributes, particularly font, height, and width, and some support a limited range of colors. In addition, most Emacs faces are defined so that their attributes are different on light and dark frame backgrounds, for reasons of legibility. By default, Emacs automatically chooses which set of face attributes to display on each frame, based on the frame's current background color. However, you can override this by giving the variable frame-background-mode a non-nil value. A value of dark makes Emacs treat all frames as if they have a dark background, whereas a value of light makes it treat all frames as if they have a light background.

You can customize a face to alter its attributes, and save those customizations for future Emacs sessions. […]

The default face is the default for displaying text, and all of its attributes are specified. Its background color is also used as the frame's background color. […]

Another special face is the cursor face. On graphical displays, the background color of this face is used to draw the text cursor. None of the other attributes of this face have any effect; the foreground color for text under the cursor is taken from the background color of the underlying text. On text terminals, the appearance of the text cursor is determined by the terminal, not by the cursor face.

You can also use X resources to specify attributes of any particular face. […]

Emacs can display variable-width fonts, but some Emacs commands, particularly indentation commands, do not account for variable character display widths. Therefore, we recommend not using variable-width fonts for most faces, particularly those assigned by Font Lock mode.

402 questions
24
votes
5 answers

Emacs Blue color too dark

Emacs blue (on dark background) is too dark. classA is readable with difficulty in the example below: How to fix the dark blue colour?
Viesturs
  • 805
  • 8
  • 19
20
votes
3 answers

Is there a way to change color of active window's fringe?

To better distinguish between focused window and rest that are not I would love to change this window's fringe color. Discovering customize with fringe keyword I found only how to change its bg color without ability to set different colors for…
sandric
  • 1,221
  • 9
  • 19
20
votes
1 answer

how to prevent faces from bleeding onto surrounding areas of buffer?

Q: How do I keep org-mode link faces from bleeding over into the ... selective display characters at the end of a folded header? This is a visual tick that drives me a little nutty. When, in org-mode, a link is the very last thing on a line, the…
Dan
  • 32,584
  • 6
  • 98
  • 168
19
votes
3 answers

describe-face character not under / unreachable by the cursor

I like using a combination of describe-face and customize-face to adjust the appearance of my working environment. Sometime this workflow fails when I want to change the face of a location I can not reach with the cursor; mode-line, header-line,…
remvee
  • 561
  • 6
  • 13
19
votes
2 answers

How can I set different font sizes for buffers and for the mode-line?

I have this line in my init.el file to set the size of the font in all frames: (push '(font . "DejaVu Sans Mono-10") default-frame-alist) It works but i'd like to have a bigger font in all buffers while keeping a smaller one for the mode line (so…
undostres
  • 1,793
  • 12
  • 15
18
votes
3 answers

Quickly Adjusting Text to DPI Changes

My laptop has a 4K screen therefore a very high DPI, much higher than my external monitors. So when I switch from using external monitors to the builtin laptop screen I would like to quickly scale the text and, if possible, all the GUI widgets in…
Nordlöw
  • 487
  • 3
  • 12
18
votes
1 answer

How do I insert text with a specific face?

I have a face, created this way: (defface test-face '((t . (:height 2.0))) "A face for testing.") I'd like to insert some text with that face. But these ways insert the text without the face: (insert (propertize "text to insert" 'face…
zck
  • 8,984
  • 2
  • 31
  • 65
14
votes
3 answers

How to change faces of org-mode links depending on the link type?

Org-mode offers a variety of different link types ([http], [file], [bibtex], [magit]...). However, they all get the same look defined by the face value for org-link. Is it possible to e.g. change the background color depending on the type of link?…
Bartholomaios
  • 241
  • 1
  • 4
14
votes
1 answer

How to Strike out DONE items in org-mode?

I saw some folks have a way to strike out DONE items in org-mode. How do you do that?
Leo Ufimtsev
  • 4,488
  • 3
  • 22
  • 45
11
votes
1 answer

How can I override a pre-defined face for light and dark backgrounds?

I would like to use set-face-attribute to pick one of two colors for the foreground depending on whether the background of the current theme is light or dark. The expected behavior is that the foreground changes automatically if I switch from a…
Kaushal Modi
  • 25,203
  • 3
  • 74
  • 179
11
votes
4 answers

Disable enlarged org-mode header appearance

I am using org-mode on Macintosh GNU Emacs version 24.5.1 in GUI mode and the headers are enlarged. I would like to disable this feature so they rendered in the default font size. I have tried this... (with-eval-after-load "monokai-theme" …
lookyhooky
  • 949
  • 7
  • 18
11
votes
2 answers

Colors for different priorities in Org mode

I have configured Org mode with a face attribute for priorities with these lines in my init.el: (set-face-attribute 'org-priority nil :foreground "aquamarine1" :background "black" :inherit…
nephewtom
  • 2,219
  • 17
  • 29
11
votes
1 answer

Cocoa Emacs 24.5 Font Issues (Inconsolata-dz)

I am trying to set [Inconsolata-dz][1] as my default font to Emacs. Regular Inconsolata works fine, but the dz version is not working properly. Most functions I use keep throwing this error (followed all the instructions online on how to set Emacs…
darksky
  • 275
  • 1
  • 7
10
votes
1 answer

Underlining in org-mode links with multiline descriptions?

Q: How can I stop underlining through the left "margin" in links that extend over more than one line? The face org-link inherits from the face link, which has the underline attribute set to t (or at least it does by default). Ordinarily, that's all…
Dan
  • 32,584
  • 6
  • 98
  • 168
10
votes
1 answer

How to customize syntax highlight for just a given mode

I would like to change the syntax highlighting in my lua-mode.el without affecting other major modes. Just as an example, I would like "key words" like if, then, else to be in bold and blue typeface when in lua-mode (instead of the default pink)…
Pier Paolo
  • 275
  • 3
  • 10
1
2 3
26 27