[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-mime b33c96b2d0 015/118: embedded image could use abso
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/org-mime b33c96b2d0 015/118: embedded image could use absolute path |
Date: |
Wed, 5 Jan 2022 07:58:42 -0500 (EST) |
branch: elpa/org-mime
commit b33c96b2d098cd8c8ba51b8f790a6e092a5aa5a4
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: Chen Bin <chenbin.sh@gmail.com>
embedded image could use absolute path
---
org-mime.el | 26 +++++++++++++++++---------
1 file changed, 17 insertions(+), 9 deletions(-)
diff --git a/org-mime.el b/org-mime.el
index 82d28f2e82..c3b2a5becf 100644
--- a/org-mime.el
+++ b/org-mime.el
@@ -98,6 +98,9 @@ buffer holding\nthe text to be exported.")
(defvar org-mime-send-buffer-hook nil
"Hook to run in the Org-mode file before export.")
+(defvar org-mime-debug nil
+ "Enable debug logger.")
+
(defun org-mime--export-string (s &optional opts)
(if (fboundp 'org-export-string-as)
;; emacs24
@@ -129,6 +132,7 @@ exported html."
(defun org-mime-file (ext path id)
"Markup a file for attachment."
+ (if org-mime-debug (message "org-mime-file called => %s %s %s" ext path id))
(case org-mime-library
(mml (format (concat "<#part type=\"%s\" filename=\"%s\" "
"disposition=inline id=\"<%s>\">\n<#/part>\n")
@@ -169,7 +173,8 @@ and images in a multipart/related part."
(defun org-mime-replace-images (str current-file)
"Replace images in html files with cid links."
- (let (html-images)
+ (if org-mime-debug (message "org-mime-replace-images called => %s"
current-file)
+) (let* (html-images)
(cons
(replace-regexp-in-string ;; replace images in html
"src=\"\\([^\"]+\\)\""
@@ -178,8 +183,8 @@ and images in a multipart/related part."
"src=\"cid:%s\""
(let* ((url (and (string-match "src=\"\\([^\"]+\\)\"" text)
(match-string 1 text)))
- (path (expand-file-name
- url (file-name-directory current-file)))
+ (path (if (string-match-p "^file:///" url)
(replace-regexp-in-string "^file://" "" url)
+ (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
@@ -192,6 +197,7 @@ and images in a multipart/related part."
"Export a portion of an email body composed using `mml-mode' to
html using `org-mode'. If called with an active region only
export that region, otherwise export the entire body."
+ (if org-mime-debug (message "org-mime-htmlize called"))
(interactive "P")
(let* ((region-p (org-region-active-p))
(html-start (or (and region-p (region-beginning))
@@ -203,19 +209,19 @@ export that region, otherwise export the entire body."
;; TODO: should catch signature...
(point-max)))
(body (concat org-mime-default-header
- (buffer-substring html-start html-end)))
+ (buffer-substring html-start html-end)))
(tmp-file (make-temp-name (expand-file-name
- "mail" temporary-file-directory)))
+ "mail" temporary-file-directory)))
;; 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 org-mime-preserve-breaks)
- ;; dvipng for inline latex because MathJax doesn't work in mail
- (org-html-with-latex 'dvipng)
+ ;; dvipng for inline latex because MathJax doesn't work in mail
+ (org-html-with-latex 'dvipng)
;; to hold attachments for inline html images
(html-and-images
(org-mime-replace-images
- (org-mime--export-string body) tmp-file))
+ (org-mime--export-string body) tmp-file))
(html-images (unless arg (cdr html-and-images)))
(html (org-mime-apply-html-hook
(if arg
@@ -242,7 +248,8 @@ export that region, otherwise export the entire body."
(defun org-mime--get-buffer-title ()
"Returns the `TITLE' option of the current buffer, or `nil' if
it is not set."
- (let ((tmp (plist-get (org-export--get-inbuffer-options) :title)))
+ (let* ((tmp (if (fboundp 'org-export--get-inbuffer-options)
+ (plist-get (org-export--get-inbuffer-options) :title))))
(when tmp
(let ((txt (car tmp)))
(set-text-properties 0 (length txt) nil txt)
@@ -274,6 +281,7 @@ it is not set."
(org-mime-compose body file nil subject nil opts))))
(defun org-mime-compose (body file &optional to subject headers opts)
+ (if org-mime-debug (message "org-mime-compose called => %s" file))
(let* ((fmt 'html))
(unless (featurep 'message)
(require 'message))
- [nongnu] elpa/org-mime e5c68b1c66 044/118: minor changes to docstrings for readability and style changes., (continued)
- [nongnu] elpa/org-mime e5c68b1c66 044/118: minor changes to docstrings for readability and style changes., ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime e35c367e7d 048/118: clean code, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 41ea9818b4 050/118: fix cc, bcc compiling error, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 0db41d5b4e 065/118: emergency fix of broken 0.1.4, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 470808cc14 070/118: Added support for MAIL_FROM property, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 5132ec0586 089/118: Improve signature separator regex, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 744f5f3315 090/118: Merge pull request #49 from ahttraga/master, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime dc7ae1de85 094/118: Show individual paragraphs in gmail reply quotes, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 85c98739f3 001/118: import original org-mime, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 8d7797ea07 007/118: clean code according to org review, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime b33c96b2d0 015/118: embedded image could use absolute path,
ELPA Syncer <=
- [nongnu] elpa/org-mime dd1b9881af 027/118: remove drawers when org-mime-htmlize-subtree at emacs 24.3, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 8067e76eb1 029/118: add documentation on embedded image, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 80b4e3a3b4 008/118: add readme, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime fb265448df 038/118: Merge pull request #14 from unhammer/issue13-OPTIONS-noise, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 0752659f7a 042/118: No drawer exporting (default since Emacs 25), ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime db707a7337 040/118: Merge pull request #15 from unhammer/patch-1, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime bc61d4de7d 045/118: Merge pull request #18 from jkitchin/master, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 7e89b4b741 053/118: move cond out of the cleanup function, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 7bcb075550 060/118: CI and TDD, fixed some minor bug. bump 0.1.2, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 286330fa15 069/118: fixed: LaTeX fragment not exported correctly, ELPA Syncer, 2022/01/05