changeset 44871:15b639b48157

(ibuffer-saved-filter-groups): Don't include broken defaults. (ibuffer-yank): Be sure to `setq' after we use `nconc'. (ibuffer-save-filter-groups): Correctly structure filter groups. (ibuffer-switch-to-saved-filter-groups): Correctly extract filter groups.
author Colin Walters <walters@gnu.org>
date Fri, 26 Apr 2002 03:59:35 +0000
parents ed308b745565
children 9247dfe141e4
files lisp/ibuf-ext.el
diffstat 1 files changed, 5 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ibuf-ext.el	Fri Apr 26 03:59:18 2002 +0000
+++ b/lisp/ibuf-ext.el	Fri Apr 26 03:59:35 2002 +0000
@@ -157,20 +157,7 @@
   :type 'boolean
   :group 'ibuffer)
 
-(defcustom ibuffer-saved-filter-groups
-  '(("gnus"
-     ((or (mode . message-mode)
-	  (mode . mail-mode)
-	  (mode . gnus-group-mode)
-	  (mode . gnus-summary-mode) 
-	  (mode . gnus-article-mode))))
-    ("programming"
-     ((or (mode . emacs-lisp-mode)
-	  (mode . cperl-mode)
-	  (mode . c-mode)
-	  (mode . java-mode) 
-	  (mode . idl-mode)
-	  (mode . lisp-mode)))))
+(defcustom ibuffer-saved-filter-groups nil
 				  
   "An alist of filtering groups to switch between.
 
@@ -648,7 +635,8 @@
       (cond ((= pos 0)
 	     (push last-killed ibuffer-filter-groups))
 	    ((= pos (1- (length all-groups)))
-	     (nconc ibuffer-filter-groups (list last-killed)))
+	     (setq ibuffer-filter-groups
+		   (nconc ibuffer-filter-groups (list last-killed))))
 	    (t
 	     (let ((cell (nthcdr pos ibuffer-filter-groups)))
 	       (setf (cdr cell) (cons (car cell) (cdr cell)))
@@ -668,7 +656,7 @@
       ibuffer-filter-groups)))
   (ibuffer-aif (assoc name ibuffer-saved-filter-groups)
       (setcdr it groups)
-    (push (list name groups) ibuffer-saved-filter-groups))
+    (push (cons name groups) ibuffer-saved-filter-groups))
   (ibuffer-maybe-save-stuff)
   (ibuffer-update-mode-name))
 
@@ -699,7 +687,7 @@
 	(error "No saved filters")
       (completing-read "Switch to saved filter group: "
 		       ibuffer-saved-filter-groups nil t))))
-  (setq ibuffer-filter-groups (assoc name ibuffer-saved-filter-groups))
+  (setq ibuffer-filter-groups (cdr (assoc name ibuffer-saved-filter-groups)))
   (ibuffer-update nil t))
 
 ;;;###autoload