Rebinded key becomes un-changeable

York Zhao gtdplatform at gmail.com
Thu Aug 11 21:28:34 CEST 2011


Sorry, (kbd "DEL") doesn't work, should be (kbd "<backspace>"). I thought
they were the same.


On Thu, Aug 11, 2011 at 3:19 PM, York Zhao <gtdplatform at gmail.com> wrote:
I finally got the <backspace> binded in ibuffer by "forcing" rebind like
this:

(eval-after-load 'ibuffer
  '(progn
     ;; use the standard ibuffer bindings as a base
     (set-keymap-parent
      (evil-get-auxiliary-keymap ibuffer-mode-map 'normal t)
      (assq-delete-all 'menu-bar (copy-keymap ibuffer-mode-map)))
     (evil-define-key 'normal ibuffer-mode-map "j" 'ibuffer-forward-line)
     (evil-define-key 'normal ibuffer-mode-map "k" 'ibuffer-backward-line)
     (evil-define-key 'normal ibuffer-mode-map "J" 'ibuffer-jump-to-buffer)
; "j"
     (evil-define-key 'normal ibuffer-mode-map (kbd "DEL")
'ibuffer-unmark-backward)))

But the question is: why wasn't this binding "overwritten" from the
"copy-keymap"?

Thanks,

York


On Thu, Aug 11, 2011 at 3:04 PM, York Zhao <gtdplatform at gmail.com> wrote:
Hi,

I have this code to inherite most of the ibuffer key bindings while still
keep the "j" and "k" bindings.

(eval-after-load 'ibuffer
  '(progn
     ;; use the standard ibuffer bindings as a base
     (set-keymap-parent
      (evil-get-auxiliary-keymap ibuffer-mode-map 'normal t)
      (assq-delete-all 'menu-bar (copy-keymap ibuffer-mode-map)))
     (evil-define-key 'normal ibuffer-mode-map "j" 'ibuffer-forward-line)
     (evil-define-key 'normal ibuffer-mode-map "k" 'ibuffer-backward-line)
     (evil-define-key 'normal ibuffer-mode-map "J" 'ibuffer-jump-to-buffer)
; "j"
     ))

This works fine however if I rebind the <backspace> before the previous code
like this:

(define-key evil-normal-state-map (kbd "<backspace>") 'scroll-down)

The <backspace> key would then "fixed" to my binding (scroll-down) instead
of the ibuffer binding. Is there any "better" way of rebinding evil keys?
Or, is it possible for Evil to handle this situation?

Thanks,

York
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ourproject.org/pipermail/implementations-list/attachments/20110811/e62918c6/attachment.htm 


More information about the implementations-list mailing list