Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

org-msg-improve-reply-header fails in mu4e #9

Closed
titaniumbones opened this issue Sep 3, 2019 · 11 comments
Closed

org-msg-improve-reply-header fails in mu4e #9

titaniumbones opened this issue Sep 3, 2019 · 11 comments

Comments

@titaniumbones
Copy link
Contributor

titaniumbones commented Sep 3, 2019

org-msg-improve-reply-header assumes that the html string has been generated by gnus-article-browse-html-article in org-msg-save-article-for-reply-gnus, which is not called by the mu4e backend. WHat's the best way to fix this?

@titaniumbones titaniumbones changed the title org-msg-improve-html-buffer fails in mu4e org-msg-improve-reply-header fails in mu4e Sep 3, 2019
@jeremy-compostella
Copy link
Owner

Correct. This function is just making the reply header looks better. How do this header looks like with mu4e ? Is there any ?

The function in which you could introduce the reply header would be org-msg-save-article-for-reply-mu4e.

@jeremy-compostella
Copy link
Owner

Hi Matt,

Could you give a try to the experimental branch that I just created and provide me your feedback ? It include a patch from @JulienMasson that was pending for a while. It also include a patch cleaning his patch. If you notice a difference between with his patch only compared to his+mine let me know.

Jeremy
One Emacs to rule them all

@titaniumbones
Copy link
Contributor Author

titaniumbones commented Sep 4, 2019

I don't htink I cna test this properly, but my first attempt fails with:

