\f
* Changes in Specialized Modes and Packages in Emacs 24.2
+** New `derived-mode' filter for Ibuffer, bound to `/ w'.
+
** Apropos
*** The faces used by Apropos are now directly customizable.
+2012-04-24 Ivan Andrus <darthandrus@gmail.com> (tiny change)
+
+ * ibuf-ext.el (ibuffer-list-buffer-modes): Add `include-parents' arg.
+ (ibuffer-filter-by-derived-mode): New filter.
+ * ibuffer.el (ibuffer-mode-map): Bind to `/ w'.
+
2012-04-23 Andreas Politz <politza@fh-trier.de>
* subr.el (accept-change-group): Fix arg usage (Bug#6095).
(concat " [" (cadr type) ": " (format "%s]" (cdr qualifier)))))))
-(defun ibuffer-list-buffer-modes ()
+(defun ibuffer-list-buffer-modes (&optional include-parents)
"Create an alist of buffer modes currently in use.
+If INCLUDE-PARENTS is non-nil then include parent modes.
The list returned will be of the form (\"MODE-NAME\" . MODE-SYMBOL)."
(let ((bufs (buffer-list))
(modes)
(while bufs
(setq this-mode (buffer-local-value 'major-mode (car bufs))
bufs (cdr bufs))
- (add-to-list
- 'modes
- `(,(symbol-name this-mode) .
- ,this-mode)))
+ (while this-mode
+ (add-to-list
+ 'modes
+ `(,(symbol-name this-mode) .
+ ,this-mode))
+ (setq this-mode (and include-parents
+ (get this-mode 'derived-mode-parent)))))
modes))
"")))))
(eq qualifier (buffer-local-value 'major-mode buf)))
+(define-ibuffer-filter derived-mode
+ "Toggle current view to buffers whose major mode inherits from QUALIFIER."
+ (:description "derived mode"
+ :reader
+ (intern
+ (completing-read "Filter by derived mode: "
+ (ibuffer-list-buffer-modes t)
+ nil nil "")))
+ (with-current-buffer buf (derived-mode-p qualifier)))
+
;;;###autoload (autoload 'ibuffer-filter-by-name "ibuf-ext")
(define-ibuffer-filter name
"Toggle current view to buffers with name matching QUALIFIER."
(define-key map (kbd "/ m") 'ibuffer-filter-by-mode)
(define-key map (kbd "/ M") 'ibuffer-filter-by-used-mode)
+ (define-key map (kbd "/ w") 'ibuffer-filter-by-derived-mode)
(define-key map (kbd "/ n") 'ibuffer-filter-by-name)
(define-key map (kbd "/ c") 'ibuffer-filter-by-content)
(define-key map (kbd "/ e") 'ibuffer-filter-by-predicate)
;;;;;; ibuffer-backward-filter-group ibuffer-forward-filter-group
;;;;;; ibuffer-toggle-filter-group ibuffer-mouse-toggle-filter-group
;;;;;; ibuffer-interactive-filter-by-mode ibuffer-mouse-filter-by-mode
-;;;;;; ibuffer-auto-mode) "ibuf-ext" "ibuf-ext.el" "1400db1bc3d4a3010cbc4807a6725072")
+;;;;;; ibuffer-auto-mode) "ibuf-ext" "ibuf-ext.el" "b2b8f11ad22546ad05d6db0b7d388ac1")
;;; Generated autoloads from ibuf-ext.el
(autoload 'ibuffer-auto-mode "ibuf-ext" "\