From 8faf612db088b8305175ec656eafc9a601203cea Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sun, 10 Sep 2017 09:40:53 +0200 Subject: [PATCH] =?UTF-8?q?[Init]=20Move=20definition=20of=20timers=20into?= =?UTF-8?q?=20=E2=80=98use-package=E2=80=99=20declarations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- init.el | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/init.el b/init.el index 06aec78..498b79d 100644 --- a/init.el +++ b/init.el @@ -189,14 +189,6 @@ (bind-key [remap kill-whole-line] #'crux-kill-whole-line) (bind-key [remap open-line] #'crux-smart-open-line-above) - ;; Timers - - (run-with-timer 0 3600 #'org-clock-save) - (run-with-timer 0 3600 #'recentf-save-list) - (run-with-timer 0 3600 #'bbdb-save) - (run-with-timer 0 3600 #'emms-cache-save) - (run-with-idle-timer 1200 t #'db/export-diary) - ;; Environment Variables (exec-path-from-shell-copy-envs '("SSH_AUTH_SOCK" @@ -455,7 +447,10 @@ ;; avoid important buffers to end up in `org-agenda-new-buffers’ by ;; opening them manually - (mapc #'find-file-noselect org-agenda-files))) + (mapc #'find-file-noselect org-agenda-files) + + (run-with-timer 0 3600 #'org-clock-save) + (run-with-idle-timer 1200 t #'db/export-diary))) (use-package org-ref :config (progn @@ -607,7 +602,8 @@ _h_ _l_ _o_k _y_ank db/work-mail-address)) bbdb-file (expand-file-name "private/bbdb" emacs-d)) (add-hook 'message-setup-hook 'bbdb-mail-aliases) - (add-hook 'mail-setup-hook 'bbdb-mail-aliases))) + (add-hook 'mail-setup-hook 'bbdb-mail-aliases) + (run-with-timer 0 3600 #'bbdb-save))) (use-package gnus :defines (gnus-init-file) @@ -824,7 +820,8 @@ _h_ _l_ _o_k _y_ank (use-package recentf :commands (recentf-mode recentf-save-list) - :init (setq recentf-max-saved-items 1000)) + :init (setq recentf-max-saved-items 1000) + :config (run-with-timer 0 3600 #'recentf-save-list)) (use-package company :commands (company-mode global-company-mode)) @@ -863,7 +860,8 @@ _h_ _l_ _o_k _y_ank db/play-playlist emms-cache-save emms-play-directory-tree - emms-control/body)) + emms-control/body) + :config (run-with-timer 0 3600 #'emms-cache-save)) (use-package helm-emms :commands (helm-emms)