diff options
author | Tom Willemse | 2014-02-16 14:09:05 +0100 |
---|---|---|
committer | Tom Willemse | 2014-02-16 14:09:05 +0100 |
commit | 1b9ae3bef746cff65b80c96599a10b11c85a3a9a (patch) | |
tree | 4e2e64ab580a7bc53bda4ca473a3f9a8f47ccd11 | |
parent | 6e0bef84ca5cbc5d40a0fb7f26babd3221e016b8 (diff) | |
download | transient-navigation-1b9ae3bef746cff65b80c96599a10b11c85a3a9a.tar.gz transient-navigation-1b9ae3bef746cff65b80c96599a10b11c85a3a9a.zip |
Change cursor color and type during navigation
-rw-r--r-- | transient-navigation.el | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/transient-navigation.el b/transient-navigation.el index 4bd71c4..50e8a7e 100644 --- a/transient-navigation.el +++ b/transient-navigation.el @@ -42,6 +42,25 @@ ;;; Code: +(defgroup transient-navigation nil + "Customization group for the `transient-navigation' package." + :group 'convenience) + +(defcustom transient-navigation-cursor-color "#0074D9" + "Color for the cursor when a transient navigation map is enabled. + +A value of nil disables changing the color of the cursor when a +transient map is enabled." + :group 'transient-navigation + :type 'color) + +(defcustom transient-navigation-cursor-type nil + "The type of cursor to use when a transient map is enabled. + +A value of nil disables changing the type of the cursor when a +transient map is enabled." + :group 'transient-navigation) + (defvar transient-navigation-mode-map (make-sparse-keymap) "The keymap that will start all the trouble. @@ -61,7 +80,18 @@ the transient keymap.") (interactive) (ignore args) (call-interactively #',func) - (set-transient-map ,map t)) + (let ((current-cursor-color (frame-parameter (selected-frame) 'cursor-color)) + (current-cursor-type cursor-type)) + (when transient-navigation-cursor-color + (set-cursor-color transient-navigation-cursor-color)) + (when transient-navigation-cursor-type + (setq cursor-type transient-navigation-cursor-type)) + (set-transient-map + ,map t (lambda () + (when transient-navigation-cursor-color + (set-cursor-color current-cursor-color)) + (when transient-navigation-cursor-type + (setq cursor-type current-cursor-type)))))) (define-key ,map (kbd ,key) #',func) (define-key transient-navigation-mode-map [remap ,func] #',funcname)))) |