unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Need help with minor-mode-map/menu-map
@ 2013-03-28 10:10 Thorsten Jolitz
  2013-03-28 14:31 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Thorsten Jolitz @ 2013-03-28 10:10 UTC (permalink / raw)
  To: help-gnu-emacs


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





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-03-29 14:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-28 10:10 Need help with minor-mode-map/menu-map Thorsten Jolitz
2013-03-28 14:31 ` Stefan Monnier
2013-03-28 17:54   ` Thorsten Jolitz
2013-03-29 14:48     ` Stefan Monnier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).