all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: ivan <ivan.brennan@gmail.com>
Cc: 25797@debbugs.gnu.org
Subject: bug#25797: Subject: 25.2; enhancement-request: expose ibuffer filter keymap as a named prefix
Date: Fri, 26 Jul 2019 14:45:05 +0200	[thread overview]
Message-ID: <877e85m0by.fsf@mouse.gnus.org> (raw)
In-Reply-To: <CAOVAYzscBUj2Pzf42==jJWqhNJQ9YDm6=KNDRX4C9eQvi3CXBg@mail.gmail.com> (ivan's message of "Sun, 19 Feb 2017 14:16:22 -0500")

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





      reply	other threads:[~2019-07-26 12:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877e85m0by.fsf@mouse.gnus.org \
    --to=larsi@gnus.org \
    --cc=25797@debbugs.gnu.org \
    --cc=ivan.brennan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.