mu4e: add some support for the mux backend

This commit is contained in:
djcb 2018-02-11 11:44:31 +02:00
parent 0fe234c3ba
commit aef46ec14f
2 changed files with 38 additions and 36 deletions

View File

@ -125,8 +125,9 @@ clicked."
" "
(propertize
(concat
(when (plist-get mu4e~server-props :crypto) "C")
(when (plist-get mu4e~server-props :guile) "G"))
(when (plist-get mu4e~server-props :crypto) "C")
(when (plist-get mu4e~server-props :guile) "G")
(when (plist-get mu4e~server-props :mux) "X"))
'face 'mu4e-title-face)
"\n\n"
@ -199,8 +200,8 @@ clicked."
"Create the mu4e main-view, and switch to it."
(if (eq mu4e-split-view 'single-window)
(if (buffer-live-p (mu4e-get-headers-buffer))
(switch-to-buffer (mu4e-get-headers-buffer))
(mu4e~main-menu))
(switch-to-buffer (mu4e-get-headers-buffer))
(mu4e~main-menu))
(mu4e~main-view-real nil nil)
(switch-to-buffer mu4e~main-buffer-name)
(goto-char (point-min)))
@ -217,7 +218,7 @@ clicked."
(mu4e-error "`smtpmail-queue-dir' does not exist"))
(setq smtpmail-queue-mail (not smtpmail-queue-mail))
(message (concat "Outgoing mail will now be "
(if smtpmail-queue-mail "queued" "sent directly")))
(if smtpmail-queue-mail "queued" "sent directly")))
(unless (eq mu4e-split-view 'single-window)
(let ((curpos (point)))
(mu4e~main-view-real nil nil)
@ -227,30 +228,30 @@ clicked."
"mu4e main view in the minibuffer."
(interactive)
(let ((key
(read-key
(mu4e-format
"%s"
(concat
(mu4e~main-action-str "[j]ump " 'mu4e-jump-to-maildir)
(mu4e~main-action-str "[s]earch " 'mu4e-search)
(mu4e~main-action-str "[C]ompose " 'mu4e-compose-new)
(mu4e~main-action-str "[b]ookmarks " 'mu4e-headers-search-bookmark)
(mu4e~main-action-str "[;]Switch context " 'mu4e-context-switch)
(mu4e~main-action-str "[U]pdate " 'mu4e-update-mail-and-index)
(mu4e~main-action-str "[N]ews " 'mu4e-news)
(mu4e~main-action-str "[A]bout " 'mu4e-about)
(mu4e~main-action-str "[H]elp " 'mu4e-display-manual))))))
(read-key
(mu4e-format
"%s"
(concat
(mu4e~main-action-str "[j]ump " 'mu4e-jump-to-maildir)
(mu4e~main-action-str "[s]earch " 'mu4e-search)
(mu4e~main-action-str "[C]ompose " 'mu4e-compose-new)
(mu4e~main-action-str "[b]ookmarks " 'mu4e-headers-search-bookmark)
(mu4e~main-action-str "[;]Switch context " 'mu4e-context-switch)
(mu4e~main-action-str "[U]pdate " 'mu4e-update-mail-and-index)
(mu4e~main-action-str "[N]ews " 'mu4e-news)
(mu4e~main-action-str "[A]bout " 'mu4e-about)
(mu4e~main-action-str "[H]elp " 'mu4e-display-manual))))))
(unless (member key '(?\C-g ?\C-\[))
(let ((mu4e-command (lookup-key mu4e-main-mode-map (string key) t)))
(if mu4e-command
(condition-case err
(let ((mu4e-hide-index-messages t))
(call-interactively mu4e-command))
(error (when (cadr err) (message (cadr err)))))
(message (mu4e-format "key %s not bound to a command" (string key))))
(when (or (not mu4e-command) (eq mu4e-command 'mu4e-context-switch))
(sit-for 1)
(mu4e~main-menu))))))
(if mu4e-command
(condition-case err
(let ((mu4e-hide-index-messages t))
(call-interactively mu4e-command))
(error (when (cadr err) (message (cadr err)))))
(message (mu4e-format "key %s not bound to a command" (string key))))
(when (or (not mu4e-command) (eq mu4e-command 'mu4e-context-switch))
(sit-for 1)
(mu4e~main-menu))))))
;; (progn
;; (define-key mu4e-compose-mode-map (kbd "C-c m") 'mu4e~main-toggle-mail-sending-mode)

View File

@ -800,8 +800,9 @@ This is used by the completion function in mu4e-compose."
(unless (>= emacs-major-version 23)
(mu4e-error "Emacs >= 23.x is required for mu4e"))
(when mu4e~server-props
(let ((version (plist-get mu4e~server-props :version)))
(unless (string= version mu4e-mu-version)
(let ((version (plist-get mu4e~server-props :version))
(mux (plist-get mu4e~server-props :mux)))
(unless (or (string= version mu4e-mu-version) mux)
(mu4e-error "mu server has version %s, but we need %s"
version mu4e-mu-version))))
(unless (and mu4e-mu-binary (file-executable-p mu4e-mu-binary))
@ -1002,7 +1003,7 @@ frame to display buffer BUF."
(unless mu4e-hide-index-messages
(message nil))
(if (or (not (eq (process-status proc) 'exit))
(/= (process-exit-status proc) 0))
(/= (process-exit-status proc) 0))
(progn
(when mu4e-index-update-error-warning
(mu4e-message "Update process returned with non-zero exit code")
@ -1218,12 +1219,12 @@ displaying it). Do _not_ bury the current buffer, though."
;; note: 'walk-windows' does not seem to work correctly when modifying
;; windows; therefore, the doloops here
(dolist (frame (frame-list))
(dolist (win (window-list frame nil))
(with-current-buffer (window-buffer win)
(unless (eq curbuf (current-buffer))
(when (member major-mode '(mu4e-headers-mode mu4e-view-mode))
(when (eq t (window-deletable-p win))
(delete-window win))))))) t)))
(dolist (win (window-list frame nil))
(with-current-buffer (window-buffer win)
(unless (eq curbuf (current-buffer))
(when (member major-mode '(mu4e-headers-mode mu4e-view-mode))
(when (eq t (window-deletable-p win))
(delete-window win))))))) t)))
(defun mu4e-get-time-date (prompt)