Add idle-kill

TODO change property name to buffer-kill-on-idle
master
Jacopo De Simoi 8 years ago
parent dd18ae79aa
commit 6a82e40830
  1. 14
      global.org

@ -340,6 +340,20 @@
#+BEGIN_SRC emacs-lisp
(setq compilation-ask-about-save nil)
#+END_SRC
** Idle-kill
#+BEGIN_SRC emacs-lisp
(defun kill-buffers-on-idle ()
"Kill buffers that have the appropriate property set."
(save-excursion
(save-window-excursion
(dolist (b (buffer-list))
(when (and (with-current-buffer b (boundp 'buffer-close-on-idle))
(with-current-buffer b buffer-close-on-idle))
(with-current-buffer b (message "Killed %s" buffer-file-name))
(pop-to-buffer-same-window b)
(kill-buffer))))))
(run-with-idle-timer 180 t 'kill-buffers-on-idle)
#+END_SRC
** Calendar
#+BEGIN_SRC emacs-lisp
(add-hook 'calendar-load-hook

Loading…
Cancel
Save