Debugger entered--Lisp error: (wrong-number-of-arguments mapconcat 2)
  (mapconcat --cl-field2str-- '((:from function mails2str) (:subject 'identity) (:to function mails2str) (:date 'message-make-date)))
  (insert "<div align=\"left\">\n" (mapconcat --cl-field2str-- '((:from function mails2str) (:subject 'identity) (:to function mails2str) (:date 'message-make-date))) "</div>\n<hr>\n")
  (progn (goto-char (match-end 0)) (insert "<div align=\"left\">\n" (mapconcat --cl-field2str-- '((:from function mails2str) (:subject 'identity) (:to function mails2str) (:date 'message-make-date))) "</div>\n<hr>\n"))
  (if (re-search-forward "<body\\(.*?\\)>" nil t) (progn (goto-char (match-end 0)) (insert "<div align=\"left\">\n" (mapconcat --cl-field2str-- '((:from function mails2str) (:subject 'identity) (:to function mails2str) (:date 'message-make-date))) "</div>\n<hr>\n")))
  (progn (save-excursion (insert html)) (save-excursion (if (re-search-forward "^<html\\(.*?\\)>" nil t) (progn (delete-region (point-min) (match-beginning 0))))) (if (re-search-forward "<body\\(.*?\\)>" nil t) (progn (goto-char (match-end 0)) (insert "<div align=\"left\">\n" (mapconcat --cl-field2str-- '((:from function mails2str) (:subject ...) (:to function mails2str) (:date ...))) "</div>\n<hr>\n"))) (write-file file))
  (unwind-protect (progn (save-excursion (insert html)) (save-excursion (if (re-search-forward "^<html\\(.*?\\)>" nil t) (progn (delete-region (point-min) (match-beginning 0))))) (if (re-search-forward "<body\\(.*?\\)>" nil t) (progn (goto-char (match-end 0)) (insert "<div align=\"left\">\n" (mapconcat --cl-field2str-- '(... ... ... ...)) "</div>\n<hr>\n"))) (write-file file)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (save-excursion (insert html)) (save-excursion (if (re-search-forward "^<html\\(.*?\\)>" nil t) (progn (delete-region (point-min) (match-beginning 0))))) (if (re-search-forward "<body\\(.*?\\)>" nil t) (progn (goto-char (match-end 0)) (insert "<div align=\"left\">\n" (mapconcat --cl-field2str-- '...) "</div>\n<hr>\n"))) (write-file file)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (save-excursion (insert html)) (save-excursion (if (re-search-forward "^<html\\(.*?\\)>" nil t) (progn (delete-region ... ...)))) (if (re-search-forward "<body\\(.*?\\)>" nil t) (progn (goto-char (match-end 0)) (insert "<div align=\"left\">\n" (mapconcat --cl-field2str-- ...) "</div>\n<hr>\n"))) (write-file file)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
  (progn (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (save-excursion (insert html)) (save-excursion (if (re-search-forward "^<html\\(.*?\\)>" nil t) (progn ...))) (if (re-search-forward "<body\\(.*?\\)>" nil t) (progn (goto-char ...) (insert "<div align=\"left\">\n" ... "</div>\n<hr>\n"))) (write-file file)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (list file))
  (let* ((--cl-field2str-- #'(lambda (f) (format "%s: %s<br>\n" (capitalize (substring ... 1)) (funcall (cdr e) (mu4e-message-field msg ...)))))) (progn (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (save-excursion (insert html)) (save-excursion (if ... ...)) (if (re-search-forward "<body\\(.*?\\)>" nil t) (progn ... ...)) (write-file file)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (list file)))
  (progn (let* ((--cl-field2str-- #'(lambda (f) (format "%s: %s<br>\n" (capitalize ...) (funcall ... ...))))) (progn (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (save-excursion ...) (save-excursion ...) (if ... ...) (write-file file)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (list file))))
  (let* ((--cl-mails2str-- #'(lambda (l) (mapconcat #'(lambda ... ...) l ", ")))) (progn (let* ((--cl-field2str-- #'(lambda (f) (format "%s: %s<br>\n" ... ...)))) (progn (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn ... ... ... ...) (and ... ...)))) (list file)))))
  (let* ((msg (mu4e-message-at-point)) (html (mu4e-message-field msg :body-html)) (file (concat "/tmp/" (mu4e-message-field msg :message-id)))) (let* ((--cl-mails2str-- #'(lambda (l) (mapconcat #'... l ", ")))) (progn (let* ((--cl-field2str-- #'(lambda ... ...))) (progn (let ((temp-buffer ...)) (save-current-buffer (set-buffer temp-buffer) (unwind-protect ... ...))) (list file))))))
  (save-current-buffer (set-buffer mu4e~view-buffer-name) (let* ((msg (mu4e-message-at-point)) (html (mu4e-message-field msg :body-html)) (file (concat "/tmp/" (mu4e-message-field msg :message-id)))) (let* ((--cl-mails2str-- #'(lambda (l) (mapconcat ... l ", ")))) (progn (let* ((--cl-field2str-- #'...)) (progn (let (...) (save-current-buffer ... ...)) (list file)))))))
  org-msg-save-article-for-reply-mu4e()

(sorry I can't figure this out immediately)

@jeremy-compostella
Copy link
Owner

Do you have 82e97a0 (last patch on the experimental branch) ?

@titaniumbones
Copy link
Contributor Author

titaniumbones commented Sep 4, 2019

I didn't but unfortuantely that gives a different error ☹️

Debugger entered--Lisp error: (void-variable e)
  (car e)
  (symbol-name (car e))
  (substring (symbol-name (car e)) 1)
  (capitalize (substring (symbol-name (car e)) 1))
  (format "%s: %s<br>\n" (capitalize (substring (symbol-name (car e)) 1)) (funcall (cdr e) (mu4e-message-field msg (car e))))
  (closure ((--cl-mails2str-- closure ((file . "/tmp/ee4b5a6e-0b82-4b29-827c-fecbf0c0f331@xtinmta1...") (html . "<!--  //--><!-- --><!--  //--><!-- --><!--  //--><...") (msg :docid 59746 :subject "✅ You've secured this: up to half price offers for..." :date (23920 14223 0) :size 93585 :message-id "ee4b5a6e-0b82-4b29-827c-fecbf0c0f331@xtinmta1351.x..." :mailing-list "177351.xt.local" :path "/home/matt/UofTMail/inbox/cur/1567635387_2.27084.a..." :maildir "/inbox" :priority normal :flags (seen list) :parts ((:index 1 :name "1.msgpart" :mime-type "text/plain" :type ... :attachment nil :size 24621) (:index 2 :name "2.msgpart" :mime-type "text/html" :type ... :attachment nil :size 61402)) :from (("Hotels.com" . "info@mail.hotels.com")) :reply-to (("Hotels.com" . "reply-fe5b1672766102757011-1935712_HTML-1759215362...")) :to ((nil . "MATT.PRICE@UTORONTO.CA")) :body-txt-params (("charset" . "utf-8")) :body-txt " \15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n \15\n \15\n\15\n\15..." :body-html "<!--  //--><!-- --><!--  //--><!-- --><!--  //--><...") t) (l) (mapconcat #'(lambda (m) (format "%S &lt;%s&gt;" ... ...)) l ", ")) (file . "/tmp/ee4b5a6e-0b82-4b29-827c-fecbf0c0f331@xtinmta1...") (html . "<!--  //--><!-- --><!--  //--><!-- --><!--  //--><...") (msg :docid 59746 :subject "✅ You've secured this: up to half price offers for..." :date (23920 14223 0) :size 93585 :message-id "ee4b5a6e-0b82-4b29-827c-fecbf0c0f331@xtinmta1351.x..." :mailing-list "177351.xt.local" :path "/home/matt/UofTMail/inbox/cur/1567635387_2.27084.a..." :maildir "/inbox" :priority normal :flags (seen list) :parts ((:index 1 :name "1.msgpart" :mime-type "text/plain" :type (leaf) :attachment nil :size 24621) (:index 2 :name "2.msgpart" :mime-type "text/html" :type (leaf) :attachment nil :size 61402)) :from (("Hotels.com" . "info@mail.hotels.com")) :reply-to (("Hotels.com" . "reply-fe5b1672766102757011-1935712_HTML-1759215362...")) :to ((nil . "MATT.PRICE@UTORONTO.CA")) :body-txt-params (("charset" . "utf-8")) :body-txt " \15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n \15\n \15\n\15\n\15..." :body-html "<!--  //--><!-- --><!--  //--><!-- --><!--  //--><...") t) (f) (format "%s: %s<br>\n" (capitalize (substring (symbol-name (car e)) 1)) (funcall (cdr e) (mu4e-message-field msg (car e)))))((:from function mails2str))
  mapconcat((closure ((--cl-mails2str-- closure ((file . "/tmp/ee4b5a6e-0b82-4b29-827c-fecbf0c0f331@xtinmta1...") (html . "<!--  //--><!-- --><!--  //--><!-- --><!--  //--><...") (msg :docid 59746 :subject "✅ You've secured this: up to half price offers for..." :date (23920 14223 0) :size 93585 :message-id "ee4b5a6e-0b82-4b29-827c-fecbf0c0f331@xtinmta1351.x..." :mailing-list "177351.xt.local" :path "/home/matt/UofTMail/inbox/cur/1567635387_2.27084.a..." :maildir "/inbox" :priority normal :flags (seen list) :parts ((:index 1 :name "1.msgpart" :mime-type "text/plain" :type ... :attachment nil :size 24621) (:index 2 :name "2.msgpart" :mime-type "text/html" :type ... :attachment nil :size 61402)) :from (("Hotels.com" . "info@mail.hotels.com")) :reply-to (("Hotels.com" . "reply-fe5b1672766102757011-1935712_HTML-1759215362...")) :to ((nil . "MATT.PRICE@UTORONTO.CA")) :body-txt-params (("charset" . "utf-8")) :body-txt " \15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n \15\n \15\n\15\n\15..." :body-html "<!--  //--><!-- --><!--  //--><!-- --><!--  //--><...") t) (l) (mapconcat #'(lambda (m) (format "%S &lt;%s&gt;" ... ...)) l ", ")) (file . "/tmp/ee4b5a6e-0b82-4b29-827c-fecbf0c0f331@xtinmta1...") (html . "<!--  //--><!-- --><!--  //--><!-- --><!--  //--><...") (msg :docid 59746 :subject "✅ You've secured this: up to half price offers for..." :date (23920 14223 0) :size 93585 :message-id "ee4b5a6e-0b82-4b29-827c-fecbf0c0f331@xtinmta1351.x..." :mailing-list "177351.xt.local" :path "/home/matt/UofTMail/inbox/cur/1567635387_2.27084.a..." :maildir "/inbox" :priority normal :flags (seen list) :parts ((:index 1 :name "1.msgpart" :mime-type "text/plain" :type (leaf) :attachment nil :size 24621) (:index 2 :name "2.msgpart" :mime-type "text/html" :type (leaf) :attachment nil :size 61402)) :from (("Hotels.com" . "info@mail.hotels.com")) :reply-to (("Hotels.com" . "reply-fe5b1672766102757011-1935712_HTML-1759215362...")) :to ((nil . "MATT.PRICE@UTORONTO.CA")) :body-txt-params (("charset" . "utf-8")) :body-txt " \15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n\15\n \15\n \15\n\15\n\15..." :body-html "<!--  //--><!-- --><!--  //--><!-- --><!--  //--><...") t) (f) (format "%s: %s<br>\n" (capitalize (substring (symbol-name (car e)) 1)) (funcall (cdr e) (mu4e-message-field msg (car e))))) ((:from function mails2str) (:subject 'identity) (:to function mails2str) (:date 'message-make-date)) "")
  (insert "<div align=\"left\">\n" (mapconcat --cl-field2str-- '((:from function mails2str) (:subject 'identity) (:to function mails2str) (:date 'message-make-date)) "") "</div>\n<hr>\n")
  (progn (goto-char (match-end 0)) (insert "<div align=\"left\">\n" (mapconcat --cl-field2str-- '((:from function mails2str) (:subject 'identity) (:to function mails2str) (:date 'message-make-date)) "") "</div>\n<hr>\n"))
  (if (re-search-forward "<body\\(.*?\\)>" nil t) (progn (goto-char (match-end 0)) (insert "<div align=\"left\">\n" (mapconcat --cl-field2str-- '((:from function mails2str) (:subject 'identity) (:to function mails2str) (:date 'message-make-date)) "") "</div>\n<hr>\n")))
  (progn (save-excursion (insert html)) (save-excursion (if (re-search-forward "^<html\\(.*?\\)>" nil t) (progn (delete-region (point-min) (match-beginning 0))))) (if (re-search-forward "<body\\(.*?\\)>" nil t) (progn (goto-char (match-end 0)) (insert "<div align=\"left\">\n" (mapconcat --cl-field2str-- '((:from function mails2str) (:subject ...) (:to function mails2str) (:date ...)) "") "</div>\n<hr>\n"))) (write-file file))
  (unwind-protect (progn (save-excursion (insert html)) (save-excursion (if (re-search-forward "^<html\\(.*?\\)>" nil t) (progn (delete-region (point-min) (match-beginning 0))))) (if (re-search-forward "<body\\(.*?\\)>" nil t) (progn (goto-char (match-end 0)) (insert "<div align=\"left\">\n" (mapconcat --cl-field2str-- '(... ... ... ...) "") "</div>\n<hr>\n"))) (write-file file)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (save-excursion (insert html)) (save-excursion (if (re-search-forward "^<html\\(.*?\\)>" nil t) (progn (delete-region (point-min) (match-beginning 0))))) (if (re-search-forward "<body\\(.*?\\)>" nil t) (progn (goto-char (match-end 0)) (insert "<div align=\"left\">\n" (mapconcat --cl-field2str-- '... "") "</div>\n<hr>\n"))) (write-file file)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (save-excursion (insert html)) (save-excursion (if (re-search-forward "^<html\\(.*?\\)>" nil t) (progn (delete-region ... ...)))) (if (re-search-forward "<body\\(.*?\\)>" nil t) (progn (goto-char (match-end 0)) (insert "<div align=\"left\">\n" (mapconcat --cl-field2str-- ... "") "</div>\n<hr>\n"))) (write-file file)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
  (progn (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (save-excursion (insert html)) (save-excursion (if (re-search-forward "^<html\\(.*?\\)>" nil t) (progn ...))) (if (re-search-forward "<body\\(.*?\\)>" nil t) (progn (goto-char ...) (insert "<div align=\"left\">\n" ... "</div>\n<hr>\n"))) (write-file file)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (list file))
  (let* ((--cl-field2str-- #'(lambda (f) (format "%s: %s<br>\n" (capitalize (substring ... 1)) (funcall (cdr e) (mu4e-message-field msg ...)))))) (progn (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (save-excursion (insert html)) (save-excursion (if ... ...)) (if (re-search-forward "<body\\(.*?\\)>" nil t) (progn ... ...)) (write-file file)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (list file)))
  (progn (let* ((--cl-field2str-- #'(lambda (f) (format "%s: %s<br>\n" (capitalize ...) (funcall ... ...))))) (progn (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (save-excursion ...) (save-excursion ...) (if ... ...) (write-file file)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (list file))))
  (let* ((--cl-mails2str-- #'(lambda (l) (mapconcat #'(lambda ... ...) l ", ")))) (progn (let* ((--cl-field2str-- #'(lambda (f) (format "%s: %s<br>\n" ... ...)))) (progn (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn ... ... ... ...) (and ... ...)))) (list file)))))
  (let* ((msg (mu4e-message-at-point)) (html (mu4e-message-field msg :body-html)) (file (concat "/tmp/" (mu4e-message-field msg :message-id)))) (let* ((--cl-mails2str-- #'(lambda (l) (mapconcat #'... l ", ")))) (progn (let* ((--cl-field2str-- #'(lambda ... ...))) (progn (let ((temp-buffer ...)) (save-current-buffer (set-buffer temp-buffer) (unwind-protect ... ...))) (list file))))))
  (save-current-buffer (set-buffer mu4e~view-buffer-name) (let* ((msg (mu4e-message-at-point)) (html (mu4e-message-field msg :body-html)) (file (concat "/tmp/" (mu4e-message-field msg :message-id)))) (let* ((--cl-mails2str-- #'(lambda (l) (mapconcat ... l ", ")))) (progn (let* ((--cl-field2str-- #'...)) (progn (let (...) (save-current-buffer ... ...)) (list file)))))))
  org-msg-save-article-for-reply-mu4e()
  apply(org-msg-save-article-for-reply-mu4e nil)

@jeremy-compostella
Copy link
Owner

Thanks I have pushed an extra fix on the experimental branch. Could you tell me if it works now ?

@titaniumbones
Copy link
Contributor Author

getting closer! maybe somehtign wrong with the flet binding -- I odn't really understand cl-flet:

Debugger entered--Lisp error: (invalid-function #'mails2str)
  #'mails2str((("Groupon Deals of the Day" . "noreply@r.groupon.com")))
  funcall(#'mails2str (("Groupon Deals of the Day" . "noreply@r.groupon.com")))
  (format "%s: %s<br>\n" (capitalize (substring (symbol-name (car f)) 1)) (funcall (cdr f) (mu4e-message-field msg (car f))))
  (closure ((--cl-mails2str-- closure ((file . "/tmp/569102591.31201090.1567632422072.JavaMail.roc...") (html . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Trans...") (msg :docid 59739 :subject "These 24-Hour Deals Might Surprise You..." :date (23920 11302 0) :size 112892 :message-id "569102591.31201090.1567632422072.JavaMail.rocketma..." :mailing-list "channel-goods_goods_test_6_us_im_20190730_channel-..." :path "/home/matt/UofTMail/inbox/cur/1567632688_0.18001.a..." :maildir "/inbox" :priority normal :flags (seen list) :parts ((:index 1 :name "1.msgpart" :mime-type "text/html" :type ... :attachment nil :size 104914)) :from (("Groupon Deals of the Day" . "noreply@r.groupon.com")) :to ((nil . "matt.price@utoronto.ca")) :body-html "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Trans...") t) (l) (mapconcat (lambda (m) (format "%S &lt;%s&gt;" (car m) (cdr m))) l ", ")) (file . "/tmp/569102591.31201090.1567632422072.JavaMail.roc...") (html . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Trans...") (msg :docid 59739 :subject "These 24-Hour Deals Might Surprise You..." :date (23920 11302 0) :size 112892 :message-id "569102591.31201090.1567632422072.JavaMail.rocketma..." :mailing-list "channel-goods_goods_test_6_us_im_20190730_channel-..." :path "/home/matt/UofTMail/inbox/cur/1567632688_0.18001.a..." :maildir "/inbox" :priority normal :flags (seen list) :parts ((:index 1 :name "1.msgpart" :mime-type "text/html" :type (leaf) :attachment nil :size 104914)) :from (("Groupon Deals of the Day" . "noreply@r.groupon.com")) :to ((nil . "matt.price@utoronto.ca")) :body-html "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Trans...") t) (f) (format "%s: %s<br>\n" (capitalize (substring (symbol-name (car f)) 1)) (funcall (cdr f) (mu4e-message-field msg (car f)))))((:from function mails2str))
  mapconcat((closure ((--cl-mails2str-- closure ((file . "/tmp/569102591.31201090.1567632422072.JavaMail.roc...") (html . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Trans...") (msg :docid 59739 :subject "These 24-Hour Deals Might Surprise You..." :date (23920 11302 0) :size 112892 :message-id "569102591.31201090.1567632422072.JavaMail.rocketma..." :mailing-list "channel-goods_goods_test_6_us_im_20190730_channel-..." :path "/home/matt/UofTMail/inbox/cur/1567632688_0.18001.a..." :maildir "/inbox" :priority normal :flags (seen list) :parts ((:index 1 :name "1.msgpart" :mime-type "text/html" :type ... :attachment nil :size 104914)) :from (("Groupon Deals of the Day" . "noreply@r.groupon.com")) :to ((nil . "matt.price@utoronto.ca")) :body-html "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Trans...") t) (l) (mapconcat (lambda (m) (format "%S &lt;%s&gt;" (car m) (cdr m))) l ", ")) (file . "/tmp/569102591.31201090.1567632422072.JavaMail.roc...") (html . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Trans...") (msg :docid 59739 :subject "These 24-Hour Deals Might Surprise You..." :date (23920 11302 0) :size 112892 :message-id "569102591.31201090.1567632422072.JavaMail.rocketma..." :mailing-list "channel-goods_goods_test_6_us_im_20190730_channel-..." :path "/home/matt/UofTMail/inbox/cur/1567632688_0.18001.a..." :maildir "/inbox" :priority normal :flags (seen list) :parts ((:index 1 :name "1.msgpart" :mime-type "text/html" :type (leaf) :attachment nil :size 104914)) :from (("Groupon Deals of the Day" . "noreply@r.groupon.com")) :to ((nil . "matt.price@utoronto.ca")) :body-html "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Trans...") t) (f) (format "%s: %s<br>\n" (capitalize (substring (symbol-name (car f)) 1)) (funcall (cdr f) (mu4e-message-field msg (car f))))) ((:from function mails2str) (:subject 'identity) (:to function mails2str) (:date 'message-make-date)) "")
  (insert "<div align=\"left\">\n" (mapconcat --cl-field2str-- '((:from function mails2str) (:subject 'identity) (:to function mails2str) (:date 'message-make-date)) "") "</div>\n<hr>\n")
  (progn (goto-char (match-end 0)) (insert "<div align=\"left\">\n" (mapconcat --cl-field2str-- '((:from function mails2str) (:subject 'identity) (:to function mails2str) (:date 'message-make-date)) "") "</div>\n<hr>\n"))
  (if (re-search-forward "<body\\(.*?\\)>" nil t) (progn (goto-char (match-end 0)) (insert "<div align=\"left\">\n" (mapconcat --cl-field2str-- '((:from function mails2str) (:subject 'identity) (:to function mails2str) (:date 'message-make-date)) "") "</div>\n<hr>\n")))
  (progn (save-excursion (insert html)) (save-excursion (if (re-search-forward "^<html\\(.*?\\)>" nil t) (progn (delete-region (point-min) (match-beginning 0))))) (if (re-search-forward "<body\\(.*?\\)>" nil t) (progn (goto-char (match-end 0)) (insert "<div align=\"left\">\n" (mapconcat --cl-field2str-- '((:from function mails2str) (:subject ...) (:to function mails2str) (:date ...)) "") "</div>\n<hr>\n"))) (write-file file))
  (unwind-protect (progn (save-excursion (insert html)) (save-excursion (if (re-search-forward "^<html\\(.*?\\)>" nil t) (progn (delete-region (point-min) (match-beginning 0))))) (if (re-search-forward "<body\\(.*?\\)>" nil t) (progn (goto-char (match-end 0)) (insert "<div align=\"left\">\n" (mapconcat --cl-field2str-- '(... ... ... ...) "") "</div>\n<hr>\n"))) (write-file file)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (save-excursion (insert html)) (save-excursion (if (re-search-forward "^<html\\(.*?\\)>" nil t) (progn (delete-region (point-min) (match-beginning 0))))) (if (re-search-forward "<body\\(.*?\\)>" nil t) (progn (goto-char (match-end 0)) (insert "<div align=\"left\">\n" (mapconcat --cl-field2str-- '... "") "</div>\n<hr>\n"))) (write-file file)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (save-excursion (insert html)) (save-excursion (if (re-search-forward "^<html\\(.*?\\)>" nil t) (progn (delete-region ... ...)))) (if (re-search-forward "<body\\(.*?\\)>" nil t) (progn (goto-char (match-end 0)) (insert "<div align=\"left\">\n" (mapconcat --cl-field2str-- ... "") "</div>\n<hr>\n"))) (write-file file)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
  (progn (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (save-excursion (insert html)) (save-excursion (if (re-search-forward "^<html\\(.*?\\)>" nil t) (progn ...))) (if (re-search-forward "<body\\(.*?\\)>" nil t) (progn (goto-char ...) (insert "<div align=\"left\">\n" ... "</div>\n<hr>\n"))) (write-file file)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (list file))
  (let* ((--cl-field2str-- #'(lambda (f) (format "%s: %s<br>\n" (capitalize (substring ... 1)) (funcall (cdr f) (mu4e-message-field msg ...)))))) (progn (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (save-excursion (insert html)) (save-excursion (if ... ...)) (if (re-search-forward "<body\\(.*?\\)>" nil t) (progn ... ...)) (write-file file)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (list file)))
  (progn (let* ((--cl-field2str-- #'(lambda (f) (format "%s: %s<br>\n" (capitalize ...) (funcall ... ...))))) (progn (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (save-excursion ...) (save-excursion ...) (if ... ...) (write-file file)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (list file))))
  (let* ((--cl-mails2str-- (cl-function (lambda (l) (mapconcat (lambda (m) (format "%S &lt;%s&gt;" ... ...)) l ", "))))) (progn (let* ((--cl-field2str-- #'(lambda (f) (format "%s: %s<br>\n" ... ...)))) (progn (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn ... ... ... ...) (and ... ...)))) (list file)))))
  (cl-flet ((mails2str (l) (mapconcat (lambda (m) (format "%S &lt;%s&gt;" (car m) (cdr m))) l ", "))) (cl-flet* ((field2str (f) (format "%s: %s<br>\n" (capitalize (substring (symbol-name ...) 1)) (funcall (cdr f) (mu4e-message-field msg (car f)))))) (with-temp-buffer (save-excursion (insert html)) (save-excursion (when (re-search-forward "^<html\\(.*?\\)>" nil t) (delete-region (point-min) (match-beginning 0)))) (when (re-search-forward "<body\\(.*?\\)>" nil t) (goto-char (match-end 0)) (insert "<div align=\"left\">\n" (mapconcat #'field2str '(... ... ... ...) "") "</div>\n<hr>\n")) (write-file file)) (list file)))
  (cl-flet* ((mails2str (l) (mapconcat (lambda (m) (format "%S &lt;%s&gt;" (car m) (cdr m))) l ", ")) (field2str (f) (format "%s: %s<br>\n" (capitalize (substring (symbol-name (car f)) 1)) (funcall (cdr f) (mu4e-message-field msg (car f)))))) (with-temp-buffer (save-excursion (insert html)) (save-excursion (when (re-search-forward "^<html\\(.*?\\)>" nil t) (delete-region (point-min) (match-beginning 0)))) (when (re-search-forward "<body\\(.*?\\)>" nil t) (goto-char (match-end 0)) (insert "<div align=\"left\">\n" (mapconcat #'field2str '((:from function mails2str) (:subject ...) (:to function mails2str) (:date ...)) "") "</div>\n<hr>\n")) (write-file file)) (list file))
  (let* ((msg (mu4e-message-at-point)) (html (mu4e-message-field msg :body-html)) (file (concat "/tmp/" (mu4e-message-field msg :message-id)))) (cl-flet* ((mails2str (l) (mapconcat (lambda (m) (format "%S &lt;%s&gt;" (car m) (cdr m))) l ", ")) (field2str (f) (format "%s: %s<br>\n" (capitalize (substring (symbol-name ...) 1)) (funcall (cdr f) (mu4e-message-field msg (car f)))))) (with-temp-buffer (save-excursion (insert html)) (save-excursion (when (re-search-forward "^<html\\(.*?\\)>" nil t) (delete-region (point-min) (match-beginning 0)))) (when (re-search-forward "<body\\(.*?\\)>" nil t) (goto-char (match-end 0)) (insert "<div align=\"left\">\n" (mapconcat #'field2str '(... ... ... ...) "") "</div>\n<hr>\n")) (write-file file)) (list file)))
  (save-current-buffer (set-buffer mu4e~view-buffer-name) (let* ((msg (mu4e-message-at-point)) (html (mu4e-message-field msg :body-html)) (file (concat "/tmp/" (mu4e-message-field msg :message-id)))) (cl-flet* ((mails2str (l) (mapconcat (lambda (m) (format "%S &lt;%s&gt;" ... ...)) l ", ")) (field2str (f) (format "%s: %s<br>\n" (capitalize (substring ... 1)) (funcall (cdr f) (mu4e-message-field msg ...))))) (with-temp-buffer (save-excursion (insert html)) (save-excursion (when (re-search-forward "^<html\\(.*?\\)>" nil t) (delete-region (point-min) (match-beginning 0)))) (when (re-search-forward "<body\\(.*?\\)>" nil t) (goto-char (match-end 0)) (insert "<div align=\"left\">\n" (mapconcat #'field2str '... "") "</div>\n<hr>\n")) (write-file file)) (list file))))
  (with-current-buffer mu4e~view-buffer-name (let* ((msg (mu4e-message-at-point)) (html (mu4e-message-field msg :body-html)) (file (concat "/tmp/" (mu4e-message-field msg :message-id)))) (cl-flet* ((mails2str (l) (mapconcat (lambda (m) (format "%S &lt;%s&gt;" ... ...)) l ", ")) (field2str (f) (format "%s: %s<br>\n" (capitalize (substring ... 1)) (funcall (cdr f) (mu4e-message-field msg ...))))) (with-temp-buffer (save-excursion (insert html)) (save-excursion (when (re-search-forward "^<html\\(.*?\\)>" nil t) (delete-region (point-min) (match-beginning 0)))) (when (re-search-forward "<body\\(.*?\\)>" nil t) (goto-char (match-end 0)) (insert "<div align=\"left\">\n" (mapconcat #'field2str '... "") "</div>\n<hr>\n")) (write-file file)) (list file))))
  org-msg-save-article-for-reply-mu4e()
  apply(org-msg-save-article-for-reply-mu4e nil)

@jeremy-compostella
Copy link
Owner

I pushed a new patch on the experimental branch which I believe should take care of this.

@jeremy-compostella
Copy link
Owner

Could you give a try to the new experimental branch and tell me if it works fine for you ?
I would like to push the experimental as the new master branch today.

@titaniumbones
Copy link
Contributor Author

I think this issue is now fixed for me! I just did a very simple test though, with one messgee. #12 is of course still an issue but I don't see how to fix that ATM. thank you @jeremy-compostella !

I'll let you close in the merge message maybe, but I believe I no longer have an isuse.

@jeremy-compostella
Copy link
Owner

Feel free to open a new one if you see an issue like again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants