[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-mime c6e2b95664 047/118: clean code
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/org-mime c6e2b95664 047/118: clean code |
Date: |
Wed, 5 Jan 2022 07:58:45 -0500 (EST) |
branch: elpa/org-mime
commit c6e2b9566490edd3b451f02d29e32630e0e17a70
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: Chen Bin <chenbin.sh@gmail.com>
clean code
---
org-mime.el | 59 ++++++++++++++++++++++++++++++++---------------------------
1 file changed, 32 insertions(+), 27 deletions(-)
diff --git a/org-mime.el b/org-mime.el
index 51947b1427..084bfe2922 100644
--- a/org-mime.el
+++ b/org-mime.el
@@ -226,7 +226,7 @@ OPTS is export options."
;; (org-mime-change-element-style
;; "pre" (format "color: %s; background-color: %s;"
;; "#E6E1DC" "#232323"))
-;; (org-mime-change-class-style
+;; (org-mime-change-class-style
;; "verse" "border-left: 2px solid gray; padding-left: 4px;")))
(defun org-mime-file (ext path id)
@@ -234,17 +234,17 @@ OPTS is export options."
(when org-mime-debug (message "org-mime-file called => %s %s %s" ext path
id))
(cl-case org-mime-library
(mml (format (concat "<#part type=\"%s\" filename=\"%s\" "
- "disposition=inline id=\"<%s>\">\n<#/part>\n")
- ext path id))
+ "disposition=inline id=\"<%s>\">\n<#/part>\n")
+ ext path id))
(semi (concat
- (format (concat "--[[%s\nContent-Disposition: "
- "inline;\nContent-ID: <%s>][base64]]\n")
- ext id)
- (base64-encode-string
- (with-temp-buffer
- (set-buffer-multibyte nil)
- (insert-file-contents-literally path)
- (buffer-string)))))
+ (format (concat "--[[%s\nContent-Disposition: "
+ "inline;\nContent-ID: <%s>][base64]]\n")
+ ext id)
+ (base64-encode-string
+ (with-temp-buffer
+ (set-buffer-multibyte nil)
+ (insert-file-contents-literally path)
+ (buffer-string)))))
(vm "?")))
(defun org-mime-encode-quoted-mail-body ()
@@ -309,7 +309,7 @@ HTML is the body of the message."
(let (retval)
(condition-case ex
(setq info (org-mime-encode-quoted-mail-body))
- (setq retval info)
+ (setq retval info)
('error (setq info nil)))
retval))
(cond
@@ -338,10 +338,10 @@ If html portion of message includes IMAGES they are
wrapped in multipart/related
(semi (concat
"--" "<<alternative>>-{\n"
"--" "[[text/plain]]\n" plain
- (when images (concat "--" "<<alternative>>-{\n"))
+ (when images (concat "--" "<<alternative>>-{\n"))
"--" "[[text/html]]\n" html
- images
- (when images (concat "--" "}-<<alternative>>\n"))
+ images
+ (when images (concat "--" "}-<<alternative>>\n"))
"--" "}-<<alternative>>\n"))
(vm "?")))
@@ -354,17 +354,17 @@ CURRENT-FILE is used to calculate full path of images."
(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 (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
- (org-mime-file (concat "image/" ext) path id))
- id)))
+ (format
+ "src=\"cid:%s\""
+ (let* ((url (and (string-match "src=\"\\([^\"]+\\)\"" text)
+ (match-string 1 text)))
+ (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
+ (org-mime-file (concat "image/" ext) path id))
+ id)))
str)
html-images)))
@@ -414,7 +414,7 @@ If ARG is not nil, use `org-mime-fixedwith-wrap' to wrap
the exported text."
(save-excursion
(goto-char html-start)
(insert (org-mime-multipart
- body html (mapconcat 'identity html-images "\n"))))))
+ body html (mapconcat 'identity html-images "\n"))))))
(defun org-mime-apply-html-hook (html)
"Apply HTML hook."
@@ -516,4 +516,9 @@ alternatives."
(org-mime-compose body file to subject other-headers opts)))))
(provide 'org-mime)
+;; Local Variables:
+;; coding: utf-8
+;; tab-width: 2
+;; indent-tabs-mode: nil
+;; End:
;;; org-mime.el ends here
- [nongnu] elpa/org-mime 0311662889 017/118: Correct 'interactive' position, (continued)
- [nongnu] elpa/org-mime 0311662889 017/118: Correct 'interactive' position, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime ffbf3e3e47 010/118: Support mime encoding current subtree, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime c49eb00fc6 021/118: can create email from org subtree, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime e554d8821d 020/118: Merge pull request #1 from syohex/fix-package, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 91d8f48775 023/118: can set org export options, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 7c3483b2b0 030/118: sample for advanced setup, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime e3329c7c4d 032/118: README, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 0a0aa9b110 034/118: README, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime ad30f199cb 036/118: provide org-mime-find-html-start callback, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 5f253f541c 037/118: only use export header when creating html, keep out of email, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime c6e2b95664 047/118: clean code,
ELPA Syncer <=
- [nongnu] elpa/org-mime 64a3f56651 041/118: (setq org-html-with-latex nil) sometimes useful #16, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 10098b001c 049/118: Fix file attachments and equations and enhance emails from org-files, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 1e792ef061 059/118: Merge pull request #28 from titaniumbones/fix-klipse-error, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime f610861858 063/118: htmlize current subtree, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 9506727ca7 072/118: README, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime b189976217 076/118: fixed CI, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 778f818ad3 078/118: Add ASCII text/plain export test, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 9f84446038 082/118: make emacs 25 test pass, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 484bf3b0b8 083/118: can edit mail-body in org-mode buffer directly, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 5980ccaace 080/118: fixed unit test, ELPA Syncer, 2022/01/05