Selaa lähdekoodia

add my-idle-hook

pull/1/head
10sr 10 vuotta sitten
vanhempi
commit
917921b92b
1 muutettua tiedostoa jossa 16 lisäystä ja 0 poistoa
  1. +16
    -0
      emacs.el

+ 16
- 0
emacs.el Näytä tiedosto

@@ -145,6 +145,22 @@ found, otherwise returns nil."
(message "Tetris loaded!")) (message "Tetris loaded!"))
(message "Tetris found!")) (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 ;; start and quit




Ladataan…
Peruuta
Tallenna