1

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"
  (interactive)
  (set-cursor-color (eyedrop-foreground-at-point)))

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

I'm using http://www.emacswiki.org/eyedropper.el 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.

Silverrocker
  • 1,815
  • 1
  • 15
  • 23

1 Answers1

0

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.

Drew
  • 376
  • 2
  • 8