0

The appearance of a given character is determined by faces from various sources and face-remapping-alist. How to determine the properties Emacs ultimately uses after taking all sources into account? What I'm looking for is an attribute list that could be used for the default face, i.e. one specifiying all attributes.

background-color-at-point and foreground-color-at-point come close for the respective attributes. But they don't take into account face-remapping-alist.

1
0

Your question isn't clear to me. But I guess you're asking how to tell what faces actually have a visual effect on a given character.

Not sure this answers the question at all, but:

  1. Node Displaying Faces of the Elisp manual says how various faces affect the display of a character they act on.

  2. C-u C-x = tells you what faces are used on the character after the cursor, from both text properties and overlays. That uses function describe-char, which you can use programmatically.

Hopefully someone else will have a better answer for you.

0

The library face-explorer contains, among else, functions that untangle all face sources. For example face-explorer-face-attributes-at returns the attributes used at a position in the buffer. It take face-remapping-alist into account.

This package was originally designed to be used be packages that convert text with face information to other formats. Concretely, it's used in the e2ansi package which emits ANSI sequences, to make it possible to display highlighted text in a terminal window.

The package also contains other tools. For example face-explorer-describe-face describes a face, including all underlying definitions. (Think of this as a describe-char on steroids.)

Or, why not play around with face-explorer-simulate-display-mode, a minor mode that simulates how a face (or a theme) would look using, say, a grayscale monitor, or an 8 color terminal.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.