瀏覽代碼

add my-idle-hook

pull/1/head
10sr 11 年之前
父節點
當前提交
917921b92b
共有 1 個檔案被更改,包括 16 行新增0 行删除
  1. +16
    -0
      emacs.el

+ 16
- 0
emacs.el 查看文件

@@ -145,6 +145,22 @@ found, otherwise returns nil."
(message "Tetris loaded!"))
(message "Tetris found!"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; my-idle-hook

(defvar my-idle-hook nil
"Hook run when idle for several secs.")
(defvar my-idle-hook-sec 5
"Second to run `my-idle-hook'.")
(run-with-idle-timer my-idle-hook-sec
t
(lambda ()
(run-hooks 'my-idle-hook)))

(add-hook 'my-idle-hook
(lambda ()
(message "idle hook message")))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; start and quit



Loading…
取消
儲存