forked from lujun9972/clean-buffers
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
clean-buffers.elc
24 lines (21 loc) · 4.55 KB
/
clean-buffers.elc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
;ELC
;;; Compiled
;;; in Emacs version 29.3
;;; with all optimizations.
(require 'cl-lib)#@44 Is the BUFFER already show in some window.
(defalias 'clean-buffers--buffer-active-p #[(buffer) "\301\302\"\207" [buffer get-buffer-window t] 3 (#$ . 101)])#@34 Is the BUFFER holding a process.
(defalias 'clean-buffers--buffer-process-holding-p #[(buffer) "\301!\207" [buffer get-buffer-process] 2 (#$ . 264)])
(byte-code "\300\301\302\303\304\305\306\307&\210\310\311\302\312\313\314\306\301&\210\310\315\302\316\313\317\306\301&\210\310\320\321\322\306\301\313\323&\210\310\324\325\326\306\301\313\327&\207" [custom-declare-group clean-buffers nil "Clean useless buffers." :prefix "clean-buffers-" :group convenience custom-declare-variable clean-buffers-kill-active-buffer "If non-nil, will clean active buffer; default to nil." :type (boolean) clean-buffers-kill-proces-holding-buffer "If non-nil, will clean process-holding buffer; default to nil." (boolean) clean-buffers-judge-useless-buffer-functions '(clean-buffers-judge-useless-buffer-by-time clean-buffers-judge-useless-buffer-by-name) "Function list which used to determine a buffer is useless or not\n\nThe function will take a buffer as the only argument and should return non-nil\nwhen the buffer is a useless buffer." (repeat function) clean-buffers-useless-buffer-time-out (* 7 24 3600) "Buffers which undisplayed time exceeded this value will be considered useless.\n\nIt used in `clean-buffers-judge-useless-buffer-by-time'." (integer)] 8)#@147 Buffer which did not displayed for specify time considered to be useless
the expire time is determined by `clean-buffers-useless-buffer-time-out'
(defalias 'clean-buffers-judge-useless-buffer-by-time #[(buffer) "\304\211\305\306 !\305\307\310\311\n!\"! ZV*\207" [buffer-last-display-time now buffer clean-buffers-useless-buffer-time-out nil float-time current-time buffer-local-value buffer-display-time get-buffer] 5 (#$ . 1525)])
(byte-code "\300\301\302\303\304\305\306\307&\210\300\310\311\312\304\305\306\313&\207" [custom-declare-variable clean-buffers-useless-buffer-names '("*Buffer List*" "*Backtrace*" "*Apropos*" "*Completions*" "*Help*" "\\.~master~" "\\*vc-dir\\*" "\\*tramp/.+\\*" "\\*vc-git.+\\*") "Useless buffer list." :group clean-buffers :type (repeat regexp) clean-buffers-useful-buffer-names '("*Tree*") "Useful buffer list." (repeat regexp)] 8)#@42 Return non-nil if the BUFFER is useless.
(defalias 'clean-buffers-judge-useless-buffer-by-name #[(buffer) "\301\302\"\207" [clean-buffers-useless-buffer-names cl-some #[(reg) "\302 \"\207" [reg buffer string-match] 3]] 3 (#$ . 2405)])#@116 Use functions in `clean-buffers-judge-useless-buffer-functions' to determine
the BUFFER is a useless buffer or not
(defalias 'clean-buffers--useless-buffer-p #[(buffer) "\303!\203\n \304!\305\306 \"?\205 \305\307\n\"\207" [buffer clean-buffers-useful-buffer-names clean-buffers-judge-useless-buffer-functions bufferp buffer-name cl-some #[(reg) "\302 \"\207" [reg buffer string-match] 3] #[(fn) " !\207" [fn buffer] 2]] 3 (#$ . 2648)])#@52 Kill the BUFFER if the BUFFER is a useless buffer.
(defalias 'clean-buffers--kill-useless-buffer #[(buffer &optional kill-active kill-process-holding) "\303!?\206 \204 \304!\206 \n?\205 \305!?\205% \306\307\"\210\310!\207" [buffer kill-active kill-process-holding clean-buffers--useless-buffer-p clean-buffers--buffer-active-p clean-buffers--buffer-process-holding-p message "Cleaning `%s`... done!" kill-buffer] 3 (#$ . 3095)])#@27 Clean all useless buffer.
(defalias 'clean-buffers-kill-useless-buffers #[nil "\305\306 \203 @\307\n\f#\203 T A)\202 )\310\311\312X\203, \313\202- \314#)\207" [killed #1=#:tail buffer clean-buffers-kill-active-buffer clean-buffers-kill-proces-holding-buffer 0 buffer-list clean-buffers--kill-useless-buffer message "[INFO] Total of %s buffer%s cleaned" 2 "s" ""] 5 (#$ . 3539) nil])#@33 Clean useless buffers interval.
(custom-declare-variable 'clean-buffers-auto-clean-interval 10 '(#$ . 3941) :type '(integer) :group 'clean-buffers)
(defvar clean-buffers-auto-clean-timer nil)#@25 Clean buffers by timer.
(defalias 'clean-buffers-turn-off-auto-clean-buffers #[nil "\301!\205 \302!\207" [clean-buffers-auto-clean-timer timerp cancel-timer] 2 (#$ . 4138) nil])#@32 Cancel clean buffers by timer.
(defalias 'clean-buffers-turn-on-auto-clean-buffers #[nil "\302 \210\303\304\305#\211\207" [clean-buffers-auto-clean-interval clean-buffers-auto-clean-timer clean-buffers-turn-off-auto-clean-buffers run-with-timer 0 clean-buffers-kill-useless-buffers] 4 (#$ . 4324) nil])
(provide 'clean-buffers)