Add the menu entry in the function defining the mode

This ensures that `(lookup-key message-mode-map [menu-bar text])'
returns a valid keymap.
This commit is contained in:
Christophe Troestler 2016-05-07 03:16:38 +02:00
parent 55a95db3f0
commit af523cd05a
1 changed files with 9 additions and 9 deletions

View File

@ -340,15 +340,6 @@ simply executes `fill-paragraph'."
(fill-paragraph nil region))
(fill-paragraph nil region)))
(define-key-after
(lookup-key text-mode-map [menu-bar text])
[mu4e-hard-newlines]
'(menu-item "Format=flowed" mu4e-toggle-use-hard-newlines
:button (:toggle . use-hard-newlines)
:help "Toggle format=flowed"
:visible (eq major-mode 'mu4e-compose-mode))
'sep)
(defun mu4e-toggle-use-hard-newlines ()
(interactive)
(setq use-hard-newlines (not use-hard-newlines))
@ -396,6 +387,15 @@ simply executes `fill-paragraph'."
'(left-curly-arrow right-curly-arrow))
(visual-line-mode t))
(define-key-after
(lookup-key message-mode-map [menu-bar text])
[mu4e-hard-newlines]
'(menu-item "Format=flowed" mu4e-toggle-use-hard-newlines
:button (:toggle . use-hard-newlines)
:help "Toggle format=flowed"
:visible (eq major-mode 'mu4e-compose-mode))
'sep)
;; setup the fcc-stuff, if needed
(add-hook 'message-send-hook
(lambda () ;; mu4e~compose-save-before-sending