kai2nenobu / guide-key

Guide following keys to an input key sequence automatically and dynamically in Emacs.
373 stars 16 forks source link

Feature Request: Select Color for highlighting and allow multiple sets of highlighting keywords (with different colors) #14

Closed elemakil closed 10 years ago

elemakil commented 10 years ago

This is a feature request: I think it would be useful to have several sets of highlighting keyword which are coloured in different faces. For example it would be useful to be able to color all org-mode keybindings in a different face than the normal edit commands, thus allowing even faster selection of the correct keybinding.

I haven't checked your source, but I would assume that implementing this feature is not too complex. Please let me know what you think of this feature.

kai2nenobu commented 10 years ago

I've implemented this feature in multiple-highlight branch. Please try it and tell me a usability. Configure your init file as below and type C-x r.

(add-to-list 'guide-key/guide-key-sequence "C-x r")
(setq guide-key/highlight-command-regexp
      '("rectangle"
        ("register"  . font-lock-type-face)
        ("bookmark"  . font-lock-warning-face)))

rectangle commands are highlighted with guide-key/highlight-command-face. register and bookmark commands are highlighted with specified face respectively. Because the front of guide-key/highlight-command-regexp list has higher priority, copy-rectangle-to-register command is highlighted with guide-key/highlight-command-face.

elemakil commented 10 years ago

Works nicely and does exactly what I had in mind!

Will you merge this into the master branch? I have not encountered any bugs.

kai2nenobu commented 10 years ago

OK. :+1: I'll merge soon.