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

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

view-mode keymap


From: Daimrod
Subject: view-mode keymap
Date: Mon, 31 Dec 2012 16:04:38 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

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

-- 
Daimrod/Greg


reply via email to

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