symbol-overlay icon indicating copy to clipboard operation
symbol-overlay copied to clipboard

Is it possible to use more than 8 colors?

Open alexei-28 opened this issue 1 year ago • 7 comments

Here customize:

cusomize

And here example: example

Is it possible to add more colors? At least 10 colors.

alexei-28 avatar Jun 15 '23 20:06 alexei-28

Yes, I think you can define some extra faces and then add them to symbol-overlay-faces.

purcell avatar Jun 16 '23 13:06 purcell

Yes, I think you can define some extra faces and then add them to symbol-overlay-faces.

I try like this, but it not help. Only 8 colors :-(

image

alexei-28 avatar Jun 16 '23 17:06 alexei-28

The buffer on the left doesn't show that the changes have been saved. Can you confirm that the variable system-overlay-faces now actually contains symbol-overlay-face-9 and symbol-overlay-face-10? (Use describe-variable, ie. C-h v)

purcell avatar Jun 17 '23 06:06 purcell

The buffer on the left doesn't show that the changes have been saved. Can you confirm that the variable system-overlay-faces now actually contains symbol-overlay-face-9 and symbol-overlay-face-10? (Use describe-variable, ie. C-h v)

When (in the left buffer) I select State -> Save for Future Sessions" I get error:

custom-variable-mark-to-save: Saving symbol-overlay-faces: Invalid face: symbol-overlay-face-9

alexei-28 avatar Jun 17 '23 06:06 alexei-28

You would also need to define the face using defface. Add something like this to your startup files:

(with-eval-after-load 'symbol-overlay
  (defface symbol-overlay-face-9
    '((t (:background "turquoise" :foreground "black")))
    "Symbol Overlay default candidate 9"
    :group 'symbol-overlay)

  (defface symbol-overlay-face-10
    '((t (:background "turquoise" :foreground "black")))
    "Symbol Overlay default candidate 10"
    :group 'symbol-overlay)

  (add-to-list 'symbol-overlay-faces 'symbol-overlay-face-9 t)
  (add-to-list 'symbol-overlay-faces 'symbol-overlay-face-10 t))

then all you need to do in the Custom interface is customize those two faces.

purcell avatar Jun 17 '23 07:06 purcell

What was happening for you above was this:

  • Only faces defined using defface are accepted when symbol-overlay-faces is changed using Customize
  • Customized face definitions are accepted but ignored if the faces have not been defined using defface.

purcell avatar Jun 17 '23 07:06 purcell

Here is a nice colors for using: MicrosoftTeams-image

alexei-28 avatar Jun 19 '23 13:06 alexei-28