help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need help with minor-mode-map/menu-map


From: Stefan Monnier
Subject: Re: Need help with minor-mode-map/menu-map
Date: Thu, 28 Mar 2013 10:31:39 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> |   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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]