[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: view-mode keymap
From: |
Jambunathan K |
Subject: |
Re: view-mode keymap |
Date: |
Mon, 31 Dec 2012 21:45:57 +0530 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
I think, `make-composed-keymap' can help here.
> I like `view-mode' but it conflicts with others minor mode map (paredit
> in my case).
>
> I would like to know if there is a better way to make a keymap that
> takes precedence over the others than manipulating
> `minor-mode-map-alist'.
>
> Here is my current implementation:
>
> (add-hook 'view-mode-hook
> (lambda ()
> ;; Makes sure `view-mode-map' is the first minor mode map
> ;; available in `minor-mode-map-alist', because in case of
> ;; conflicting bindings, the first one is used.
> (unless (eq 'view-mode (caar minor-mode-map-alist))
> (setf minor-mode-map-alist
> (cons (cons 'view-mode view-mode-map)
> (cl-remove 'view-mode minor-mode-map-alist
> :key #'car))))))
--