[Top][All Lists]

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

Re: Multiple keymaps for a minor mode

From: Tim Johnson
Subject: Re: Multiple keymaps for a minor mode
Date: Wed, 19 Feb 2020 14:26:38 -0900
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

On 1/23/20 11:49 AM, Stefan Monnier wrote:
(defvar tj-mode-map (make-sparse-keymap)
   "Keymap for `tj-mode'.")

(define-minor-mode tj-minor-mode
   "This minor mode enables my key settings to override conflicting modes."
   :init-value t
   :lighter " -tj-"
   :keymap tj-mode-map)
This last line can be removed if you rename `tj-mode-map` to 

(add-to-list 'emulation-mode-map-alists `((tj-minor-mode . ,tj-mode-map)))
This is redundant with the keymap setup of `define-minor-mode`, so you'd
be better off just not using the :keymap of `define-minor-mode`.

Can I use multiple :keymap entries, one for each keymap
No, `define-minor-mode` does not support that.

or must I define a minor mode for each of my custom keymaps?
Not a good idea either.
Thanks for the reply Stefa, however I do not completely understand your last comment which follows:
But you can simply your various keymaps to `emulation-mode-map-alists`
manually like you already do.

Could you elaborate?

Thank you


reply via email to

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