[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/gc-buffers bf2940e067 07/11: Add function to kill *Async S
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/gc-buffers bf2940e067 07/11: Add function to kill *Async Shell Command* buffers |
Date: |
Sun, 27 Nov 2022 15:59:54 -0500 (EST) |
branch: elpa/gc-buffers
commit bf2940e067b28f82c5e6e4114f4e2dd804cc3645
Author: Akib Azmain Turja <akib@disroot.org>
Commit: Akib Azmain Turja <akib@disroot.org>
Add function to kill *Async Shell Command* buffers
---
gc-buffers.el | 28 ++++++++++++++++++++++------
1 file changed, 22 insertions(+), 6 deletions(-)
diff --git a/gc-buffers.el b/gc-buffers.el
index a706747386..531c19feb0 100644
--- a/gc-buffers.el
+++ b/gc-buffers.el
@@ -52,11 +52,13 @@
:link '(url-link "https://codeberg.org/akib/emacs-gc-buffers")
:prefix "gc-buffers-")
-(defcustom gc-buffers-functions (list #'gc-buffers-elisp-flymake
- #'gc-buffers-elisp-flymake-stderr
- #'gc-buffers-inactive-minibuffer
- #'gc-buffers-flymake-diagnostics
- #'gc-buffers-helpful-all)
+(defcustom gc-buffers-functions
+ (list #'gc-buffers-elisp-flymake
+ #'gc-buffers-elisp-flymake-stderr
+ #'gc-buffers-inactive-minibuffer
+ #'gc-buffers-flymake-diagnostics
+ #'gc-buffers-helpful-all
+ #'gc-buffers-async-shell-command-buffer)
"Functions to find garbage buffers.
Each function is called with the buffer to test, and if any of the
@@ -72,7 +74,8 @@ example, never put `always' here, that would delete all
buffers."
#'gc-buffers-inactive-minibuffer
#'gc-buffers-flymake-diagnostics
#'gc-buffers-flymake-diagnostics-all
- #'gc-buffers-helpful-all))
+ #'gc-buffers-helpful-all
+ #'gc-buffers-async-shell-command-buffer))
(defcustom gc-buffers-ignore-functions (list #'gc-buffers-ignore-visible)
"Functions to ignore buffers while killing.
@@ -185,6 +188,19 @@ Check if the major mode of BUFFER is
`flymake-diagnostics-buffer-mode'."
Check if the major mode of BUFFER is `helpful-mode'."
(eq (buffer-local-value 'major-mode buffer) 'helpful-mode))
+(defun gc-buffers-async-shell-command-buffer (buffer)
+ "Kill garbage *Async Shell Command* buffer.
+
+A buffer is considered garbage if it has no process.
+
+Check if the name of BUFFER begins with *Async Shell Command* and it has
+no process."
+ (and (string-match-p (rx string-start "*Async Shell Command*"
+ (zero-or-more not-newline)
+ string-end)
+ (buffer-name buffer))
+ (not (get-buffer-process buffer))))
+
;;;; Ignore functions:
- [nongnu] branch elpa/gc-buffers created (now a3defe8f9e), ELPA Syncer, 2022/11/27
- [nongnu] elpa/gc-buffers 5593630e62 01/11: Add buffer killer and option to kill elisp-flymake buffers, ELPA Syncer, 2022/11/27
- [nongnu] elpa/gc-buffers bf2940e067 07/11: Add function to kill *Async Shell Command* buffers,
ELPA Syncer <=
- [nongnu] elpa/gc-buffers a8a66f3183 04/11: Add more buffer testing functions, ELPA Syncer, 2022/11/27
- [nongnu] elpa/gc-buffers 52d45bbbde 06/11: Add COPYING, ELPA Syncer, 2022/11/27
- [nongnu] elpa/gc-buffers 1867fdcf0c 05/11: Fix typo, ELPA Syncer, 2022/11/27
- [nongnu] elpa/gc-buffers ad617cfb62 02/11: Add option to ignore certain buffers, ELPA Syncer, 2022/11/27
- [nongnu] elpa/gc-buffers c73f437316 08/11: Remove gc-buffers-inactive-minibuffer, ELPA Syncer, 2022/11/27
- [nongnu] elpa/gc-buffers afacf55458 03/11: Add function to kill " *stderr of elisp-flymake-byte-compile*", ELPA Syncer, 2022/11/27
- [nongnu] elpa/gc-buffers 7ac5ba1a89 10/11: Ignore errors in gc-buffers-functions, ELPA Syncer, 2022/11/27
- [nongnu] elpa/gc-buffers a3defe8f9e 11/11: Add .dir-locals.el, ELPA Syncer, 2022/11/27
- [nongnu] elpa/gc-buffers 53e0772891 09/11: Fix grammatical error, ELPA Syncer, 2022/11/27