Question

The slrn newsreader has an attractive interface with different colours for the author, subject and date columns when browsing list of articles in a newsgroup. I am looking for the Emacs font/face variables for these fields in gnus, but have not been able to find them. The gnus manual for faces does not list the available faces and none of the faces list in Emacs (M-x customize-face gnus-... looks relevant. I am using gnus 5.13 in Emacs 23.2.1.

(This question is not related to displaying "faces" (icons/avatars) in Emacs or gnus.)

Solved: See my answer below.

Était-ce utile?

La solution

The format string for various elements in gnus can be customized by modifying the appropriate variable. The variable for the summary line is gnus-summary-format-line. I am not using the default value for this variable, but instead am using the value %U%R%z %(%&user-date; %-15,15f %* %B%s%)\n.

As described here, a new face can be applied to any (sub)section of a format line by bracketing the section with %1{ and %}, where the 1 in this example corresponds to gnus-face-1. gnus-face-1 in my installation defaults to "italics", so adding the following to my ~/.emacs file results in the author in the summary line appearing in italics:

(setq gnus-summary-line-format "%U%R%z %(%&user-date; %1{%-15,15f%} %* %B%s%)\n")

Autres conseils

I think they're scattered a bit in the gnus codebase. The faces used in the article buffer are probably in gnus-art.el, etc.

It sounds like your biggest problem is that there are specific faces that you can't find the symbol for. You can always do M-x describe-face to see what is under the cursor to solve that problem.

Also, (face-list) returns a list of all defined faces. You could scan that list looking for things that look like likely candidates for the particular faces you're interested in.

I go with M-x list-faces-display (which opens a new buffer with all the currently defined face variables fontified to the color that they're set to, in alphabetic order) when I want to see what faces I need to change to get a mode working.

Then I setq them, using either the format from color-theme or from the new emacs built-in theme format, depending on which version of emacs I'm in.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top