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-save-article-for-reply-mu4e not working in mu4e 1.4.3 #46

Closed
jsravn opened this issue May 9, 2020 · 8 comments · Fixed by #47
Closed

org-msg-save-article-for-reply-mu4e not working in mu4e 1.4.3 #46

jsravn opened this issue May 9, 2020 · 8 comments · Fixed by #47

Comments

@jsravn
Copy link
Contributor

jsravn commented May 9, 2020

The temp file this function saves seems broken - it breaks when Emacs tries to open it with complaints about characters it couldn't encode. I put details here: #37 (comment).

Experimenting with it, removing

(quoted-printable-decode-region (point-min) (point-max)))
seems to fix it and I can reply to html emails without a problem.

There seems to be a built in function in mu4e to do this already which org-msg should probably use instead: https://github.com/djcb/mu/blob/05dc6333c38905ce2d1411f06004f7c050532afe/mu4e/mu4e-actions.el#L98

@jeremy-compostella
Copy link
Owner

jeremy-compostella commented May 9, 2020 via email

@jeremy-compostella
Copy link
Owner

Have you got a chance to give a try to mu4e~write-body-to-html ?

@jsravn
Copy link
Contributor Author

jsravn commented May 12, 2020

@jeremy-compostella I tried, however it breaks in org-msg-improve-reply-header and org-msg-html-buffer-to-xml that parses the html. I'm guessing these functions will need to be adjusted.

@jeremy-compostella
Copy link
Owner

Could you share with me an example HTML file that fails in org-msg-improve-reply-header and org-msg-html-buffer-to-xml ?

@jsravn
Copy link
Contributor Author

jsravn commented May 13, 2020

Could you share with me an example HTML file that fails in org-msg-improve-reply-header and org-msg-html-buffer-to-xml ?

Here's the error

