From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Need help with minor-mode-map/menu-map Date: Thu, 28 Mar 2013 10:31:39 -0400 Message-ID: References: <87a9png7gt.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1364481151 32370 80.91.229.3 (28 Mar 2013 14:32:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Mar 2013 14:32:31 +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 15:32:58 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 1ULDsj-0001SI-KJ for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Mar 2013 15:32:45 +0100 Original-Received: from localhost ([::1]:36558 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULDsL-0002kG-Gv for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Mar 2013 10:32:21 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41716) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULDs2-0002jS-AG for help-gnu-emacs@gnu.org; Thu, 28 Mar 2013 10:32:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULDrt-0007Hx-JU for help-gnu-emacs@gnu.org; Thu, 28 Mar 2013 10:32:02 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:59033) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULDrt-0007HA-E4 for help-gnu-emacs@gnu.org; Thu, 28 Mar 2013 10:31:53 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ULDsF-0008N8-2B for help-gnu-emacs@gnu.org; Thu, 28 Mar 2013 15:32:15 +0100 Original-Received: from 69-196-180-174.dsl.teksavvy.com ([69.196.180.174]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 28 Mar 2013 15:32:15 +0100 Original-Received: from monnier by 69-196-180-174.dsl.teksavvy.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 28 Mar 2013 15:32:15 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 48 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 69-196-180-174.dsl.teksavvy.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:zbiuBdZQjK/9xKhFz1wu6rj3lqQ= 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:89784 Archived-At: > | nil " Outorg") I recommend you replace this line with :lighter " Outorg") > ,--------------------------------------------------------------------- > | (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"))) > `--------------------------------------------------------------------- Here, I recommend (defvar outorg-edit-menu-map (let ((map (make-sparse-keymap))) (define-key map [outorg-copy-edits-and-exit] '(menu-item "Copy and Exit" outorg-copy-edits-and-exit :help "Copy edits to original-buffer and exit outorg")) (define-key map [outorg-save-edits-to-tmp-file] '(menu-item "Save" outorg-save-edits-to-tmp-file :help "Save edit buffer to temporary file in the OS tmp directory")) map)) > ,--------------------------------------------------------- > | (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)) > `--------------------------------------------------------- And here, I'd recommend the same rewrite, plus the actual fix which is to be careful with the name: it should be outorg-edit-mode-map (i.e. the minor mode's name plus "-map"). Stefan