From d300d45f8937b24d2da20d9141820c0eb12bf4c3 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Thu, 23 Apr 2020 17:12:24 -0400 Subject: [PATCH] Add doc string and format --- emacs/init.org | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/emacs/init.org b/emacs/init.org index cae43a2..29b9e73 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -3767,6 +3767,9 @@ Support sending rich-text emails via Markdown: "<#/multipart>\n")) (defun convert-message-to-markdown () + "Convert the message in the current buffer to a multipart HTML email. + + The HTML is rendered by treating the message content as Markdown." (interactive) (unless (executable-find "pandoc") (error "Pandoc not found, unable to convert message")) @@ -3780,8 +3783,8 @@ Support sending rich-text emails via Markdown: (call-process-region begin end "pandoc" nil html-buf nil "--quiet" "-f" "gfm" "-t" "html")) (html (format "\n\n\n%s\n\n" - (with-current-buffer html-buf - (buffer-substring (point-min) (point-max))))) + (with-current-buffer html-buf + (buffer-substring (point-min) (point-max))))) (raw-body (buffer-substring begin end))) (when (not (= exit-code 0)) (error "Markdown conversion failed, see %s" (buffer-name html-buf))) @@ -3812,8 +3815,8 @@ Support sending rich-text emails via Markdown: (message-send-and-exit)) (with-eval-after-load 'message - (define-key message-mode-map (kbd "C-c C-s") #'message-md-send) - (define-key message-mode-map (kbd "C-c C-c") #'message-md-send-and-exit)) + (define-key message-mode-map (kbd "C-c C-s") #'message-md-send) + (define-key message-mode-map (kbd "C-c C-c") #'message-md-send-and-exit)) #+END_SRC