Add function for delayed save

master
Jacopo De Simoi 3 years ago
parent 8b8d56cdf9
commit 6e63df3657
  1. 12
      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

Loading…
Cancel
Save