Commit fece59b8 authored by Colin Walters's avatar Colin Walters
Browse files

(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
parent 96777edb
......@@ -157,20 +157,7 @@ The QUALIFIER should be the same as QUALIFIER in
:type 'boolean
:group 'ibuffer)
(defcustom ibuffer-saved-filter-groups
((or (mode . message-mode)
(mode . mail-mode)
(mode . gnus-group-mode)
(mode . gnus-summary-mode)
(mode . gnus-article-mode))))
((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 @@ To evaluate a form without viewing the buffer, see `ibuffer-do-eval'."
(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))))
(let ((cell (nthcdr pos ibuffer-filter-groups)))
(setf (cdr cell) (cons (car cell) (cdr cell)))
......@@ -668,7 +656,7 @@ prompt for NAME, and use the current filters."
(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))
......@@ -699,7 +687,7 @@ of replacing the current filters."
(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))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment