emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/gc-buffers afacf55458 03/11: Add function to kill " *stder


From: ELPA Syncer
Subject: [nongnu] elpa/gc-buffers afacf55458 03/11: Add function to kill " *stderr of elisp-flymake-byte-compile*"
Date: Sun, 27 Nov 2022 15:59:53 -0500 (EST)

branch: elpa/gc-buffers
commit afacf55458af1ff52553580b3edd7911609fdba2
Author: Akib Azmain Turja <akib@disroot.org>
Commit: Akib Azmain Turja <akib@disroot.org>

    Add function to kill " *stderr of elisp-flymake-byte-compile*"
---
 gc-buffers.el | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/gc-buffers.el b/gc-buffers.el
index 37438628aa..efa09a642a 100644
--- a/gc-buffers.el
+++ b/gc-buffers.el
@@ -53,7 +53,8 @@
   :link '(url-link "https://codeberg.org/akib/emacs-gc-buffers";)
   :prefix "gc-buffers-")
 
-(defcustom gc-buffers-functions (list #'gc-buffers-elisp-flymake)
+(defcustom gc-buffers-functions (list #'gc-buffers-elisp-flymake
+                                      #'gc-buffers-elisp-flymake-stderr)
   "Functions to find garbage buffers.
 
 Each function is called with the buffer to test, and if any of the
@@ -64,7 +65,8 @@ it wants.  The functions should not have any side-effect.
 Warning: Putting wrong functions here may delete working buffers.  For
 example, never put `always' here, that would delete all buffers."
   :type 'hook
-  :options (list #'gc-buffers-elisp-flymake))
+  :options (list #'gc-buffers-elisp-flymake
+                 #'gc-buffers-elisp-flymake-stderr))
 
 (defcustom gc-buffers-ignore-functions (list #'gc-buffers-ignore-visible)
   "Functions to ignore buffers while killing.
@@ -99,8 +101,8 @@ not have any side-effect."
               (funcall (if (eq kill-fn t)
                            #'kill-buffer
                          kill-fn)
-                       buffer))
-            (setq count (1+ count)))))
+                       buffer)
+              (setq count (1+ count))))))
       (when (called-interactively-p 'interactive)
         (message "%s garbage buffer%s killed"
                  (if (zerop count) "No" (number-to-string count))
@@ -136,6 +138,13 @@ Check if BUFFER is a garbage generated by 
`elisp-flymake-byte-compile'."
                        (buffer-name buffer))
        (not (get-buffer-process buffer))))
 
+(defun gc-buffers-elisp-flymake-stderr (buffer)
+  "Kill the stderr buffer generated by `elisp-flymake-byte-compile'.
+
+Check if the name of BUFFER is
+ \" *stderr of elisp-flymake-byte-compile*\"."
+  (string= (buffer-name buffer) " *stderr of elisp-flymake-byte-compile*"))
+
 
 ;;;; Ignore functions:
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]