Commit c4cf6d91 authored by Ivan Andrus's avatar Ivan Andrus Committed by Stefan Monnier
Browse files

* lisp/ibuf-ext.el (ibuffer-list-buffer-modes): Add `include-parents' arg.

(ibuffer-filter-by-derived-mode): New filter.
* lisp/ibuffer.el (ibuffer-mode-map): Bind to `/ w'.
parent 02fd101b
......@@ -74,6 +74,8 @@ character when doing minibuffer filename prompts.
* 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).
......
......@@ -973,8 +973,9 @@ Interactively, prompt for NAME, and use the current filters."
(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)
......@@ -982,10 +983,13 @@ The list returned will be of the form (\"MODE-NAME\" . MODE-SYMBOL)."
(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))
......@@ -1027,6 +1031,16 @@ currently used by buffers."
"")))))
(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."
......
......@@ -503,6 +503,7 @@ directory, like `default-directory'."
(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)
......@@ -2645,7 +2646,7 @@ will be inserted before the group at point."
;;;;;; 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" "\
......
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