diff --git a/global.org b/global.org index bddd18a..4860fb0 100644 --- a/global.org +++ b/global.org @@ -124,6 +124,18 @@ (face-list)) (set-face-font 'default "-xos4-hackminus-medium-r-normal--20-200-72-72-c-100-ISO10646-1")) #+end_src + This function saves the current buffer after the specified amount + of idle time, unless something calls it again and then the timer + restarts + #+begin_src emacs-lisp + (defun save--buffer-buf (buf) + (with-current-buffer buf (save-buffer))) + (defun save-buffer-with-timer (secs) + (when (and (boundp 'save-timer) save-timer) + (cancel-timer save-timer)) + (setq-local save-timer (run-with-idle-timer secs nil + #'save--buffer-buf (current-buffer)))) + #+end_src ** Cosmetics Prefer a minimal appearance: no menu, toolbar or scroll-bars; no splash screens or messages