"Set the current filter groups to filter by mode."
(interactive)
(setq ibuffer-filter-groups
- (mapcar (lambda (mode)
- (cons (format "%s" mode) `((mode . ,mode))))
- (delete-duplicates
- (mapcar (lambda (buf) (with-current-buffer buf major-mode))
- (buffer-list)))))
+ (mapcar (lambda (mode)
+ (cons (format "%s" mode) `((mode . ,mode))))
+ (let ((modes
+ (delete-duplicates
+ (mapcar (lambda (buf) (with-current-buffer buf major-mode))
+ (buffer-list)))))
+ (if ibuffer-view-ibuffer
+ modes
+ (delq 'ibuffer-mode modes)))))
(ibuffer-update nil t))
;;;###autoload
(interactive)
(when (null ibuffer-filter-groups)
(error "No filtering groups active"))
- (pop ibuffer-filter-groups)
+ (setq ibuffer-hidden-filter-groups
+ (delete (pop ibuffer-filter-groups)
+ ibuffer-hidden-filter-groups))
(ibuffer-update nil t))
;;;###autoload
(defun ibuffer-clear-filter-groups ()
"Remove all filtering groups."
(interactive)
- (setq ibuffer-filter-groups nil)
+ (setq ibuffer-filter-groups nil
+ ibuffer-hidden-filter-groups nil)
(ibuffer-update nil t))
(defun ibuffer-current-filter-groups-with-position ()
(setq name (completing-read "Kill filter group: "
ibuffer-filter-groups nil t)))
(ibuffer-aif (assoc name ibuffer-filter-groups)
- (setq ibuffer-filter-groups (ibuffer-delete-alist
- name ibuffer-filter-groups))
+ (progn
+ (setq ibuffer-filter-groups (ibuffer-delete-alist
+ name ibuffer-filter-groups))
+ (setq ibuffer-hidden-filter-groups
+ delete name ibuffer-hidden-filter-groups))
(error "No filter group with name \"%s\"" name))
(ibuffer-update nil t))
(error "No saved filters")
(completing-read "Switch to saved filter group: "
ibuffer-saved-filter-groups nil t))))
- (setq ibuffer-filter-groups (cdr (assoc name ibuffer-saved-filter-groups)))
+ (setq ibuffer-filter-groups (cdr (assoc name ibuffer-saved-filter-groups))
+ ibuffer-hidden-filter-groups nil)
(ibuffer-update nil t))
;;;###autoload