Vivek Kumar
Vivek Kumar

Reputation: 5040

Colors name for highlight the matched lines

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

Answers (2)

Drew
Drew

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

juanleon
juanleon

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

Related Questions