Fuco1 / .emacs.d

My emacs config
MIT License
69 stars 13 forks source link

rainbow-mode matcher is broken #46

Closed Fuco1 closed 5 months ago

Fuco1 commented 6 years ago

rainbow-colorize-match should not put the properties itself, rather it should only return the list and let font-lock do it.

Contact https://julien.danjou.info/about/ about a patch because there is no github repo where we could submit a patch and fuck emacs devel ML.

Fuco1 commented 6 years ago

This is a working version

(defun rainbow-colorize-match (color &optional match)
  "Return a matched string propertized with a face whose
background is COLOR. The foreground is computed using
`rainbow-color-luminance', and is either white or black."
  `((:foreground ,(if (> 0.5 (rainbow-x-color-luminance color))
                      "white" "black"))
    (:background ,color))
  ;; (let ((match (or match 0)))
  ;;   (put-text-property
  ;;    (match-beginning match) (match-end match)
  ;;    'face `((:foreground ,(if (> 0.5 (rainbow-x-color-luminance color))
  ;;                              "white" "black"))
  ;;            (:background ,color))))
  )
Fuco1 commented 5 months ago

The patched code is already upstream