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

View File

@ -387,24 +387,26 @@ simply executes `fill-paragraph'."
'(left-curly-arrow right-curly-arrow)) '(left-curly-arrow right-curly-arrow))
(visual-line-mode t)) (visual-line-mode t))
(define-key-after (when (lookup-key message-mode-map [menu-bar text])
(lookup-key message-mode-map [menu-bar text]) (define-key-after
[mu4e-hard-newlines] (lookup-key message-mode-map [menu-bar text])
'(menu-item "Format=flowed" mu4e-toggle-use-hard-newlines [mu4e-hard-newlines]
:button (:toggle . use-hard-newlines) '(menu-item "Format=flowed" mu4e-toggle-use-hard-newlines
:help "Toggle format=flowed" :button (:toggle . use-hard-newlines)
:visible (eq major-mode 'mu4e-compose-mode) :help "Toggle format=flowed"
:enable mu4e-compose-format-flowed) :visible (eq major-mode 'mu4e-compose-mode)
'sep) :enable mu4e-compose-format-flowed)
'sep))
(define-key-after (when (lookup-key mml-mode-map [menu-bar Attachments])
(lookup-key mml-mode-map [menu-bar Attachments]) (define-key-after
[mu4e-compose-attach-captured-message] (lookup-key mml-mode-map [menu-bar Attachments])
'(menu-item "Attach captured message" [mu4e-compose-attach-captured-message]
mu4e-compose-attach-captured-message '(menu-item "Attach captured message"
:help "Attach message captured in Headers View (with 'a c')" mu4e-compose-attach-captured-message
:visible (eq major-mode 'mu4e-compose-mode)) :help "Attach message captured in Headers View (with 'a c')"
(quote Attach\ External...)) :visible (eq major-mode 'mu4e-compose-mode))
(quote Attach\ External...)))
;; setup the fcc-stuff, if needed ;; setup the fcc-stuff, if needed
(add-hook 'message-send-hook (add-hook 'message-send-hook