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

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

Re: How to define minor-mode keybindings conditional on buffer's major-m


From: Thorsten Jolitz
Subject: Re: How to define minor-mode keybindings conditional on buffer's major-mode?
Date: Fri, 04 Oct 2013 16:13:28 +0200
User-agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux)

Thorsten Jolitz <address@hidden> writes:

ok, sometimes spellchecking would not hurt: this should be more readable
than the first version:

"assume in a program a 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-binding2>>" )
|     'minor-mode-command)
`----------------------------------------------------------

How can this be achieved?"

-- 
cheers,
Thorsten




reply via email to

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