[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[mhc:02100] screen saver



おもいつきでemacsのスクリーンセーバをつくりました。
5分たつとmhc月間予定表が表示されます。
プライベートの予定はマスクする設定にしてあります。

(defvar my-screen-saver-timeout (* 5 60))
(defvar my-screen-saver-function 'mhc-goto-this-month)
(defvar my-screen-saver-function-args '(hide-private))
(defvar my-screen-saver-message " In idleness..")
(defconst my-screen-saver-forever (* 60 60 24 365))
(defvar my-screen-saver-timer nil)
(defun my-screen-saver ()
  (save-excursion
    (save-window-excursion
      (apply my-screen-saver-function my-screen-saver-function-args)
      (delete-other-windows)
      (message my-screen-saver-message)
      (sit-for my-screen-saver-forever))))
(defun my-screen-saver-start ()
  (interactive)
  (setq my-screen-saver-timer
        (run-with-idle-timer my-screen-saver-timeout
                             my-screen-saver-timeout
                             'my-screen-saver)))
(defun my-screen-saver-stop ()
  (interactive)
  (cancel-timer my-screen-saver-timer)
  (setq my-screen-saver-timer nil)
  (cancel-function-timers 'my-screen-saver))

--
KOIE Hidetaka <hide@xxxxxxxx>