From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thorsten Jolitz Newsgroups: gmane.emacs.help Subject: Need help with minor-mode-map/menu-map Date: Thu, 28 Mar 2013 11:10:58 +0100 Message-ID: <87a9png7gt.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1364465492 3002 80.91.229.3 (28 Mar 2013 10:11:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Mar 2013 10:11:32 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 28 11:11:59 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UL9oM-0003jM-D0 for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Mar 2013 11:11:58 +0100 Original-Received: from localhost ([::1]:58131 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UL9ny-0007V5-6E for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Mar 2013 06:11:34 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51608) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UL9nl-0007Uy-Rn for help-gnu-emacs@gnu.org; Thu, 28 Mar 2013 06:11:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UL9nk-0000yX-AG for help-gnu-emacs@gnu.org; Thu, 28 Mar 2013 06:11:21 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:41737) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UL9nk-0000yF-3h for help-gnu-emacs@gnu.org; Thu, 28 Mar 2013 06:11:20 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UL9o2-0002U7-Qi for help-gnu-emacs@gnu.org; Thu, 28 Mar 2013 11:11:38 +0100 Original-Received: from g231110001.adsl.alicedsl.de ([92.231.110.1]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 28 Mar 2013 11:11:38 +0100 Original-Received: from tjolitz by g231110001.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 28 Mar 2013 11:11:38 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 56 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: g231110001.adsl.alicedsl.de User-Agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.2 (gnu/linux) Cancel-Lock: sha1:IGjZt9h9C8Zn0kwKdgGGU+dVe84= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:89780 Archived-At: 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