8

Suppose I want the face helm-match to have an unset foreground. Unfortunately, helm-match inherits from match so, if I try to unset the foreground normally:

(set-face-foreground 'helm-match nil)

The inherited foreground becomes active. I'd rather not mess with the match face itself (because I can't tell what ramifications that would have), and I would like to avoid hard coding the other values in helm-match because I use multiple themes.

How can I achieve this sanely?

PythonNut
  • 10,363
  • 2
  • 30
  • 76
  • Just customize the face (helm-match). That's what face customization is for. Show all the attributes in Customize, and uncheck the inheritance. – Drew Jan 30 '16 at 02:04
  • 1
    @Drew I would like to preserve the inheritance of other attributes. – PythonNut Jan 30 '16 at 02:18
  • 1
    So leave Inherit checked and check whatever other attributes you want to override any from the inherited face. The point is to use Customize (customize-face). – Drew Jan 30 '16 at 02:35

2 Answers2

0

Use unspecified as value instead.

See also face attributes.

wasamasa
  • 22,178
  • 1
  • 66
  • 99
0

The easiest way is to see how your own Emacs version handles the situation. let's for instance consider changing the Info-quoted face:

  1. Do M-x customize-face press enter, and then type Info-quoted and press enter (note that the I should be capital) to see the attributes.
  2. Do the changes you want. In this case, let the checkmark for "Inherit" be there but delete the value (e.g use the "Del" button)
  3. Press "Apply" button. At this stage you can see the face change applied to all buffers.
  4. Press the "state" button to open the menu
  5. From the menu, click on "Show lisp expression"
  6. Copy the lisp expression and use it in your Emacs config

screenshot of first three steps

screenshot of steps 4 and 5

screenshot of step 6