Let stuff that interest you stand out: Customize faces

Did you ever feel that Emacs’ default styling of some text is a bit off, and the stuff that you want to stand out does not really stand out that well?

Let me give an example.

Here is a typical page from the user manual.  This page mentions talks about how to customize faces.

Screenshot from 2018-07-10 11-25-22

Here is the same page from the manual, but with custom rendering.

Screenshot from 2018-07-10 11-31-07

Which of the above two renderings you think helps you the most?  It is most definitely the second one.  Here, the stuff that matter to you stand out really well.

Now how do you accomplish this?  You do it by customizing faces.

Take sometime to look at the first image above.

You will realize that the important stuff, like keystrokes, variables and commands, are set apart from the surrounding text using single quotes and is rendered in a fixed pitched font.  The intent of using a separate face is good, but the default choice of style is unfortuate and the associated text doesn’t really stand apart very well.  Don’t fret.  The situation could be improved, as demonstrated above.

Here are the steps to accomplishing this.

Step 1: Locate the styled text and position your cursor over it

It is not necessary to wade deep in to the manual to find some styled text.  If you look carefully, you can find couple of such texts right in the landing page of the user manual.

Screenshot from 2018-07-18 13-50-58

 

Screenshot from 2018-07-18 13-51-40

Step 2: Launch the customization menu

Remember, at this point, the cursor is right over the text that you want to re-style.

Screenshot from 2018-07-18 13-52-51

 

Screenshot from 2018-07-18 13-53-38

Press Enter at the prompt.

 

Step 2: Customize the face as you wish and save it

Screenshot from 2018-07-10 11-29-25

Screenshot from 2018-07-10 11-30-17

Step 3: Congrats! The landing page of the user manual  is now more colorful

Screenshot from 2018-07-18 14-16-14

Screenshot from 2018-07-18 14-26-09

Step 4:  Bring up any other page in the manual and Verify that those pages are colorful too

The manual page that you see in the above screenshot, is the page for customize-face command.

You can get to that page of the manual, as below

Step 4.1: Look Up Key in User Manual

Screenshot from 2018-07-10 12-26-43

Step 4.2: Go through the motions for customizing the face

Yes, for all practical purposes, menu entries are keystrokes too.

Screenshot from 2018-07-10 12-28-06

 

Screenshot from 2018-07-10 18-28-35

Step 4.3: Voila! You are on the  page of the user manual that mentions customize-face and it is colorful too

Screenshot from 2018-07-18 14-47-13

 

Additional Notes

Note 1: A brief note on inheriting faces

When customizing faces, I find it convenient to inherit  it from an existing face.  In the above demonstration, while customizing Info-quoted face, you chose a foreground color of Blue1.  The very same color is used by font-lock-function-name-face.  So, if you were to inherit Info-quote face from the font-lock-function-name-face, you would have gotten the same result as one in the above example.

Screenshot from 2018-07-18 15-06-42

Note 2: On color names and faces

Above discussion shows that it is useful to know about standard colors and faces. By using them, you will achieve a visual consistency in your Emacs, with the least amount of efforts.

Bring up a list of  faces

Screenshot from 2018-07-18 13-28-36

 

Screenshot from 2018-07-18 13-32-07

Bring up a list of  standard colors

Screenshot from 2018-07-10 22-28-37

Screenshot from 2018-07-10 22-29-08

Advertisements
Categories gnu

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close