diff --git a/mu4e/mu4e-compose.el b/mu4e/mu4e-compose.el index ddc70f97..2958208a 100644 --- a/mu4e/mu4e-compose.el +++ b/mu4e/mu4e-compose.el @@ -387,24 +387,26 @@ 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) - :enable mu4e-compose-format-flowed) - 'sep) + (when (lookup-key message-mode-map [menu-bar text]) + (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) + :enable mu4e-compose-format-flowed) + 'sep)) - (define-key-after - (lookup-key mml-mode-map [menu-bar Attachments]) - [mu4e-compose-attach-captured-message] - '(menu-item "Attach captured message" - mu4e-compose-attach-captured-message - :help "Attach message captured in Headers View (with 'a c')" - :visible (eq major-mode 'mu4e-compose-mode)) - (quote Attach\ External...)) + (when (lookup-key mml-mode-map [menu-bar Attachments]) + (define-key-after + (lookup-key mml-mode-map [menu-bar Attachments]) + [mu4e-compose-attach-captured-message] + '(menu-item "Attach captured message" + mu4e-compose-attach-captured-message + :help "Attach message captured in Headers View (with 'a c')" + :visible (eq major-mode 'mu4e-compose-mode)) + (quote Attach\ External...))) ;; setup the fcc-stuff, if needed (add-hook 'message-send-hook