Debugger entered--Lisp error: (wrong-type-argument consp nil)
  org-msg-improve-reply-header((html nil (head nil (meta ((charset . "UTF-8")))) (body nil (p nil (strong nil "From") ": GitHub <noreply@github.com>" (strong nil "To") ": jsravn-test <james+test@r-vn.org>" (strong nil "Date") ": Thu 07 May 2020 11:54:22 BST" (strong nil "Subject") ": [GitHub] Welcome to GitHub, @jsravn-...") "\15\n\15\n  \15\n    " (meta ((http-equiv . "content-type") (content . "text/html; charset=utf-8"))) (title nil "Welcome to GitHub!") (style ((type . "text/css")) "\15\n\11\11#outlook a{\15\n\11\11\11padding:0;\15\n\11\11}\15\n\11...") (table ((class . "body") (style . "border-spacing:0;border-collapse:colla...")) (tr (...) (td ... "\15\n          " ... "\15\n        ") "\15\n      ")) (comment nil "/.body"))) ((del nil ((font-family . "\"Arial\"") (font-size . "10pt") (color . "grey") (border-left . "none") (text-decoration . "line-through") (margin-bottom . "0px") (margin-top . "10px") (line-height . "11pt"))) (a nil ((color . "#0071c5"))) (a reply-header ((color . "black") (text-decoration . "none"))) (div reply-header ((padding . "3.0pt 0in 0in 0in") (border-top . "solid #e1e1e1 1.0pt") (margin-bottom . "20px"))) (span underline ((text-decoration . "underline"))) (li nil ((font-family . "\"Arial\"") (font-size . "10pt") (line-height . "10pt") (margin-bottom . "0px") (margin-top . "2px"))) (nil org-ul ((list-style-type . "square"))) (nil org-ol ((font-family . "\"Arial\"") (font-size . "10pt") (line-height . "10pt") (margin-bottom . "0px") (margin-top . "0px") (margin-left . "30px") (padding-top . "0px") (padding-left . "5px"))) (nil signature ((font-family . "\"Arial\"") (font-size . "10pt") (margin-bottom . "20px"))) (blockquote nil ((padding-left . "5px") (margin-left . "10px") (margin-top . "20px") (margin-bottom . "0") (border-left . "3px solid #ccc") (font-style . "italic") (background . "#f9f9f9"))) (code nil ((font-size . "10pt") (font-family . "monospace") (background . "#f9f9f9"))) (code src\ src-asl ((color . "#bbc2cf") (background-color . "#21242b"))) (code src\ src-c ((color . "#bbc2cf") (background-color . "#21242b"))) (code src\ src-c++ ((color . "#bbc2cf") (background-color . "#21242b"))) (code src\ src-conf ((color . "#bbc2cf") (background-color . "#21242b"))) (code src\ src-cpp ((color . "#bbc2cf") (background-color . "#21242b"))) (code src\ src-csv ((color . "#bbc2cf") (background-color . "#21242b"))) (code src\ src-diff ((color . "#bbc2cf") (background-color . "#21242b"))) (code src\ src-ditaa ((color . "#bbc2cf") (background-color . "#21242b"))) (code src\ src-emacs-lisp ((color . "#bbc2cf") (background-color . "#21242b"))) (code src\ src-fundamental ((color . "#bbc2cf") (background-color . "#21242b"))) (code src\ src-ini ((color . "#bbc2cf") (background-color . "#21242b"))) (code src\ src-json ((color . "#bbc2cf") (background-color . "#21242b"))) (code src\ src-makefile ((color . "#bbc2cf") (background-color . "#21242b"))) (code src\ src-man ((color . "#bbc2cf") (background-color . "#21242b"))) (code src\ src-org ((color . "#bbc2cf") (background-color . "#21242b"))) (code src\ src-plantuml ((color . "#bbc2cf") (background-color . "#21242b"))) (code src\ src-python ((color . "#bbc2cf") (background-color . "#21242b"))) (code src\ src-sh ((color . "#bbc2cf") (background-color . "#21242b"))) (code src\ src-xml ((color . "#bbc2cf") (background-color . "#21242b"))) (nil linenr ((padding-right . "1em") (color . "black") (background-color . "#aaaaaa"))) (pre nil ((line-height . "12pt") (color . "#bbc2cf") (background-color . "#21242b") (margin . "0px") (font-size . "9pt") (font-family . "monospace"))) (div org-src-container ((margin-top . "10px"))) (nil figure-number ((font-family . "\"Arial\"") (font-size . "10pt") (color . "#0071c5") (font-weight . "bold") (text-align . "left"))) (nil table-number) (caption nil ((text-align . "left") (background . "#0071c5") (color . "white") (font-weight . "bold"))) (nil t-above ((caption-side . "top"))) (nil t-bottom ((caption-side . "bottom"))) ...))
  org-msg-build()
  org-msg-prepare-to-send()
  run-hooks(message-send-hook)
  message-send(nil)
  message-send-and-exit()
  org-msg-ctrl-c-ctrl-c()
  run-hook-with-args-until-success(org-msg-ctrl-c-ctrl-c)
  org-ctrl-c-ctrl-c(nil)
  funcall-interactively(org-ctrl-c-ctrl-c nil)
  call-interactively(org-ctrl-c-ctrl-c nil nil)
  command-execute(org-ctrl-c-ctrl-c)

And example HTML written with mu4e~write-body-to-html: https://gist.github.com/jsravn/b4c07878de8cc85a1172bbae052e1121.

The built in mu4e function is actually working pretty well apart from this I think. We should probably just skip the improve reply header for mu4e - the mu4e one looks pretty good already.

@jsravn
Copy link
Contributor Author

jsravn commented May 13, 2020

Hmm, maybe not - disabling org-msg-improve-reply-header produces (with my reply here at the top):

image

@jeremy-compostella
Copy link
Owner

Hmm it looks like I closed by mistake as I still have this item in my TODO list => re-opening.

@jeremy-compostella
Copy link
Owner

The first problem is that the mu4e~write-body-to-html creates an invalid HTML file with data preceding the root html tag. So I would suggest to make this function create a valid HTML file first.

<head><meta charset="UTF-8"></head>
<p><strong>From</strong>: GitHub &lt;noreply@github.com&gt;</br><strong>To</strong>: jsravn-test &lt;james+test@r-vn.org&gt;</br><strong>Date</strong>: Thu 07 May 2020 11:54:22 BST</br><strong>Subject</strong>: [GitHub] Welcome to GitHub, @jsravn-test!</p><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">

Once this is done, then the fix would be to look for what has been added and put it a div section.

Regards,
Jeremy

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

Successfully merging a pull request may close this issue.

2 participants