summaryrefslogtreecommitdiff
path: root/modules/wrap-up.el
blob: f1841189698742baca0453cc85e5bbd7a7a43312 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
;;; wrapup --- Functions Run Before Init Completion -*- lexical-binding: t; coding: utf-8; -*-
;; author Craig Jennings <c@cjennings.net>

;;; Commentary:

;;; Code:

;; -------------------------------- Bury Buffers -------------------------------
;; wait a few seconds then bury compile-related buffers.

(defun cj/bury-buffers ()
  "Bury comint and compilation buffers."
  (dolist (buf (buffer-list))
    (with-current-buffer buf
	  (when (or (derived-mode-p 'comint-mode)
				(derived-mode-p 'compilation-mode)
				(derived-mode-p 'debugger-mode)
				(derived-mode-p 'elisp-compile-mode)
				(derived-mode-p 'messages-buffer-mode)
				) ;; byte-compilations
        (bury-buffer)))))

(defun cj/bury-buffers-after-delay ()
  "Run cj/bury-buffers after a delay."
  (run-with-timer 1 nil 'cj/bury-buffers))

(add-hook 'emacs-startup-hook 'cj/bury-buffers-after-delay)

(provide 'wrap-up)
;;; wrap-up.el ends here