* bug#25797: Subject: 25.2; enhancement-request: expose ibuffer filter keymap as a named prefix
@ 2017-02-19 19:16 ivan
2019-07-26 12:45 ` Lars Ingebrigtsen
0 siblings, 1 reply; 2+ messages in thread
From: ivan @ 2017-02-19 19:16 UTC (permalink / raw)
To: 25797
ibuffer uses "/" as a prefix key for filter commands, like
ibuffer-filter-by-name ("/ n").
As an evil user, I wanted to use a different prefix, since evil uses
"/" for searching.
I use "SPC" as a leader-key, so I decided to put the filter commands
behind "SPC /".
The ibuffer "/" prefix is an anonymous keymap, so I had to bind my new
key to the result of a lookup-key call:
(bind-map-for-mode-inherit ivan/ibuffer-leader-map ivan/leader-map
:major-modes (ibuffer-mode)
:bindings
("/" (lookup-key ibuffer-mode-map "/"))) ; <= here
This works, but it would be nice if ibuffer's "/" prefix was bound to
a named keymap, so the above line could instead be something like:
("/" ibuffer-filter-map)
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#25797: Subject: 25.2; enhancement-request: expose ibuffer filter keymap as a named prefix
2017-02-19 19:16 bug#25797: Subject: 25.2; enhancement-request: expose ibuffer filter keymap as a named prefix ivan
@ 2019-07-26 12:45 ` Lars Ingebrigtsen
0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2019-07-26 12:45 UTC (permalink / raw)
To: ivan; +Cc: 25797
ivan <ivan.brennan@gmail.com> writes:
> ibuffer uses "/" as a prefix key for filter commands, like
> ibuffer-filter-by-name ("/ n").
>
> As an evil user, I wanted to use a different prefix, since evil uses
> "/" for searching.
>
> I use "SPC" as a leader-key, so I decided to put the filter commands
> behind "SPC /".
>
> The ibuffer "/" prefix is an anonymous keymap, so I had to bind my new
> key to the result of a lookup-key call:
>
> (bind-map-for-mode-inherit ivan/ibuffer-leader-map ivan/leader-map
> :major-modes (ibuffer-mode)
> :bindings
> ("/" (lookup-key ibuffer-mode-map "/"))) ; <= here
>
> This works, but it would be nice if ibuffer's "/" prefix was bound to
> a named keymap, so the above line could instead be something like:
>
> ("/" ibuffer-filter-map)
Sounds reasonable. I've now done this on the Emacs trunk.
(I kept the slightly eccentric way of specifying keys, though:
(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)
Most of these are redundant, but I guess it's a stylistic choice, so I
kept it.)
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-26 12:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-19 19:16 bug#25797: Subject: 25.2; enhancement-request: expose ibuffer filter keymap as a named prefix ivan
2019-07-26 12:45 ` Lars Ingebrigtsen
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.