mu4e: seems the keymaps might not be defined (workaround)

Users were seeing:
,----
| Debugger entered--Lisp error: (wrong-type-argument keymapp nil)
|   signal(wrong-type-argument (keymapp nil))
|   define-key-after(nil [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 (quote mu4e-compose-mode))
| :enable mu4e-compose-format-flowed) sep)
|   mu4e-compose-mode()
|   byte-code("..." [original-msg mu4e-compose-parent-message
| mu4e-compose-context-policy winconf includes att make-local-variable put
| permanent-local t mu4e~context-autoswitch run-hooks mu4e-compose-pre-hook
| current-window-configuration nil (mu4e-draft-open compose-type
| original-msg) ((quit (byte-code "..." [winconf set-window-configuration
| mu4e-message "Operation aborted" throw --cl-block-mu4e~compose-handler--
| nil] 3))) mu4e~draft-insert-mail-header-separator mml-attach-file plist-get
| :file-name :mime-type mu4e~compose-set-friendly-buffer-name
| set-buffer-modified-p (new forward) message-goto-to message-goto-body
| mu4e~compose-type mu4e~compose-hide-headers mu4e-compose-mode delete-frame
| --dolist-tail-- compose-type mu4e-compose-in-new-frame message-exit-actions
| message-postpone-actions] 6)
|   mu4e~compose-handler(new)
|   mu4e-compose(new)
|   mu4e-compose-new()
`----
This commit is contained in:
djcb 2016-07-03 23:29:05 +03:00
parent 6a42000997
commit b31ba3dd81
1 changed files with 19 additions and 17 deletions

View File

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