1

When I selected a region Ctrl-space up-arrow key, flycheck errors' font color are remain as it is.

Example, flycheck error makes fore-color bold orange: enter image description here

Would it be possible to disable flychecks when a region is highlighted? Since highlight color is yellow, its difficult to read orange colored flycheck errors.

Drew
  • 75,699
  • 9
  • 109
  • 225
alper
  • 1,238
  • 11
  • 30
  • 1
    Alternatively, you might just want to change the background or face color. – Drew Aug 10 '21 at 21:51
  • Consider setting the overlay `priority` property of the flycheck error **lower than** the region overlay `priority` property, by redefining the function `flycheck-redefine-standard-error-levels`: https://github.com/flycheck/flycheck/blob/21d52264aa80bfa4ede94c59e37a20fb6d033b0c/flycheck.el#L4384 The region overlay `priority` property is `'(nil . 100)` -- see the variable `redisplay-highlight-region-function` within `simple.el`. Inasmuch as I do not use flycheck, I am unable to test a potential solution and/or write-up an answer. – lawlist Aug 11 '21 at 02:00
  • @Drew I tried multiple colors but if it different color that white all are difficult to read on top of yellow highlight :( – alper Aug 11 '21 at 09:18
  • @lawlist Should I remove `(setf (get 'flycheck-warning-overlay 'priority) 100)` line? – alper Aug 11 '21 at 10:17
  • The line of code that was linked in the second comment above was `(setf (get 'flycheck-error-overlay 'priority) 110)`, which was chosen because the question stated the face is for flycheck errors (rather than warnings). You could try pasting the entire function to a scratch buffer, reduce `110` to something like `90`, evaluate the scratch buffer so that `flycheck-redefine-standard-error-levels` gets redefined, and then open up a new buffer and start flycheck and see if that works any better for you. If the face is a warning face, then try modifying that line in a similar manner. – lawlist Aug 11 '21 at 13:17
  • I have tried changing `setf (get 'flycheck-error-overlay 'priority) 110)` on its original path : `flycheck.el /home/alper/.emacs.d/elpa/flycheck-20210708.1337/` but changes does not affect anything :( – alper Aug 11 '21 at 13:53
  • Sorry that my suggestion did not work. Now that I think about it some more, the default region setting only affects the background, not the foreground. – lawlist Aug 11 '21 at 14:37
  • Can't you change the background color of the face used in the overlay? It should be possible for you to change any colors - for face foreground or background, for text properties or overlay properties. – Drew Aug 11 '21 at 21:45
  • @Drew `background color` , do you mean the highlight color as yellow into something else? – alper Aug 11 '21 at 21:58
  • I guess so. You tell me. A background color is typically for a frame (as frame parameter `background-color`) or a face, as attribute `background`. If for a face, it can be used as a text property (on a character) or as an overlay property (on a buffer position). If it's for a face, just customize the face. If it's for a frame then set that frame parameter. – Drew Aug 11 '21 at 23:22
  • I get used to use `background-color` as yellow for highlighting. My best option is to change color for flycheck-errors, since as I understand its difficult to disable their color when the region is highlighted – alper Aug 12 '21 at 11:03

0 Answers0