From a80c82de83899f27913a74ddaf45970a3718dff1 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Fri, 31 Jan 2020 17:08:46 +0100 Subject: [PATCH] update org-mime --- bba.org | 2 +- elpa/org-mime-20190805.57/org-mime-pkg.el | 2 - .../org-mime-autoloads.el | 11 +++-- elpa/org-mime-20191226.2309/org-mime-pkg.el | 2 + .../org-mime.el | 13 +++-- elpa/org-mime-readme.txt | 48 ++++++++++++++----- 6 files changed, 58 insertions(+), 20 deletions(-) delete mode 100644 elpa/org-mime-20190805.57/org-mime-pkg.el rename elpa/{org-mime-20190805.57 => org-mime-20191226.2309}/org-mime-autoloads.el (82%) create mode 100644 elpa/org-mime-20191226.2309/org-mime-pkg.el rename elpa/{org-mime-20190805.57 => org-mime-20191226.2309}/org-mime.el (98%) diff --git a/bba.org b/bba.org index fc0ba656..75a997cd 100644 --- a/bba.org +++ b/bba.org @@ -1967,7 +1967,7 @@ Use =C-c M= to send a multipart email with .org as text and exported html. #+BEGIN_SRC emacs-lisp :tangle yes - (load-file "~/.emacs.d/elpa/org-mime-20190805.57/org-mime.el") + (load-file "~/.emacs.d/elpa/org-mime-20191226.2309/org-mime.el") (add-hook 'org-mode-hook (lambda() (define-key org-mode-map "\C-c\S-m" 'org-mime-org-buffer-htmlize))) diff --git a/elpa/org-mime-20190805.57/org-mime-pkg.el b/elpa/org-mime-20190805.57/org-mime-pkg.el deleted file mode 100644 index fcfe0eb3..00000000 --- a/elpa/org-mime-20190805.57/org-mime-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "org-mime" "20190805.57" "org html export for text/html MIME emails" '((emacs "24.4") (cl-lib "0.5")) :commit "4bd5d55ba9bca84ffd938b477c72d701cf3736df" :keywords '("mime" "mail" "email" "html") :authors '(("Eric Schulte")) :maintainer '("Chen Bin (redguardtoo)") :url "http://github.com/org-mime/org-mime") diff --git a/elpa/org-mime-20190805.57/org-mime-autoloads.el b/elpa/org-mime-20191226.2309/org-mime-autoloads.el similarity index 82% rename from elpa/org-mime-20190805.57/org-mime-autoloads.el rename to elpa/org-mime-20191226.2309/org-mime-autoloads.el index 3fe08d3f..f320b8db 100644 --- a/elpa/org-mime-20190805.57/org-mime-autoloads.el +++ b/elpa/org-mime-20191226.2309/org-mime-autoloads.el @@ -1,10 +1,12 @@ ;;; org-mime-autoloads.el --- automatically extracted autoloads ;; ;;; Code: -(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +(add-to-list 'load-path (directory-file-name + (or (file-name-directory #$) (car load-path)))) + -;;;### (autoloads nil "org-mime" "org-mime.el" (23994 46438 579200 -;;;;;; 771000)) +;;;### (autoloads nil "org-mime" "org-mime.el" (0 0 0 0)) ;;; Generated autoloads from org-mime.el (autoload 'org-mime-htmlize "org-mime" "\ @@ -45,11 +47,14 @@ Following headline properties can determine the mail headers, \(fn &optional HTMLIZE-FIRST-LEVEL)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-mime" '("org-mime-"))) + ;;;*** ;; Local Variables: ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t +;; coding: utf-8 ;; End: ;;; org-mime-autoloads.el ends here diff --git a/elpa/org-mime-20191226.2309/org-mime-pkg.el b/elpa/org-mime-20191226.2309/org-mime-pkg.el new file mode 100644 index 00000000..df626cab --- /dev/null +++ b/elpa/org-mime-20191226.2309/org-mime-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "org-mime" "20191226.2309" "org html export for text/html MIME emails" '((emacs "24.4") (cl-lib "0.5")) :commit "b1899762170eaa656555ce62c58e613ca3509ec4" :keywords '("mime" "mail" "email" "html") :authors '(("Eric Schulte")) :maintainer '("Chen Bin (redguardtoo)") :url "http://github.com/org-mime/org-mime") diff --git a/elpa/org-mime-20190805.57/org-mime.el b/elpa/org-mime-20191226.2309/org-mime.el similarity index 98% rename from elpa/org-mime-20190805.57/org-mime.el rename to elpa/org-mime-20191226.2309/org-mime.el index 68a3af63..54b895d4 100644 --- a/elpa/org-mime-20190805.57/org-mime.el +++ b/elpa/org-mime-20191226.2309/org-mime.el @@ -5,7 +5,7 @@ ;; Author: Eric Schulte ;; Maintainer: Chen Bin (redguardtoo) ;; Keywords: mime, mail, email, html -;; Package-Version: 20190805.57 +;; Package-Version: 20191226.2309 ;; Homepage: http://github.com/org-mime/org-mime ;; Version: 0.1.6 ;; Package-Requires: ((emacs "24.4") (cl-lib "0.5")) @@ -100,6 +100,14 @@ ;; 3. Now the quoted mail uses a modern style (like Gmail), so mail replies ;; looks clean and modern. If you prefer the old style, please set ;; `org-mime-beautify-quoted-mail' to nil. +;; +;; 4. Please note this program can only embed exported HTML into mail. +;; Org-mode is responsible for rendering HTML. +;; +;; For example, see https://github.com/org-mime/org-mime/issues/38 +;; The solution is patching org-mode, +;; https://lists.gnu.org/archive/html/emacs-orgmode/2019-11/msg00016.html +;; ;;; Code: (require 'cl-lib) @@ -458,8 +466,7 @@ If SUBTREEP is t, curret org node is subtree." (plain (cdr exported)) (export-opts (org-mime-get-export-options subtreep)) patched-html) - (unless (featurep 'message) (require 'message)) - (message-mail to subject headers nil) + (compose-mail to subject headers nil) (message-goto-body) (setq patched-html (with-temp-buffer (insert html) diff --git a/elpa/org-mime-readme.txt b/elpa/org-mime-readme.txt index 02bed600..dc5a0f3b 100644 --- a/elpa/org-mime-readme.txt +++ b/elpa/org-mime-readme.txt @@ -1,4 +1,4 @@ -WYSWYG, html mime composition using org-mode +WYSIWYG, html mime composition using org-mode For mail composed using the orgstruct-mode minor mode, this provides a function for converting all or part of your mail buffer @@ -12,33 +12,36 @@ package the results into an email handling with appropriate MIME encoding. `org-mime-org-subtree-htmlize' is similar to `org-mime-org-buffer-htmlize' -but works on subtree. It can also read subtree properties MAIL_SUBJECT, -MAIL_TO, MAIL_CC, and MAIL_BCC. Here is the sample of subtree: +but works on current subtree. It can read following subtree properties: +MAIL_SUBJECT, MAIL_TO, MAIL_FROM, MAIL_CC, and MAIL_BCC. +Here is the sample of a subtree: * mail one :PROPERTIES: :MAIL_SUBJECT: mail title :MAIL_TO: person1@gmail.com + :MAIL_FROM: sender@gmail.com :MAIL_CC: person2@gmail.com :MAIL_BCC: person3@gmail.com :END: -To avoid exporting TOC, you can setup `org-mime-export-options', +To avoid exporting the table of contents, you can setup +`org-mime-export-options': (setq org-mime-export-options '(:section-numbers nil :with-author nil :with-toc nil)) -Or just setup your export options in org buffer/subtree which is overrided -by `org-mime-export-options' when it's NOT nil. -You can change `org-mime-up-subtree-heading' before exporting subtree. -heck its documentation. +Or just setup your export options in the org buffer/subtree. These are +overridden by `org-mime-export-options' when it is non-nil. + Quick start: -Write mail in message-mode, make sure the mail body follows org format. -Before sending mail, `M-x org-mime-htmlize' +Write a message in message-mode, make sure the mail body follows +org format. Before sending mail, run `M-x org-mime-htmlize' to convert the +body to html, then send the mail as usual. Setup (OPTIONAL): -you might want to bind this to a key with something like the +You might want to bind this to a key with something like the following message-mode binding (add-hook 'message-mode-hook @@ -50,3 +53,26 @@ and the following org-mode binding (add-hook 'org-mode-hook (lambda () (local-set-key (kbd "C-c M-o") 'org-mime-org-buffer-htmlize))) + +Extra Tips: +1. In order to embed images into your mail, use the syntax below, +[[/full/path/to/your.jpg]] + +2. It's easy to add your own emphasis markup. For example, to render text +between "@" in a red color, you can add a function to `org-mime-html-hook': + + (add-hook 'org-mime-html-hook + (lambda () + (while (re-search-forward "@\\([^@]*\\)@" nil t) + (replace-match "\\1")))) + +3. Now the quoted mail uses a modern style (like Gmail), so mail replies +looks clean and modern. If you prefer the old style, please set +`org-mime-beautify-quoted-mail' to nil. + +4. Please note this program can only embed exported HTML into mail. + Org-mode is responsible for rendering HTML. + + For example, see https://github.com/org-mime/org-mime/issues/38 + The solution is patching org-mode, + https://lists.gnu.org/archive/html/emacs-orgmode/2019-11/msg00016.html -- 2.47.3