Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rainbow-mode matcher is broken #46

Closed
Fuco1 opened this issue Apr 5, 2018 · 2 comments
Closed

rainbow-mode matcher is broken #46

Fuco1 opened this issue Apr 5, 2018 · 2 comments
Labels

Comments

@Fuco1
Copy link
Owner

Fuco1 commented Apr 5, 2018

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
Copy link
Owner Author

Fuco1 commented Apr 5, 2018

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 Fuco1 self-assigned this Apr 5, 2018
@Fuco1 Fuco1 added the bug label Apr 5, 2018
@Fuco1
Copy link
Owner Author

Fuco1 commented Mar 23, 2024

The patched code is already upstream

@Fuco1 Fuco1 closed this as completed Mar 23, 2024
@Fuco1 Fuco1 removed their assignment Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

1 participant