diff lisp/gutter-items.el @ 931:3508e2f71814

[xemacs-hg @ 2002-07-24 04:46:29 by andyp] gutter enhancement
author andyp
date Wed, 24 Jul 2002 04:46:29 +0000
parents 4a27df428c73
children cfe4bcb9bdd4
line wrap: on
line diff
--- a/lisp/gutter-items.el	Tue Jul 23 08:35:11 2002 +0000
+++ b/lisp/gutter-items.el	Wed Jul 24 04:46:29 2002 +0000
@@ -66,14 +66,37 @@
 		(function :tag "Other"))
   :group 'buffers-tab)
 
-(defcustom buffers-tab-omit-function 'buffers-menu-omit-invisible-buffers
+(defcustom buffers-tab-omit-function 'buffers-tab-omit-some-buffers
   "*If non-nil, a function specifying the buffers to omit from the buffers tab.
 This is passed a buffer and should return non-nil if the buffer should be
-omitted.  The default value `buffers-menu-omit-invisible-buffers' omits
-buffers that are normally considered \"invisible\" (those whose name
-begins with a space)."
+omitted.  The default value `buffers-tab-omit-some-buffers' omits
+buffers based on the value of `buffers-tab-omit-list'."
   :type '(choice (const :tag "None" nil)
-		 function)
+  		 function)
+  :group 'buffers-tab)
+  
+(defcustom buffers-tab-omit-list '("\\` ")
+  "*A list of types of buffers to omit from the buffers tab.
+This is only used if `buffers-tab-omit-function' is set to
+`buffers-tab-omit-some-buffers', its default value."
+  :type '(checklist
+	  :greedy t
+	  :format "%{Omit List%}: \n%v"
+	  (const
+	   :tag "Invisible buffers (those whose names start with a space) "
+	   "\\` ")
+	  (const
+	   :tag "Help buffers "
+	   "\\`\\*Help")
+	  (const
+	   :tag "Customize buffers "
+	   "\\`\\*Customize")
+	  (const
+	   :tag "`special' buffers (those whose names start with *) "
+	   "\\`\\*")
+	  (const
+	   :tag "`special' buffers other than *scratch*"
+	   "\\`\\*\\([^s]\\|s[^c]\\|sc[^r]\\|scr[^a]\\|scra[^t]\\|scrat[^c]\\|scratc[^h]\\|scratch[^*]\\|scratch\\*.+\\)"))
   :group 'buffers-tab)
 
 (defvar buffers-tab-selection-function 'select-buffers-tab-buffers-by-mode
@@ -664,5 +687,12 @@
 	(display-progress-feedback label str value)
 	str))))
 
+(defun buffers-tab-omit-some-buffers (buf)
+  "For use as a value of `buffers-tab-omit-function'.
+Omit buffers based on the value of `buffers-tab-omit-list', which
+see."
+  (let ((regexp (mapconcat 'concat buffers-tab-omit-list "\\|")))
+    (not (null (string-match regexp (buffer-name buf))))))
+
 (provide 'gutter-items)
 ;;; gutter-items.el ends here.