[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to define minor-mode keybindings conditional on buffer's major-mode?
From: |
Thorsten Jolitz |
Subject: |
How to define minor-mode keybindings conditional on buffer's major-mode? |
Date: |
Fri, 04 Oct 2013 16:02:02 +0200 |
User-agent: |
Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux) |
Hi List,
assume in a program in minor-mode is activated for a buffer that can
have one of two different major-mode, and different keybindings are
needed for each major-mode to avoid conflicts.
Here is a kind of "emacs lisp pseudocode" that shows the logic, but
can't work of course:
,----------------------------------------------------------
| (define-key minor-mode-map
| (if (eq major-mode 'xyz-mode) "<<key-binding1>>" "<<key-binding1>>" )
| 'minor-mode-command)
`----------------------------------------------------------
How can this be achieved?
--
cheers,
Thorsten
- How to define minor-mode keybindings conditional on buffer's major-mode?,
Thorsten Jolitz <=