Sign up ×

I'm trying to customize my emacs so that the point color is the same as the foreground on of the character I'm standing on.

I have this now:

(defun fixpoint ()
  "awesome stuff happening to point"
  (set-cursor-color (eyedrop-foreground-at-point)))

(add-hook 'post-command-hook 'fixpoint)

I'm using for eyedropper.

There are 2 problems with this I'm trying to fix.

First, the hook is ran after each command which seems a bit overkill. Isn't there a hook for point motion?

Second, when highlighting matching braces, the point does not change color. I have to move forward to the next matching brace and jump back to see the actual change in point color.

share|improve this question

1 Answer 1

Dunno whether there is a better hook to use.

Wrt highlighting braces, I cannot reproduce the problem. Please provide a recipe. Keep in mind that the recipe should highlight braces, to begin with (with a foreground color). If a brace is itself just black (i.e., the default foreground color) then you will of course not notice any change.

I did this, from emacs -Q, after typing {{{}}}:

  1. Turned off font-lock-mode (so you can see the added highlighting). An alternative is to use a font-lock-* face for the highlighting.

  2. Select the braces and do this:

    (put-text-property (region-beginning) (region-end) 'face 'warning)

That puts face warning on the braces. And moving point over them makes the cursor have the same background color (DarkOrange) as warning has for its foreground.

share|improve this answer

Your Answer


