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

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

Need help with minor-mode-map/menu-map


From: Thorsten Jolitz
Subject: Need help with minor-mode-map/menu-map
Date: Thu, 28 Mar 2013 11:10:58 +0100
User-agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.2 (gnu/linux)

Hi List, 

I copied and adapted the following code from other libraries where
things (keybindings & menus) work, but something must have gone wrong,
neither the keybindings nor the menu works - and I just don't see where
the problem is. 
It should be really easy, since its about a minor-mode with only 2
commands, thus 2 keybindings and menu-entries. 

Maybe somebody could have a quick look at the code and give me a hint
where the problem might be? Thanks in advance!

(the library is here: https://github.com/tj64/outorg) 

minor-mode definition:

,-----------------------------------------------------------------
| (define-minor-mode outorg-edit-mode 
|    "Minor mode for Org-mode buffers generated by outorg.
| There is a mode hook, and two commands: 
| \\[outorg-copy-edits-and-exit] outorg-copy-edits-and-exit
| \\[outorg-save-edits-to-tmp-file] outorg-save-edits-to-tmp-file"
|   nil " Outorg")
`-----------------------------------------------------------------

menu-map definition:

,---------------------------------------------------------------------
| (defvar outorg-edit-menu-map (make-sparse-keymap))
| (define-key outorg-edit-menu-map [outorg-copy-edits-and-exit]
|   `(menu-item ,(purecopy "Copy and Exit") outorg-copy-edits-and-exit
|               :help ,(purecopy "Copy edits to original-buffer
|               and exit outorg")))
| (define-key outorg-edit-menu-map [outorg-save-edits-to-tmp-file]
|   `(menu-item ,(purecopy "Save") outorg-save-edits-to-tmp-file
|               :help ,(purecopy "Save edit buffer to temporary
|               file in the OS tmp directory")))
`---------------------------------------------------------------------

minor-mode-map definition:

,---------------------------------------------------------
| (defvar outorg-edit-minor-mode-map (make-sparse-keymap))
| (define-key outorg-edit-minor-mode-map "\M-#"
|   'outorg-copy-edits-and-exit)
| (define-key outorg-edit-minor-mode-map "\C-x\C-s"
|   'outorg-save-edits-to-tmp-file)
| (define-key outorg-edit-minor-mode-map [menu-bar]
|   (cons (purecopy "Outorg-Edit") outorg-edit-menu-map))
`---------------------------------------------------------

-- 
cheers,
Thorsten





reply via email to

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