Skip to content

Instantly share code, notes, and snippets.

@mori-dev
Forked from hitode909/cute-cursor.el
Created March 22, 2010 10:44
Show Gist options
  • Select an option

  • Save mori-dev/339960 to your computer and use it in GitHub Desktop.

Select an option

Save mori-dev/339960 to your computer and use it in GitHub Desktop.
;;(cute-cursor t) ;開始
;;(cute-cursor nil) ;終了
(require 'cl)
(lexical-let ((interval 0.05)
(colors '("red" "green" "blue" "yellow" "purple" "magenta" "cyan"))
(cursor-nth 0)
(timer nil))
(defun cute-cursor (flag)
"Start toggling cursor color when flag is true."
(cond
((and flag timer) (cute-cursor nil))
(flag (setq timer (run-with-timer interval interval
(lambda ()
(set-cursor-color (nth cursor-nth colors))
(incf cursor-nth)
(if (>= cursor-nth (length colors))
(setq cursor-nth 0)))))
(blink-cursor-mode 0))
(timer (cancel-timer timer)
(setq timer nil)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment