Have the following code but want to use let
in the function blink-cursor-timer-function
. Have started doing the changes but do require some assistance with it. The variable names veak-indicator-point
, veak-indicator-colour
are long, and want to shorten them. A good way is to use local variables within a let
construct, but keeping the long descriptive names present. I do not think I can remove the variable veak-indicator-point
, replace it with a local variable, and still have the cursor change colour upon blinking.
(defvar veak-indicator-point 0
"Sets colour of cursor.")
(defvar veak-indicator-colour
(list "#FFA500" "#8A8AFF" "#FF6161" "#61FF61"
"#FFFF00" "#E859E8" "#FFFFFF" "#FFC370" "#C370FF")
"Sets colours for cursor.")
(defun blink-cursor-timer-function ()
"Blinks the cursor"
(when (not (internal-show-cursor-p))
(when (>= veak-indicator-point (length veak-indicator-colour))
(setq veak-indicator-point 0))
(set-cursor-color (nth veak-indicator-point veak-indicator-colour))
(setq veak-indicator-point (+ 1 veak-indicator-point)))
(internal-show-cursor nil (not (internal-show-cursor-p)) ))
I have started with the following
(defun blink-cursor-timer-function ()
"Blinks the cursor"
(let ( (i veak-indicator-point)
(n (length veak-indicator-colour)) )
(when (not (internal-show-cursor-p))
(when (>= i n) (setq i 0))
(set-cursor-color (nth i veak-indicator-colour))
(setq i (+ 1 i))
(setq veak-indicator-point i))
(internal-show-cursor nil (not (internal-show-cursor-p))) )))