From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: Need help with minor-mode-map/menu-map
Date: Thu, 28 Mar 2013 10:31:39 -0400 [thread overview]
Message-ID: <jwvr4iz8ups.fsf-monnier+gmane.emacs.help@gnu.org> (raw)
In-Reply-To: 87a9png7gt.fsf@gmail.com
> | 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
next prev parent reply other threads:[~2013-03-28 14:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-28 10:10 Need help with minor-mode-map/menu-map Thorsten Jolitz
2013-03-28 14:31 ` Stefan Monnier [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvr4iz8ups.fsf-monnier+gmane.emacs.help@gnu.org \
--to=monnier@iro.umontreal.ca \
--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.
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).