Reputation: 5040
When we use highlight-lines-matching-regexp
in emacs and enter the regex. After that we need to enter the color for highlight.
I am getting only few colors, but I want some more colors, will it be possible to achieve this in emacs?
Upvotes: 3
Views: 329
Reputation: 30701
You can use library Highlight (highlight.el
) for this --- e.g., command hlt-highlight-regexp-to-end
or hlt-highlight-regexp-region
, instead of the vanilla command highlight-lines-matching-regexp
.
Then you need not specify the face to use each time. (You can change the face to use at any time, using command hlt-choose-default-face
).
Upvotes: 0
Reputation: 9380
When prompt for "colors" (faces, in fact), you can use any face Emacs have defined. By default, a "hi-" is appended to the minibuffer text, so only a few are shown (9, in my Emacs version). But if you delete manually these 3 characters, you will have all of the faces available.
And of course, you may add as many new faces to your setup as you want.
Example of face definition:
(defface my-silly-face
'((t :foreground "DarkSlateBlue"))
"Example face.")
Upvotes: 1