]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid deleting ibuffer named filters by default.
authorChong Yidong <cyd@stupidchicken.com>
Sun, 14 Aug 2011 18:08:20 +0000 (14:08 -0400)
committerChong Yidong <cyd@stupidchicken.com>
Sun, 14 Aug 2011 18:08:20 +0000 (14:08 -0400)
* lisp/ibuf-ext.el (ibuffer-filter-disable): New arg for deleting
filter groups.
(ibuffer-included-in-filter-p-1): Use it.  Suggested by Noam
Postavsky.

Fixes: debbugs:8804
lisp/ChangeLog
lisp/ibuf-ext.el

index 07f45b34a54b2c5780305ed63bac1e7e8f8751db..510f594465c03d8bfba50667bf20fd9d5f7fe8bc 100644 (file)
@@ -1,3 +1,10 @@
+2011-08-14  Chong Yidong  <cyd@stupidchicken.com>
+
+       * ibuf-ext.el (ibuffer-filter-disable): New arg for deleting
+       filter groups.
+       (ibuffer-included-in-filter-p-1): Use it.  Suggested by Noam
+       Postavsky (Bug#8804).
+
 2011-08-12  Juanma Barranquero  <lekktu@gmail.com>
 
        * startup.el (argi): Declare as global variable (bug#9275).
index f4b729458e64a48ea8867d6b3e58048cd348db5c..073efaeee2ae4140310618fb51b0c373727e6e45 100644 (file)
@@ -505,7 +505,7 @@ To evaluate a form without viewing the buffer, see `ibuffer-do-eval'."
              (assoc (cdr filter)
                     ibuffer-saved-filters)))
         (unless data
-          (ibuffer-filter-disable)
+          (ibuffer-filter-disable t)
           (error "Unknown saved filter %s" (cdr filter)))
         (ibuffer-included-in-filters-p buf (cadr data))))
       (t
@@ -514,7 +514,7 @@ To evaluate a form without viewing the buffer, see `ibuffer-do-eval'."
         ;; filterdat should be like (TYPE DESCRIPTION FUNC)
         ;; just a sanity check
        (unless filterdat
-         (ibuffer-filter-disable)
+         (ibuffer-filter-disable t)
          (error "Undefined filter %s" (car filter)))
        (not
         (not
@@ -768,11 +768,14 @@ The value from `ibuffer-saved-filter-groups' is used."
   (ibuffer-update nil t))
 
 ;;;###autoload
-(defun ibuffer-filter-disable ()
-  "Disable all filters currently in effect in this buffer."
+(defun ibuffer-filter-disable (&optional delete-filter-groups)
+  "Disable all filters currently in effect in this buffer.
+With optional arg DELETE-FILTER-GROUPS non-nil, delete all filter
+group definitions by setting `ibuffer-filter-groups' to nil."
   (interactive)
-  (setq ibuffer-filtering-qualifiers nil
-       ibuffer-filter-groups nil)
+  (setq ibuffer-filtering-qualifiers nil)
+  (if delete-filter-groups
+      (setq ibuffer-filter-groups nil))
   (let ((buf (ibuffer-current-buffer)))
     (ibuffer-update nil t)
     (when buf