all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thorsten Jolitz <tjolitz@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Need help with minor-mode-map/menu-map
Date: Thu, 28 Mar 2013 11:10:58 +0100	[thread overview]
Message-ID: <87a9png7gt.fsf@gmail.com> (raw)


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	other threads:[~2013-03-28 10:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-28 10:10 Thorsten Jolitz [this message]
2013-03-28 14:31 ` Need help with minor-mode-map/menu-map Stefan Monnier
2013-03-28 17:54   ` Thorsten Jolitz
2013-03-29 14:48     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a9png7gt.fsf@gmail.com \
    --to=tjolitz@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.