[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r108014: * lisp/ibuf-ext.el (ibuffer-
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r108014: * lisp/ibuf-ext.el (ibuffer-list-buffer-modes): Add `include-parents' arg. |
Date: |
Mon, 23 Apr 2012 22:07:40 -0400 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 108014
author: Ivan Andrus <address@hidden>
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Mon 2012-04-23 22:07:40 -0400
message:
* 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'.
modified:
etc/NEWS
lisp/ChangeLog
lisp/ibuf-ext.el
lisp/ibuffer.el
=== modified file 'etc/NEWS'
--- a/etc/NEWS 2012-04-23 15:38:48 +0000
+++ b/etc/NEWS 2012-04-24 02:07:40 +0000
@@ -74,6 +74,8 @@
* 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.
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2012-04-23 15:48:22 +0000
+++ b/lisp/ChangeLog 2012-04-24 02:07:40 +0000
@@ -1,3 +1,9 @@
+2012-04-24 Ivan Andrus <address@hidden> (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 <address@hidden>
* subr.el (accept-change-group): Fix arg usage (Bug#6095).
=== modified file 'lisp/ibuf-ext.el'
--- a/lisp/ibuf-ext.el 2012-01-19 07:21:25 +0000
+++ b/lisp/ibuf-ext.el 2012-04-24 02:07:40 +0000
@@ -973,8 +973,9 @@
(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 @@
(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 @@
"")))))
(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."
=== modified file 'lisp/ibuffer.el'
--- a/lisp/ibuffer.el 2012-04-22 13:58:00 +0000
+++ b/lisp/ibuffer.el 2012-04-24 02:07:40 +0000
@@ -503,6 +503,7 @@
(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 @@
;;;;;; 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" "\
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r108014: * lisp/ibuf-ext.el (ibuffer-list-buffer-modes): Add `include-parents' arg.,
Stefan Monnier <=