diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/acdw.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lisp/acdw.el b/lisp/acdw.el index 0203f3b..b127827 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el | |||
@@ -58,6 +58,16 @@ Ready for use with `after-focus-change-function'." | |||
58 | (run-at-time sunset-time (* 60 60 24) sunset-command) | 58 | (run-at-time sunset-time (* 60 60 24) sunset-command) |
59 | (run-at-time "12:00am" (* 60 60 24) sunset-command))) | 59 | (run-at-time "12:00am" (* 60 60 24) sunset-command))) |
60 | 60 | ||
61 | ;;;; Define a function and add it to hooks | ||
62 | (defun defun-with-hooks (hooks function-def) | ||
63 | "Add FUNCTION-DEF to HOOKS. | ||
64 | |||
65 | FUNCTION-DEF should be a `defun' form. This function is just to | ||
66 | put functions that only exist for hooks closer to the hooks | ||
67 | they bind to." | ||
68 | (let ((func function-def)) | ||
69 | (dolist (hook hooks) | ||
70 | (add-hook hook func)))) | ||
61 | ;;; Garbage collection hacks | 71 | ;;; Garbage collection hacks |
62 | 72 | ||
63 | (defconst acdw/gc-cons-threshold-basis (* 800 1024) | 73 | (defconst acdw/gc-cons-threshold-basis (* 800 1024) |