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

make sure org-msg-org-to-xml uses right html buffer #7

Conversation

titaniumbones
Copy link
Contributor

When org-export-show-temporary-export-buffer is nil,
org-msg-org-to-xml would try to parse the org buffer rather than
the html export buffer. This change hopefully fixes that.

Appears to fix #6

When `org-export-show-temporary-export-buffer` is `nil`,
`org-msg-org-to-xml` would try to parse the **org** buffer rather than
the html export buffer.  This change hopefully fixes that.
@titaniumbones
Copy link
Contributor Author

Hmmm, still having trouble getting both the new message text and the citation to appear in the final html document. Maybe don't merge right away.

(let ((xml (org-msg-html-buffer-to-xml base)))
(kill-buffer)
xml))))
(set-buffer (org-html-export-as-html))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the following solution would have less side effect:
(with-current-buffer (org-html-export-as-html)
(....)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, I see that, but for whatever reason I'm not able to fix the issue with that code. Try

(let ((org-export-show-temporary-export-buffer nil))
(org-preview-html nil))

do you find your code works for you?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah shoot, I just saw ur comment in #6... I will keep trying to debug this but for now I have to get a little bit of work done...

@jeremy-compostella
Copy link
Owner

Hmmm, still having trouble getting both the new message text and the citation to appear in the final html document. Maybe don't merge right away.

What do you mean ?

@titaniumbones
Copy link
Contributor Author

well, I can now either generate HTML for an org buffer, or generate HTML representing the original in-repoy-to message. But as soon as I include a reply in the messgae body, the original org text is overwritten. At first Ihtought that was an isus with my hcanges, but I don't think it is.

@jeremy-compostella
Copy link
Owner

Hi Matt,

Yes the following change work for me with the following test

(let ((org-export-show-temporary-export-buffer nil)
      (org-preview-html nil))
  (org-msg-build))

modified   org-msg.el
@@ -558,10 +558,10 @@ absolute paths."
	    (org-html-head-include-scripts nil)
	    (org-html-head-include-default-style nil)
	    (org-msg-export-in-progress t))
-	(org-html-export-as-html))
-      (let ((xml (org-msg-html-buffer-to-xml base)))
-	(kill-buffer)
-	xml))))
+	(with-current-buffer (org-html-export-as-html)
+	  (let ((xml (org-msg-html-buffer-to-xml base)))
+	    (kill-buffer)
+	    xml))))))

 (defun org-msg-load-css ()
   "Load the CSS definition according to `org-msg-enforce-css'."

I can now either generate HTML for an org buffer, or generate HTML representing the original in-reply-to message. But as soon as I include a reply in the messgae body, the original org text is overwritten. At first Ihtought that was an isus with my hcanges, but I don't think it is.

Could you explain the use case here. I am not clear what is the sequence of event you use ? Are you trying to reply to a message. How does the org-msg-edit-mode buffer looks like ? … ?

Regards,

Jeremy
One Emacs to rule them all

@titaniumbones
Copy link
Contributor Author

titaniumbones commented Sep 3, 2019

I can now either generate HTML for an org buffer, or generate HTML representing the original in-reply-to message. But as soon as I include a reply in the messgae body, the original org text is overwritten. At first Ihtought that was an isus with my hcanges, but I don't think it is.

Could you explain the use case here. I am not clear what is the sequence of event you use ? Are you trying to reply to a message. How does the org-msg-edit-mode buffer looks like ? … ?

It's a separate issue -- sorry for confusing the issue. See #8 and #10

Regards,

Jeremy
One Emacs to rule them all

@jeremy-compostella
Copy link
Owner

Could you very that the (with-current-buffer version also work for you ? I would like to push the change.

@titaniumbones
Copy link
Contributor Author

Could you very that the (with-current-buffer version also work for you ? I would like to push the change.

Unfortunately, I cannot make this work for me. is htere a way to safely set-buffer, maybe wrapped in an unwind-protect? I'm not sure why with-current-buffer fails in my set up.

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 this pull request may close these issues.

message content not parsed
2 participants