Emacs: how do I change the foreground color of a highlight (e.g. connect a dot)?

I have a color theme file (similar to gruber-darker.el) and I would like to customize a specific color. This color can be described as follows: Go to Org Agenda (org-mode clipboard) via Mx org-agenda a . Then move the cursor over “Scheduled TODO” (this is a link to the corresponding entry in your agenda file). When the cursor is over such an element, you see the element in the selected form with the background color and foreground color. The background color is fine, but the foreground color is white. I would like to set this foreground color to something like :foreground nil so that it is not white; instead, the natural color of the element the cursor is on is inherited. Usually I use Mx describe-face RET to figure out what element I should change. However, this does not work, as I only get the names of the colors / elements of the element in which the cursors are included.

Update 1: I just realized that I get the same behavior for all links in emacs (not only in org-mode). I found out that (highlight ((t (:background "#453D41")))) gives me a brown background panel as the selected area. But as soon as the cursor is over the selected area, I get a white foreground color instead of the original color. Even (highlight ((t (:background "#453D41" :foreground nil)))) does not give me the original color of the element on which the cursor is on. How can i achieve this?

Update 2: I realized that (highlight ((t (:foreground "#000000" :background "#453D41")))) really gives the foreground black instead of white. But I don’t know how to get the “inherited” color of the front object that the cursor is on.

+4
source share
2 answers

What you have discovered is that it is not possible. On the one hand, the mouse-face text property is independent of the face property. For others, face attributes are defined statically; they cannot be inherited dynamically.

Consider submitting an Emacs extension request for such an opportunity (this is not limited to highlight or mouse-face , etc.) using the Mx report-emacs-bug . (Yes, this command is also intended for promotion requests.)

0
source

Try using describe-char instead of describe-face . This should give you more information about the different individuals to be used.

An interacting function uses a character at a point, but you can also pass it a position, so if you find that placing the cursor on the character in question is a problem (for example, it changes the selection to something else), you can do something like this :

  • Move the point to a non-conflict position nearby (say, 3 characters in front of the character you're interested in).
  • M-: (describe-char (+ 3 (point))) RET
+1
source

Source: https://habr.com/ru/post/1388385/


All Articles