diff options
| author | Colin Walters | 2002-04-26 03:59:35 +0000 |
|---|---|---|
| committer | Colin Walters | 2002-04-26 03:59:35 +0000 |
| commit | fece59b88cf8fdc4b8e5dfd75e19a2dce5c736fc (patch) | |
| tree | fb22688efc521e5331dbc931427c40bae33105b6 | |
| parent | 96777edb8235b7087cef34e20778ce8c946a7b13 (diff) | |
| download | emacs-fece59b88cf8fdc4b8e5dfd75e19a2dce5c736fc.tar.gz emacs-fece59b88cf8fdc4b8e5dfd75e19a2dce5c736fc.zip | |
(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.
| -rw-r--r-- | lisp/ibuf-ext.el | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el index baef4d0b201..df18a7d4a55 100644 --- a/lisp/ibuf-ext.el +++ b/lisp/ibuf-ext.el | |||
| @@ -157,20 +157,7 @@ The QUALIFIER should be the same as QUALIFIER in | |||
| 157 | :type 'boolean | 157 | :type 'boolean |
| 158 | :group 'ibuffer) | 158 | :group 'ibuffer) |
| 159 | 159 | ||
| 160 | (defcustom ibuffer-saved-filter-groups | 160 | (defcustom ibuffer-saved-filter-groups nil |
| 161 | '(("gnus" | ||
| 162 | ((or (mode . message-mode) | ||
| 163 | (mode . mail-mode) | ||
| 164 | (mode . gnus-group-mode) | ||
| 165 | (mode . gnus-summary-mode) | ||
| 166 | (mode . gnus-article-mode)))) | ||
| 167 | ("programming" | ||
| 168 | ((or (mode . emacs-lisp-mode) | ||
| 169 | (mode . cperl-mode) | ||
| 170 | (mode . c-mode) | ||
| 171 | (mode . java-mode) | ||
| 172 | (mode . idl-mode) | ||
| 173 | (mode . lisp-mode))))) | ||
| 174 | 161 | ||
| 175 | "An alist of filtering groups to switch between. | 162 | "An alist of filtering groups to switch between. |
| 176 | 163 | ||
| @@ -648,7 +635,8 @@ To evaluate a form without viewing the buffer, see `ibuffer-do-eval'." | |||
| 648 | (cond ((= pos 0) | 635 | (cond ((= pos 0) |
| 649 | (push last-killed ibuffer-filter-groups)) | 636 | (push last-killed ibuffer-filter-groups)) |
| 650 | ((= pos (1- (length all-groups))) | 637 | ((= pos (1- (length all-groups))) |
| 651 | (nconc ibuffer-filter-groups (list last-killed))) | 638 | (setq ibuffer-filter-groups |
| 639 | (nconc ibuffer-filter-groups (list last-killed)))) | ||
| 652 | (t | 640 | (t |
| 653 | (let ((cell (nthcdr pos ibuffer-filter-groups))) | 641 | (let ((cell (nthcdr pos ibuffer-filter-groups))) |
| 654 | (setf (cdr cell) (cons (car cell) (cdr cell))) | 642 | (setf (cdr cell) (cons (car cell) (cdr cell))) |
| @@ -668,7 +656,7 @@ prompt for NAME, and use the current filters." | |||
| 668 | ibuffer-filter-groups))) | 656 | ibuffer-filter-groups))) |
| 669 | (ibuffer-aif (assoc name ibuffer-saved-filter-groups) | 657 | (ibuffer-aif (assoc name ibuffer-saved-filter-groups) |
| 670 | (setcdr it groups) | 658 | (setcdr it groups) |
| 671 | (push (list name groups) ibuffer-saved-filter-groups)) | 659 | (push (cons name groups) ibuffer-saved-filter-groups)) |
| 672 | (ibuffer-maybe-save-stuff) | 660 | (ibuffer-maybe-save-stuff) |
| 673 | (ibuffer-update-mode-name)) | 661 | (ibuffer-update-mode-name)) |
| 674 | 662 | ||
| @@ -699,7 +687,7 @@ of replacing the current filters." | |||
| 699 | (error "No saved filters") | 687 | (error "No saved filters") |
| 700 | (completing-read "Switch to saved filter group: " | 688 | (completing-read "Switch to saved filter group: " |
| 701 | ibuffer-saved-filter-groups nil t)))) | 689 | ibuffer-saved-filter-groups nil t)))) |
| 702 | (setq ibuffer-filter-groups (assoc name ibuffer-saved-filter-groups)) | 690 | (setq ibuffer-filter-groups (cdr (assoc name ibuffer-saved-filter-groups))) |
| 703 | (ibuffer-update nil t)) | 691 | (ibuffer-update nil t)) |
| 704 | 692 | ||
| 705 | ;;;###autoload | 693 | ;;;###autoload |