comparison lisp/frame.el @ 26332:37f66ea5d1a1

* frame.el (blink-cursor-mode, blink-cursor-end): Use internal-show-cursor with new interface. (blink-cursor-timer-function): New. (blink-cursor-start): Use blink-cursor-timer-function.
author Gerd Moellmann <gerd@gnu.org>
date Wed, 03 Nov 1999 15:56:19 +0000
parents 6de035f92990
children a896ba4a496b
comparison
equal deleted inserted replaced
26331:5158100a609c 26332:37f66ea5d1a1
836 blink-cursor-timer nil 836 blink-cursor-timer nil
837 blink-cursor-mode nil) 837 blink-cursor-mode nil)
838 (if on-p 838 (if on-p
839 (progn 839 (progn
840 ;; Hide the cursor. 840 ;; Hide the cursor.
841 (internal-show-cursor 0) 841 (internal-show-cursor nil nil)
842 (setq blink-cursor-idle-timer 842 (setq blink-cursor-idle-timer
843 (run-with-idle-timer blink-cursor-delay 843 (run-with-idle-timer blink-cursor-delay
844 blink-cursor-delay 844 blink-cursor-delay
845 'blink-cursor-start)) 845 'blink-cursor-start))
846 (setq blink-cursor-mode t))))) 846 (setq blink-cursor-mode t)))))
861 command starts, by installing a pre-command hook." 861 command starts, by installing a pre-command hook."
862 (when (null blink-cursor-timer) 862 (when (null blink-cursor-timer)
863 (add-hook 'pre-command-hook 'blink-cursor-end) 863 (add-hook 'pre-command-hook 'blink-cursor-end)
864 (setq blink-cursor-timer 864 (setq blink-cursor-timer
865 (run-with-timer blink-cursor-interval blink-cursor-interval 865 (run-with-timer blink-cursor-interval blink-cursor-interval
866 'internal-show-cursor)))) 866 'blink-cursor-timer-function))))
867
868 (defun blink-cursor-timer-function ()
869 "Timer function of timer `blink-cursor-timer'."
870 (internal-show-cursor nil (not (internal-show-cursor-p))))
867 871
868 (defun blink-cursor-end () 872 (defun blink-cursor-end ()
869 "Stop cursor blinking. 873 "Stop cursor blinking.
870 This is installed as a pre-command hook by `blink-cursor-start'. 874 This is installed as a pre-command hook by `blink-cursor-start'.
871 When run, it cancels the timer `blink-cursor-timer' and removes 875 When run, it cancels the timer `blink-cursor-timer' and removes
872 itself as a pre-command hook." 876 itself as a pre-command hook."
873 (remove-hook 'pre-command-hook 'blink-cursor-end) 877 (remove-hook 'pre-command-hook 'blink-cursor-end)
874 (internal-show-cursor 0) 878 (internal-show-cursor nil t)
875 (cancel-timer blink-cursor-timer) 879 (cancel-timer blink-cursor-timer)
876 (setq blink-cursor-timer nil)) 880 (setq blink-cursor-timer nil))
877 881
878 882
879 883