2014-10-11 15:06:10 +02:00
|
|
|
|
;;; org-mu4e -- Support for links to mu4e messages/queries from within
|
|
|
|
|
;;; org-mode, and for writing message in org-mode, sending them as
|
|
|
|
|
;;; rich-text
|
2012-01-06 11:31:28 +01:00
|
|
|
|
;;
|
2019-05-26 17:50:14 +02:00
|
|
|
|
;; Copyright (C) 2012-2019 Dirk-Jan C. Binnema
|
2012-01-06 11:31:28 +01:00
|
|
|
|
|
|
|
|
|
;; Author: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
|
|
|
|
;; Maintainer: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
|
|
|
|
;; Keywords: outlines, hypermedia, calendar, mail
|
|
|
|
|
;; Version: 0.0
|
|
|
|
|
|
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
|
;;
|
|
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
2014-12-11 07:57:54 +01:00
|
|
|
|
;; the Free Software Foundation, either version 3 of 1the License, or
|
2012-01-06 11:31:28 +01:00
|
|
|
|
;; (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
|
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
2014-10-11 15:06:10 +02:00
|
|
|
|
;; The expect version here is org 8.x
|
2018-08-18 07:57:18 +02:00
|
|
|
|
(require 'org)
|
2012-01-06 11:31:28 +01:00
|
|
|
|
|
2019-05-26 17:50:14 +02:00
|
|
|
|
(declare-function mu4e-last-query "mu4e-headers")
|
|
|
|
|
(declare-function mu4e-message-at-point "mu4e-message")
|
|
|
|
|
(declare-function mu4e-view-message-with-message-id "mu4e-view")
|
|
|
|
|
(declare-function mu4e-headers-search "mu4e-headers")
|
|
|
|
|
(declare-function mu4e-error "mu4e-utils")
|
|
|
|
|
(declare-function mu4e-message "mu4e-message")
|
|
|
|
|
(declare-function mu4e-compose-mode "mu4e-compose")
|
|
|
|
|
|
|
|
|
|
|
2012-07-26 16:12:56 +02:00
|
|
|
|
(defgroup org-mu4e nil
|
2012-08-01 19:52:53 +02:00
|
|
|
|
"Settings for the org-mode related functionality in mu4e."
|
2012-11-14 12:25:35 +01:00
|
|
|
|
:group 'mu4e
|
2014-12-11 07:57:54 +01:00
|
|
|
|
:group 'org)
|
|
|
|
|
|
2015-12-19 12:58:21 +01:00
|
|
|
|
(defvar org-mu4e-link-query-in-headers-mode nil
|
2019-05-26 17:50:14 +02:00
|
|
|
|
"Prefer linking to the query rather than to the message.
|
|
|
|
|
If non-nil, `org-store-link' in `mu4e-headers-mode' links to the
|
2014-12-11 07:57:54 +01:00
|
|
|
|
the current query; otherwise, it links to the message at point.")
|
2012-07-26 16:12:56 +02:00
|
|
|
|
|
2012-08-01 19:52:53 +02:00
|
|
|
|
(defcustom org-mu4e-link-desc-func
|
|
|
|
|
(lambda (msg) (or (plist-get msg :subject) "No subject"))
|
2019-05-26 17:50:14 +02:00
|
|
|
|
"Function that takes a msg and returns a description.
|
|
|
|
|
This can be use in org capture templates.
|
2012-07-31 14:47:13 +02:00
|
|
|
|
|
2012-11-10 14:01:17 +01:00
|
|
|
|
Example usage:
|
2012-07-31 14:47:13 +02:00
|
|
|
|
|
2012-11-10 14:01:17 +01:00
|
|
|
|
(defun my-link-descr (msg)
|
|
|
|
|
(let ((subject (or (plist-get msg :subject)
|
|
|
|
|
\"No subject\"))
|
2012-07-31 14:47:13 +02:00
|
|
|
|
(date (or (format-time-string mu4e-headers-date-format
|
2012-11-10 14:01:17 +01:00
|
|
|
|
(mu4e-msg-field msg :date))
|
|
|
|
|
\"No date\")))
|
|
|
|
|
(concat subject \" \" date)))
|
2012-07-31 14:47:13 +02:00
|
|
|
|
|
|
|
|
|
(setq org-mu4e-link-desc-func 'my-link-descr)"
|
|
|
|
|
:type 'function
|
|
|
|
|
:group 'org-mu4e)
|
2012-07-26 16:12:56 +02:00
|
|
|
|
|
2019-02-18 06:22:16 +01:00
|
|
|
|
(defun org~mu4e-store-link-query ()
|
|
|
|
|
"Store a link to a mu4e query."
|
2019-05-26 17:50:14 +02:00
|
|
|
|
(let* ((query (mu4e-last-query))
|
|
|
|
|
(date (format-time-string (org-time-stamp-format)))
|
|
|
|
|
;; seems we get an error when there's no date...
|
|
|
|
|
(link (concat "mu4e:query:" query)))
|
|
|
|
|
(org-store-link-props
|
|
|
|
|
:type "mu4e"
|
|
|
|
|
:query query
|
|
|
|
|
:date date)
|
|
|
|
|
(org-add-link-props
|
|
|
|
|
:link link
|
|
|
|
|
:description (format "mu4e-query: '%s'" query))
|
2019-02-18 06:22:16 +01:00
|
|
|
|
link))
|
|
|
|
|
|
2019-05-26 17:50:14 +02:00
|
|
|
|
(defun org~mu4e-first-address (msg field)
|
|
|
|
|
"Get address field FIELD from MSG as a string or nil."
|
|
|
|
|
(let* ((val (plist-get msg field))
|
|
|
|
|
(name (when val (car (car val))))
|
|
|
|
|
(addr (when val (cdr (car val)))))
|
|
|
|
|
(when val
|
|
|
|
|
(if name
|
|
|
|
|
(format "%s <%s>" name addr)
|
|
|
|
|
(format "%s" addr)))))
|
|
|
|
|
|
2019-02-18 06:22:16 +01:00
|
|
|
|
(defun org~mu4e-store-link-message ()
|
|
|
|
|
"Store a link to a mu4e message."
|
2019-05-26 17:50:14 +02:00
|
|
|
|
(let* ((msg (mu4e-message-at-point))
|
2019-02-18 06:22:16 +01:00
|
|
|
|
(msgid (or (plist-get msg :message-id) "<none>"))
|
2019-05-26 17:50:14 +02:00
|
|
|
|
(date (plist-get msg :date))
|
|
|
|
|
(date (format-time-string (org-time-stamp-format) date))
|
|
|
|
|
;; seems we get an error when there's no date...
|
|
|
|
|
(link (concat "mu4e:msgid:" msgid)))
|
|
|
|
|
(org-store-link-props
|
|
|
|
|
:type "mu4e"
|
|
|
|
|
:message-id msgid
|
|
|
|
|
:to (org~mu4e-first-address msg :to)
|
|
|
|
|
:from (org~mu4e-first-address msg :from)
|
|
|
|
|
:date date
|
|
|
|
|
:subject (plist-get msg :subject))
|
|
|
|
|
(org-add-link-props
|
|
|
|
|
:link link
|
2019-02-18 06:22:16 +01:00
|
|
|
|
:description (funcall org-mu4e-link-desc-func msg))
|
|
|
|
|
link))
|
|
|
|
|
|
2012-01-06 11:31:28 +01:00
|
|
|
|
(defun org-mu4e-store-link ()
|
2019-02-18 06:22:16 +01:00
|
|
|
|
"Store a link to a mu4e message or query.
|
|
|
|
|
It links to the last known query when in `mu4e-headers-mode' with
|
|
|
|
|
`org-mu4e-link-query-in-headers-mode' set; otherwise it links to
|
|
|
|
|
a specific message, based on its message-id, so that links stay
|
|
|
|
|
valid even after moving the message around."
|
|
|
|
|
(if (and (eq major-mode 'mu4e-headers-mode)
|
2019-05-26 17:50:14 +02:00
|
|
|
|
org-mu4e-link-query-in-headers-mode)
|
2019-02-18 06:22:16 +01:00
|
|
|
|
(org~mu4e-store-link-query)
|
2019-02-21 16:21:56 +01:00
|
|
|
|
(when (mu4e-message-at-point t)
|
|
|
|
|
(org~mu4e-store-link-message))))
|
2012-01-06 11:31:28 +01:00
|
|
|
|
|
2016-09-04 14:12:53 +02:00
|
|
|
|
;; org-add-link-type is obsolete as of org-mode 9.
|
|
|
|
|
;; Instead we will use the org-link-set-parameters method
|
|
|
|
|
(if (fboundp 'org-link-set-parameters)
|
|
|
|
|
(org-link-set-parameters "mu4e"
|
2019-05-26 17:50:14 +02:00
|
|
|
|
:follow #'org-mu4e-open
|
|
|
|
|
:store #'org-mu4e-store-link)
|
2016-09-13 15:07:27 +02:00
|
|
|
|
(org-add-link-type "mu4e" 'org-mu4e-open)
|
|
|
|
|
(add-hook 'org-store-link-functions 'org-mu4e-store-link))
|
2016-09-04 14:12:53 +02:00
|
|
|
|
|
2019-05-26 17:50:14 +02:00
|
|
|
|
(defun org-mu4e-open (link)
|
|
|
|
|
"Open the org LINK.
|
|
|
|
|
Open the mu4e message (for links starting with 'msgid:') or run
|
|
|
|
|
the query (for links starting with 'query:')."
|
2018-07-13 14:06:49 +02:00
|
|
|
|
(require 'mu4e)
|
2012-01-06 11:31:28 +01:00
|
|
|
|
(cond
|
2019-05-26 17:50:14 +02:00
|
|
|
|
((string-match "^msgid:\\(.+\\)" link)
|
|
|
|
|
(mu4e-view-message-with-message-id (match-string 1 link)))
|
|
|
|
|
((string-match "^query:\\(.+\\)" link)
|
|
|
|
|
(mu4e-headers-search (match-string 1 link) current-prefix-arg))
|
|
|
|
|
(t (mu4e-error "Unrecognized link type '%s'" link))))
|
2012-01-06 11:31:28 +01:00
|
|
|
|
|
2015-12-21 21:21:22 +01:00
|
|
|
|
(defun org-mu4e-store-and-capture ()
|
2019-05-26 17:50:14 +02:00
|
|
|
|
"Store a link to the current message or query.
|
|
|
|
|
\(depending on `org-mu4e-link-query-in-headers-mode', and capture
|
|
|
|
|
it with org)."
|
2015-12-21 21:21:22 +01:00
|
|
|
|
(interactive)
|
2018-09-21 05:55:58 +02:00
|
|
|
|
(call-interactively 'org-store-link)
|
2015-12-21 21:21:22 +01:00
|
|
|
|
(org-capture))
|
2012-05-23 16:04:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; editing with org-mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
|
|
;; below, some functions for the org->html conversion
|
|
|
|
|
;; based on / inspired by Eric Schulte's org-mime.el
|
|
|
|
|
;; Homepage: http://orgmode.org/worg/org-contrib/org-mime.php
|
2012-08-01 19:52:53 +02:00
|
|
|
|
;;
|
|
|
|
|
;; EXPERIMENTAL
|
2012-05-23 16:04:26 +02:00
|
|
|
|
(defun org~mu4e-mime-file (ext path id)
|
2019-05-26 17:50:14 +02:00
|
|
|
|
"Create a file of type EXT at PATH with ID for an attachment."
|
2012-05-23 16:04:26 +02:00
|
|
|
|
(format (concat "<#part type=\"%s\" filename=\"%s\" "
|
2019-05-26 17:50:14 +02:00
|
|
|
|
"disposition=inline id=\"<%s>\">\n<#/part>\n")
|
2012-05-23 16:04:26 +02:00
|
|
|
|
ext path id))
|
2012-05-25 15:51:23 +02:00
|
|
|
|
|
2012-05-23 16:04:26 +02:00
|
|
|
|
(defun org~mu4e-mime-multipart (plain html &optional images)
|
2019-05-26 17:50:14 +02:00
|
|
|
|
"Create a multipart/alternative with PLAIN and HTML alternatives.
|
|
|
|
|
If the html portion of the message includes IMAGES, wrap the html
|
2012-05-23 16:04:26 +02:00
|
|
|
|
and images in a multipart/related part."
|
|
|
|
|
(concat "<#multipart type=alternative><#part type=text/plain>"
|
|
|
|
|
plain
|
|
|
|
|
(when images "<#multipart type=related>")
|
|
|
|
|
"<#part type=text/html>"
|
|
|
|
|
html
|
|
|
|
|
images
|
|
|
|
|
(when images "<#/multipart>\n")
|
|
|
|
|
"<#/multipart>\n"))
|
2012-05-25 15:51:23 +02:00
|
|
|
|
|
2012-05-23 16:04:26 +02:00
|
|
|
|
(defun org~mu4e-mime-replace-images (str current-file)
|
2019-05-26 17:50:14 +02:00
|
|
|
|
"Replace images in html files STR in CURRENT-FILE with cid links."
|
2012-05-23 16:04:26 +02:00
|
|
|
|
(let (html-images)
|
|
|
|
|
(cons
|
|
|
|
|
(replace-regexp-in-string ;; replace images in html
|
|
|
|
|
"src=\"\\([^\"]+\\)\""
|
|
|
|
|
(lambda (text)
|
|
|
|
|
(format
|
|
|
|
|
"src=\"cid:%s\""
|
|
|
|
|
(let* ((url (and (string-match "src=\"\\([^\"]+\\)\"" text)
|
|
|
|
|
(match-string 1 text)))
|
|
|
|
|
(path (expand-file-name
|
|
|
|
|
url (file-name-directory current-file)))
|
|
|
|
|
(ext (file-name-extension path))
|
|
|
|
|
(id (replace-regexp-in-string "[\/\\\\]" "_" path)))
|
|
|
|
|
(add-to-list 'html-images
|
|
|
|
|
(org~mu4e-mime-file
|
2019-05-26 17:50:14 +02:00
|
|
|
|
(concat "image/" ext) path id))
|
2012-05-23 16:04:26 +02:00
|
|
|
|
id)))
|
|
|
|
|
str)
|
|
|
|
|
html-images)))
|
|
|
|
|
|
|
|
|
|
(defun org~mu4e-mime-convert-to-html ()
|
|
|
|
|
"Convert the current body to html."
|
2014-10-03 03:40:33 +02:00
|
|
|
|
(unless (fboundp 'org-export-string-as)
|
2019-05-26 17:50:14 +02:00
|
|
|
|
(mu4e-error "Required function 'org-export-string-as not found"))
|
2012-09-24 16:05:14 +02:00
|
|
|
|
(let* ((begin
|
2019-05-26 17:50:14 +02:00
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(search-forward mail-header-separator)))
|
|
|
|
|
(end (point-max))
|
|
|
|
|
(raw-body (buffer-substring begin end))
|
|
|
|
|
(tmp-file (make-temp-name (expand-file-name "mail"
|
|
|
|
|
temporary-file-directory)))
|
|
|
|
|
;; because we probably don't want to skip part of our mail
|
|
|
|
|
(org-export-skip-text-before-1st-heading nil)
|
|
|
|
|
;; because we probably don't want to export a huge style file
|
|
|
|
|
(org-export-htmlize-output-type 'inline-css)
|
|
|
|
|
;; makes the replies with ">"s look nicer
|
|
|
|
|
(org-export-preserve-breaks t)
|
|
|
|
|
;; dvipng for inline latex because MathJax doesn't work in mail
|
|
|
|
|
(org-export-with-LaTeX-fragments
|
|
|
|
|
(if (executable-find "dvipng") 'dvipng
|
|
|
|
|
(mu4e-message "Cannot find dvipng, ignore inline LaTeX") nil))
|
|
|
|
|
;; to hold attachments for inline html images
|
|
|
|
|
(html-and-images
|
|
|
|
|
(org~mu4e-mime-replace-images
|
2014-10-03 03:40:33 +02:00
|
|
|
|
(org-export-string-as raw-body 'html t)
|
2019-05-26 17:50:14 +02:00
|
|
|
|
tmp-file))
|
|
|
|
|
(html-images (cdr html-and-images))
|
|
|
|
|
(html (car html-and-images)))
|
2012-08-11 11:22:36 +02:00
|
|
|
|
(delete-region begin end)
|
|
|
|
|
(save-excursion
|
2019-05-26 17:50:14 +02:00
|
|
|
|
(goto-char begin)
|
|
|
|
|
(newline)
|
|
|
|
|
(insert (org~mu4e-mime-multipart
|
|
|
|
|
raw-body html (mapconcat 'identity html-images "\n"))))))
|
2012-05-23 16:04:26 +02:00
|
|
|
|
|
|
|
|
|
;; next some functions to make the org/mu4e-compose-mode switch as smooth as
|
|
|
|
|
;; possible.
|
2012-05-25 15:51:23 +02:00
|
|
|
|
(defun org~mu4e-mime-decorate-headers ()
|
|
|
|
|
"Make the headers visually distinctive (org-mode)."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(let* ((eoh (when (search-forward mail-header-separator)
|
2019-05-26 17:50:14 +02:00
|
|
|
|
(match-end 0)))
|
|
|
|
|
(olay (make-overlay (point-min) eoh)))
|
2012-05-25 15:51:23 +02:00
|
|
|
|
(when olay
|
2019-05-26 17:50:14 +02:00
|
|
|
|
(overlay-put olay 'face 'font-lock-comment-face)))))
|
2012-05-23 16:04:26 +02:00
|
|
|
|
|
2012-05-25 15:51:23 +02:00
|
|
|
|
(defun org~mu4e-mime-undecorate-headers ()
|
2012-11-10 14:01:17 +01:00
|
|
|
|
"Don't make the headers visually distinctive.
|
|
|
|
|
\(well, mu4e-compose-mode will take care of that)."
|
2012-05-23 16:04:26 +02:00
|
|
|
|
(save-excursion
|
2012-05-25 15:51:23 +02:00
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(let* ((eoh (when (search-forward mail-header-separator)
|
2019-05-26 17:50:14 +02:00
|
|
|
|
(match-end 0))))
|
2012-05-25 15:51:23 +02:00
|
|
|
|
(remove-overlays (point-min) eoh))))
|
|
|
|
|
|
|
|
|
|
(defvar org-mu4e-convert-to-html nil
|
2019-02-18 06:22:16 +01:00
|
|
|
|
"Whether to do automatic `org-mode' => html conversion when sending messages.")
|
2012-05-23 16:04:26 +02:00
|
|
|
|
|
|
|
|
|
(defun org~mu4e-mime-convert-to-html-maybe ()
|
2012-11-10 14:01:17 +01:00
|
|
|
|
"Convert to html if `org-mu4e-convert-to-html' is non-nil.
|
|
|
|
|
This function is called when sending a message (from
|
2019-02-18 06:22:16 +01:00
|
|
|
|
`message-send-hook') and, if non-nil, sends the message as the
|
|
|
|
|
rich-text version of what is assumed to be an org mode body."
|
2012-05-23 16:04:26 +02:00
|
|
|
|
(when org-mu4e-convert-to-html
|
2012-09-24 16:05:14 +02:00
|
|
|
|
(mu4e-message "Converting to html")
|
2012-05-23 16:04:26 +02:00
|
|
|
|
(org~mu4e-mime-convert-to-html)))
|
2018-08-18 07:57:18 +02:00
|
|
|
|
|
2012-05-25 15:51:23 +02:00
|
|
|
|
(defun org~mu4e-mime-switch-headers-or-body ()
|
2012-05-23 16:04:26 +02:00
|
|
|
|
"Switch the buffer to either mu4e-compose-mode (when in headers)
|
2012-08-01 19:52:53 +02:00
|
|
|
|
or org-mode (when in the body)."
|
2012-05-23 16:04:26 +02:00
|
|
|
|
(interactive)
|
|
|
|
|
(let* ((sepapoint
|
2019-05-26 17:50:14 +02:00
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(search-forward-regexp mail-header-separator nil t))))
|
2012-05-25 15:51:23 +02:00
|
|
|
|
;; only do stuff when the sepapoint exist; note that after sending the
|
|
|
|
|
;; message, this function maybe called on a message with the sepapoint
|
2012-06-04 12:30:17 +02:00
|
|
|
|
;; stripped. This is why we don't use `message-point-in-header'.
|
2012-05-25 15:51:23 +02:00
|
|
|
|
(when sepapoint
|
|
|
|
|
(cond
|
2019-05-26 17:50:14 +02:00
|
|
|
|
;; we're in the body, but in mu4e-compose-mode?
|
|
|
|
|
;; if so, switch to org-mode
|
|
|
|
|
((and (> (point) sepapoint) (eq major-mode 'mu4e-compose-mode))
|
|
|
|
|
(org-mode)
|
|
|
|
|
(add-hook 'before-save-hook
|
|
|
|
|
(lambda ()
|
|
|
|
|
(mu4e-error "Switch to mu4e-compose-mode (M-m) before saving"))
|
|
|
|
|
nil t)
|
|
|
|
|
(org~mu4e-mime-decorate-headers)
|
|
|
|
|
(local-set-key (kbd "M-m")
|
|
|
|
|
(lambda (keyseq)
|
|
|
|
|
(interactive "kEnter mu4e-compose-mode key sequence: ")
|
|
|
|
|
(let ((func (lookup-key mu4e-compose-mode-map keyseq)))
|
|
|
|
|
(if func (funcall func) (insert keyseq))))))
|
|
|
|
|
;; we're in the headers, but in org-mode?
|
|
|
|
|
;; if so, switch to mu4e-compose-mode
|
|
|
|
|
((and (<= (point) sepapoint) (eq major-mode 'org-mode))
|
|
|
|
|
(org~mu4e-mime-undecorate-headers)
|
|
|
|
|
(mu4e-compose-mode)
|
|
|
|
|
(add-hook 'message-send-hook 'org~mu4e-mime-convert-to-html-maybe nil t)))
|
2012-05-23 16:04:26 +02:00
|
|
|
|
;; and add the hook
|
2012-09-24 16:05:14 +02:00
|
|
|
|
(add-hook 'post-command-hook 'org~mu4e-mime-switch-headers-or-body t t))))
|
2012-05-23 16:04:26 +02:00
|
|
|
|
|
|
|
|
|
(defun org-mu4e-compose-org-mode ()
|
2019-02-18 06:22:16 +01:00
|
|
|
|
"Defines a pseudo-minor mode for mu4e-compose-mode.
|
|
|
|
|
Edit the message body using org mode. DEPRECATED."
|
2012-05-23 16:04:26 +02:00
|
|
|
|
(interactive)
|
|
|
|
|
(unless (member major-mode '(org-mode mu4e-compose-mode))
|
2012-07-10 11:11:06 +02:00
|
|
|
|
(mu4e-error "Need org-mode or mu4e-compose-mode"))
|
2012-09-24 16:05:14 +02:00
|
|
|
|
;; we can check if we're already in org-mu4e-compose-mode by checking if the
|
|
|
|
|
;; post-command-hook is set; hackish...but a buffer-local variable does not
|
|
|
|
|
;; seem to survive buffer switching
|
2012-05-25 15:51:23 +02:00
|
|
|
|
(if (not (member 'org~mu4e-mime-switch-headers-or-body post-command-hook))
|
2012-05-23 16:04:26 +02:00
|
|
|
|
(progn
|
2012-05-25 15:51:23 +02:00
|
|
|
|
(org~mu4e-mime-switch-headers-or-body)
|
2012-09-19 11:16:14 +02:00
|
|
|
|
(mu4e-message
|
2019-05-26 17:50:14 +02:00
|
|
|
|
(concat
|
|
|
|
|
"org-mu4e-compose-org-mode enabled; "
|
|
|
|
|
"press M-m before issuing message-mode commands")))
|
2012-05-23 16:04:26 +02:00
|
|
|
|
(progn ;; otherwise, remove crap
|
|
|
|
|
(remove-hook 'post-command-hook 'org~mu4e-mime-switch-headers-or-body t)
|
2012-05-25 15:51:23 +02:00
|
|
|
|
(org~mu4e-mime-undecorate-headers) ;; shut off org-mode stuff
|
2012-05-23 16:04:26 +02:00
|
|
|
|
(mu4e-compose-mode)
|
|
|
|
|
(message "org-mu4e-compose-org-mode disabled"))))
|
|
|
|
|
|
2012-01-06 11:31:28 +01:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
(provide 'org-mu4e)
|
2012-09-19 11:16:14 +02:00
|
|
|
|
|
2012-01-06 11:31:28 +01:00
|
|
|
|
;;; org-mu4e.el ends here
|