help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: view-mode keymap


From: Daimrod
Subject: Re: view-mode keymap
Date: Wed, 02 Jan 2013 15:22:25 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Jambunathan K <kjambunathan@gmail.com> writes:

> 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))))))

I've looked at it but I don't see how it can help. I don't want to
create a new keymap, I want `view-mode-map' to take priority over other
keymaps.

I've looked at the documentation and it seems that changing the order in
`minor-mode-map-alist' is the only way to manage priorities between
keymap, because they shouldn't conflict in there first place.

-- 
Daimrod/Greg


reply via email to

[Prev in Thread] Current Thread [Next in Thread]