[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/ibuf-ext.el
From: |
Colin Walters |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/ibuf-ext.el |
Date: |
Tue, 06 Aug 2002 02:04:44 -0400 |
Index: emacs/lisp/ibuf-ext.el
diff -c emacs/lisp/ibuf-ext.el:1.23 emacs/lisp/ibuf-ext.el:1.24
*** emacs/lisp/ibuf-ext.el:1.23 Mon May 13 01:59:48 2002
--- emacs/lisp/ibuf-ext.el Tue Aug 6 02:04:44 2002
***************
*** 922,927 ****
--- 922,947 ----
(error "Ibuffer: bad qualifier %s" qualifier))
(concat " [" (cadr type) ": " (format "%s]" (cdr qualifier)))))))
+
+ (defun ibuffer-list-buffer-modes ()
+ "Create an alist of buffer modes currently in use.
+ The list returned will be of the form ("MODE-NAME" . MODE-SYMBOL)."
+ (let ((bufs (buffer-list))
+ (modes)
+ (this-mode))
+ (while bufs
+ (setq this-mode
+ (with-current-buffer
+ (car bufs)
+ major-mode)
+ bufs (cdr bufs))
+ (add-to-list
+ 'modes
+ `(,(symbol-name this-mode) .
+ ,this-mode)))
+ modes))
+
+
;;; Extra operation definitions
;;;###autoload (autoload 'ibuffer-filter-by-mode "ibuf-ext.el")
***************
*** 940,945 ****
--- 960,984 ----
(with-current-buffer buf
(symbol-name major-mode))
"")))))
+ (eq qualifier (with-current-buffer buf major-mode)))
+
+ ;;;###autoload (autoload 'ibuffer-filter-by-used-mode "ibuf-ext.el")
+ (define-ibuffer-filter used-mode
+ "Toggle current view to buffers with major mode QUALIFIER.
+ Called interactively, this function allows selection of modes
+ currently used by buffers."
+ (:description "major mode in use"
+ :reader
+ (intern
+ (completing-read "Filter by major mode: "
+ (ibuffer-list-buffer-modes)
+ nil
+ t
+ (let ((buf (ibuffer-current-buffer)))
+ (if (and buf (buffer-live-p buf))
+ (with-current-buffer buf
+ (symbol-name major-mode))
+ "")))))
(eq qualifier (with-current-buffer buf major-mode)))
;;;###autoload (autoload 'ibuffer-filter-by-name "ibuf-ext.el")
- [Emacs-diffs] Changes to emacs/lisp/ibuf-ext.el,
Colin Walters <=