0

When I search a text on isearch due highlighed color it is not readable.

Following line does not have any affect on the main selected word on the isearch:

(set-face-attribute 'lazy-highlight nil :foreground "black" :background "green")

Example:

enter image description here

[Q] How do I change the highlight color for selected text on isearch?

  • M-x customize-group isearch, M-x customize-group lazy-highlight – muffinmad Jan 31 at 21:58
  • I have tried (set-face-attribute 'lazy-highlight nil :foreground "black" :background "green") which does not change the selected main word on the search – alper Jan 31 at 22:25
  • Customize face isearch: Face for highlighting Isearch matches. – muffinmad Jan 31 at 23:00
  • Use M-x list-faces-display to find out which face you're interested in. Then use M-x customize-face. – Drew Jan 31 at 23:50
2

See these faces:

  • isearch

    Face for highlighting Isearch matches.

  • isearch-fail

    Face for highlighting failed part in Isearch echo-area message.

  • lazy-highlight

    Face for lazy highlighting of matches other than the current one.

| improve this answer | |
  • I am not sure but when I do (set-face-attribute 'isearch nil :foreground "black" :background "yellow" :weight 'bold) the font color shows as gray instead of black – alper Feb 1 at 0:04
  • emacs gives debug error for the (set-face-attribute 'isearch-fail :background "green") but it works for the other faces (isearch and lazy-highlight) – alper Feb 1 at 8:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.