summaryrefslogtreecommitdiff
path: root/lisp/ibuffer.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2019-07-26 14:38:35 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2019-07-26 14:38:35 +0200
commite986ba1968ad221be3150e4b4cd51a345e980e3b (patch)
tree7182d3449be09d90bf9e050f6a6ab27d72ebd9c6 /lisp/ibuffer.el
parent68789c9370f62e9288683591a1849fd3843e7a13 (diff)
downloademacs-e986ba1968ad221be3150e4b4cd51a345e980e3b.tar.gz
emacs-e986ba1968ad221be3150e4b4cd51a345e980e3b.tar.bz2
emacs-e986ba1968ad221be3150e4b4cd51a345e980e3b.zip
Separate out the "/" prefix into a named keymap in ibuffer
* lisp/ibuffer.el (ibuffer--filter-map): Separate out into its own keymap (bug#25797). (ibuffer-mode-map): Bind the "/" key to it.
Diffstat (limited to 'lisp/ibuffer.el')
-rw-r--r--lisp/ibuffer.el84
1 files changed, 45 insertions, 39 deletions
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index 54992f279b9..23f7a2a8e4a 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -421,6 +421,49 @@ directory, like `default-directory'."
groups-map))
+(defvar ibuffer--filter-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map (kbd "RET") 'ibuffer-filter-by-mode)
+ (define-key map (kbd "m") 'ibuffer-filter-by-used-mode)
+ (define-key map (kbd "M") 'ibuffer-filter-by-derived-mode)
+ (define-key map (kbd "n") 'ibuffer-filter-by-name)
+ (define-key map (kbd "E") 'ibuffer-filter-by-process)
+ (define-key map (kbd "*") 'ibuffer-filter-by-starred-name)
+ (define-key map (kbd "f") 'ibuffer-filter-by-filename)
+ (define-key map (kbd "b") 'ibuffer-filter-by-basename)
+ (define-key map (kbd ".") 'ibuffer-filter-by-file-extension)
+ (define-key map (kbd "<") 'ibuffer-filter-by-size-lt)
+ (define-key map (kbd ">") 'ibuffer-filter-by-size-gt)
+ (define-key map (kbd "i") 'ibuffer-filter-by-modified)
+ (define-key map (kbd "v") 'ibuffer-filter-by-visiting-file)
+ (define-key map (kbd "c") 'ibuffer-filter-by-content)
+ (define-key map (kbd "e") 'ibuffer-filter-by-predicate)
+
+ (define-key map (kbd "r") 'ibuffer-switch-to-saved-filters)
+ (define-key map (kbd "a") 'ibuffer-add-saved-filters)
+ (define-key map (kbd "x") 'ibuffer-delete-saved-filters)
+ (define-key map (kbd "d") 'ibuffer-decompose-filter)
+ (define-key map (kbd "s") 'ibuffer-save-filters)
+ (define-key map (kbd "p") 'ibuffer-pop-filter)
+ (define-key map (kbd "<up>") 'ibuffer-pop-filter)
+ (define-key map (kbd "!") 'ibuffer-negate-filter)
+ (define-key map (kbd "t") 'ibuffer-exchange-filters)
+ (define-key map (kbd "TAB") 'ibuffer-exchange-filters)
+ (define-key map (kbd "o") 'ibuffer-or-filter)
+ (define-key map (kbd "|") 'ibuffer-or-filter)
+ (define-key map (kbd "&") 'ibuffer-and-filter)
+ (define-key map (kbd "g") 'ibuffer-filters-to-filter-group)
+ (define-key map (kbd "P") 'ibuffer-pop-filter-group)
+ (define-key map (kbd "S-<up>") 'ibuffer-pop-filter-group)
+ (define-key map (kbd "D") 'ibuffer-decompose-filter-group)
+ (define-key map (kbd "/") 'ibuffer-filter-disable)
+
+ (define-key map (kbd "S") 'ibuffer-save-filter-groups)
+ (define-key map (kbd "R") 'ibuffer-switch-to-saved-filter-groups)
+ (define-key map (kbd "X") 'ibuffer-delete-saved-filter-groups)
+ (define-key map (kbd "\\") 'ibuffer-clear-filter-groups)
+ map))
+
(defvar ibuffer-mode-map
(let ((map (make-keymap)))
(define-key map (kbd "0") 'digit-argument)
@@ -484,41 +527,6 @@ directory, like `default-directory'."
(define-key map (kbd "s f") 'ibuffer-do-sort-by-filename/process)
(define-key map (kbd "s m") 'ibuffer-do-sort-by-major-mode)
- (define-key map (kbd "/ RET") 'ibuffer-filter-by-mode)
- (define-key map (kbd "/ m") 'ibuffer-filter-by-used-mode)
- (define-key map (kbd "/ M") 'ibuffer-filter-by-derived-mode)
- (define-key map (kbd "/ n") 'ibuffer-filter-by-name)
- (define-key map (kbd "/ E") 'ibuffer-filter-by-process)
- (define-key map (kbd "/ *") 'ibuffer-filter-by-starred-name)
- (define-key map (kbd "/ f") 'ibuffer-filter-by-filename)
- (define-key map (kbd "/ b") 'ibuffer-filter-by-basename)
- (define-key map (kbd "/ .") 'ibuffer-filter-by-file-extension)
- (define-key map (kbd "/ <") 'ibuffer-filter-by-size-lt)
- (define-key map (kbd "/ >") 'ibuffer-filter-by-size-gt)
- (define-key map (kbd "/ i") 'ibuffer-filter-by-modified)
- (define-key map (kbd "/ v") 'ibuffer-filter-by-visiting-file)
- (define-key map (kbd "/ c") 'ibuffer-filter-by-content)
- (define-key map (kbd "/ e") 'ibuffer-filter-by-predicate)
-
- (define-key map (kbd "/ r") 'ibuffer-switch-to-saved-filters)
- (define-key map (kbd "/ a") 'ibuffer-add-saved-filters)
- (define-key map (kbd "/ x") 'ibuffer-delete-saved-filters)
- (define-key map (kbd "/ d") 'ibuffer-decompose-filter)
- (define-key map (kbd "/ s") 'ibuffer-save-filters)
- (define-key map (kbd "/ p") 'ibuffer-pop-filter)
- (define-key map (kbd "/ <up>") 'ibuffer-pop-filter)
- (define-key map (kbd "/ !") 'ibuffer-negate-filter)
- (define-key map (kbd "/ t") 'ibuffer-exchange-filters)
- (define-key map (kbd "/ TAB") 'ibuffer-exchange-filters)
- (define-key map (kbd "/ o") 'ibuffer-or-filter)
- (define-key map (kbd "/ |") 'ibuffer-or-filter)
- (define-key map (kbd "/ &") 'ibuffer-and-filter)
- (define-key map (kbd "/ g") 'ibuffer-filters-to-filter-group)
- (define-key map (kbd "/ P") 'ibuffer-pop-filter-group)
- (define-key map (kbd "/ S-<up>") 'ibuffer-pop-filter-group)
- (define-key map (kbd "/ D") 'ibuffer-decompose-filter-group)
- (define-key map (kbd "/ /") 'ibuffer-filter-disable)
-
(define-key map (kbd "M-n") 'ibuffer-forward-filter-group)
(define-key map "\t" 'ibuffer-forward-filter-group)
(define-key map (kbd "M-p") 'ibuffer-backward-filter-group)
@@ -526,10 +534,6 @@ directory, like `default-directory'."
(define-key map (kbd "M-j") 'ibuffer-jump-to-filter-group)
(define-key map (kbd "C-k") 'ibuffer-kill-line)
(define-key map (kbd "C-y") 'ibuffer-yank)
- (define-key map (kbd "/ S") 'ibuffer-save-filter-groups)
- (define-key map (kbd "/ R") 'ibuffer-switch-to-saved-filter-groups)
- (define-key map (kbd "/ X") 'ibuffer-delete-saved-filter-groups)
- (define-key map (kbd "/ \\") 'ibuffer-clear-filter-groups)
(define-key map (kbd "% n") 'ibuffer-mark-by-name-regexp)
(define-key map (kbd "% m") 'ibuffer-mark-by-mode-regexp)
@@ -580,6 +584,8 @@ directory, like `default-directory'."
(define-key map (kbd "C-x 4 RET") 'ibuffer-visit-buffer-other-window)
(define-key map (kbd "C-x 5 RET") 'ibuffer-visit-buffer-other-frame)
+ (define-key map (kbd "/") ibuffer--filter-map)
+
(define-key map [menu-bar view]
(cons "View" (make-sparse-keymap "View")))