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

let*: Wrong type argument: consp, nil (cannot send or preview) #81

Closed
morganwillcock opened this issue Jan 8, 2021 · 10 comments
Closed

Comments

@morganwillcock
Copy link

I have one particular mail which seems to trigger this issue, I guess it is something specific to the HTML content.

If you could take a look, what would be the best way to send a copy of it?
it is probably best that I don't make the content public, just to be on the safe side.

@jeremy-compostella
Copy link
Owner

jeremy-compostella commented Jan 9, 2021 via email

@morganwillcock
Copy link
Author

I've re-sent it to you, the subject contains the text "European Free Trade Association".
I imagine GMail will flag it as spam.

@jeremy-compostella
Copy link
Owner

jeremy-compostella commented Jan 9, 2021 via email

@jeremy-compostella
Copy link
Owner

jeremy-compostella commented Jan 9, 2021 via email

@morganwillcock
Copy link
Author

The reply buffer seems to work with no issues. It only happens when attempting to preview or trying to send the reply. I've included the backtraces below.

When previewing:

Debugger entered--Lisp error: (wrong-type-argument consp nil)
  setcar(nil nil)
  (let* ((v div)) (setcar (cdr v) (assq-delete-all 'style (car (cdr div)))))
  (progn (assq-delete-all 'hr (assq 'body xml)) (assq-delete-all 'align (car (cdr div))) (let* ((v div)) (setcar (cdr v) (assq-delete-all 'style (car (cdr div))))) (let ((div-style (org-msg-build-style 'div org-msg-reply-header-class css)) (p-style (org-msg-build-style 'p org-msg-reply-header-class css))) (if div-style (progn (let* ((v (cons ... div-style)) (v div)) (setcar (cdr v) (cons v (car ...)))))) (if p-style (progn (let* ((v div)) (setcdr (cdr v) (list (cons ... ...))))))))
  (if css (progn (assq-delete-all 'hr (assq 'body xml)) (assq-delete-all 'align (car (cdr div))) (let* ((v div)) (setcar (cdr v) (assq-delete-all 'style (car (cdr div))))) (let ((div-style (org-msg-build-style 'div org-msg-reply-header-class css)) (p-style (org-msg-build-style 'p org-msg-reply-header-class css))) (if div-style (progn (let* ((v ...) (v div)) (setcar (cdr v) (cons v ...))))) (if p-style (progn (let* ((v div)) (setcdr (cdr v) (list ...))))))))
  (let ((div (assq 'div (assq 'body xml)))) (let ((e (cdr div))) (while e (if (and (stringp (car e)) (eq (car (car ...)) 'br) (and (stringp (car ...)) (string-prefix-p "\n " (car ...)))) (progn (setcar e (replace-regexp-in-string "\n +" " " (concat ... ...))) (setcdr e (cdr (cdr ...)))) (setq e (cdr e))))) (let ((e (cdr div))) (while e (if (stringp (car (cdr e))) (progn (let ((prefix ...)) (setcar (cdr e) (replace-regexp-in-string prefix "" ...)) (setcdr e (cons ... ...)) (setq e (cdr e))))) (let ((temp e)) (setq e (cdr temp))))) (let ((e (cdr div))) (while e (if (stringp (car (cdr e))) (progn (let ((mailto ...)) (if mailto (progn ... ...))))) (let ((temp e)) (setq e (cdr temp))))) (if css (progn (assq-delete-all 'hr (assq 'body xml)) (assq-delete-all 'align (car (cdr div))) (let* ((v div)) (setcar (cdr v) (assq-delete-all 'style (car (cdr div))))) (let ((div-style (org-msg-build-style 'div org-msg-reply-header-class css)) (p-style (org-msg-build-style 'p org-msg-reply-header-class css))) (if div-style (progn (let* (... ...) (setcar ... ...)))) (if p-style (progn (let* (...) (setcdr ... ...))))))))
  org-msg-improve-reply-header((top nil (comment nil " Inliner Build Version 438...") (html (... ... ...) (head nil ... ... ...) (body ... "\n    " ... "\n" ... ... ... ...)) (comment nil " cV: FcpQMbfGFUOtb/al.4.1....")) ((del nil (... ... ... ... ... ... ... ...)) (a nil (...)) (a reply-header (... ...)) (div reply-header (... ... ...)) (span underline (...)) (li nil (... ... ... ... ...)) (nil org-ul (...)) (nil org-ol (... ... ... ... ... ... ... ...)) (nil signature (... ... ...)) (blockquote nil (... ... ... ... ... ... ...)) (div quote0 (... ... ... ... ... ... ...)) (div quote1 (... ... ... ... ... ... ... ...)) (div quote2 (... ... ... ... ... ... ... ...)) (div quote3 (... ... ... ... ... ... ... ...)) (div quote4 (... ... ... ... ... ... ... ...)) (div quote5 (... ... ... ... ... ... ... ...)) (div quote6 (... ... ... ... ... ... ... ...)) (div quote7 (... ... ... ... ... ... ... ...)) (div quote8 (... ... ... ... ... ... ... ...)) (div quote9 (... ... ... ... ... ... ... ...)) (div quote10 (... ... ... ... ... ... ... ...)) (div quote11 (... ... ... ... ... ... ... ...)) (div quote12 (... ... ... ... ... ... ... ...)) (code nil (... ... ...)) (code src\ src-asl (... ...)) (code src\ src-c (... ...)) ...))
  (if (not original) (assq-delete-all 'script (assq 'head reply)) (org-msg-improve-reply-header original css) (let* ((v (or (assq 'article (assq 'body reply)) (assq 'div (assq 'body reply)))) (v (assq 'body original))) (setcdr (cdr v) (cons v (cdr (cdr v))))))
  (let* ((reply (org-msg-org-to-xml org default-directory)) (temp-files (org-msg-get-prop "reply-to")) (original (if temp-files (progn (org-msg-load-html-file (car temp-files)))))) (assq-delete-all 'h1 (assq 'div (assq 'body reply))) (org-msg-xml-walk (assq 'body reply) --cl-fix-img-src--) (if css (progn (assq-delete-all 'style (assq 'head reply)) (org-msg-xml-walk (assq 'body reply) --cl-enforce--))) (if (not original) (assq-delete-all 'script (assq 'head reply)) (org-msg-improve-reply-header original css) (let* ((v (or (assq 'article (assq ... reply)) (assq 'div (assq ... reply)))) (v (assq 'body original))) (setcdr (cdr v) (cons v (cdr (cdr v)))))) (if original (progn (org-msg-xml-walk original --cl-set-charset--))) (or original reply))
  (progn (let* ((reply (org-msg-org-to-xml org default-directory)) (temp-files (org-msg-get-prop "reply-to")) (original (if temp-files (progn (org-msg-load-html-file (car temp-files)))))) (assq-delete-all 'h1 (assq 'div (assq 'body reply))) (org-msg-xml-walk (assq 'body reply) --cl-fix-img-src--) (if css (progn (assq-delete-all 'style (assq 'head reply)) (org-msg-xml-walk (assq 'body reply) --cl-enforce--))) (if (not original) (assq-delete-all 'script (assq 'head reply)) (org-msg-improve-reply-header original css) (let* ((v (or (assq ... ...) (assq ... ...))) (v (assq 'body original))) (setcdr (cdr v) (cons v (cdr (cdr v)))))) (if original (progn (org-msg-xml-walk original --cl-set-charset--))) (or original reply)))
  (let* ((--cl-enforce-- #'(lambda (xml) (let* ((tag ...) (tmp ...) (class ...) (style ...)) (if style (progn ... ... ...))))) (--cl-fix-img-src-- #'(lambda (xml) (let ((src ...)) (if (string-prefix-p "file://" ...) (progn ...))))) (--cl-set-charset-- #'(lambda (xml) (if (eq 'meta (car xml)) (progn (let ... ...)))))) (progn (let* ((reply (org-msg-org-to-xml org default-directory)) (temp-files (org-msg-get-prop "reply-to")) (original (if temp-files (progn (org-msg-load-html-file ...))))) (assq-delete-all 'h1 (assq 'div (assq 'body reply))) (org-msg-xml-walk (assq 'body reply) --cl-fix-img-src--) (if css (progn (assq-delete-all 'style (assq 'head reply)) (org-msg-xml-walk (assq 'body reply) --cl-enforce--))) (if (not original) (assq-delete-all 'script (assq 'head reply)) (org-msg-improve-reply-header original css) (let* ((v (or ... ...)) (v (assq ... original))) (setcdr (cdr v) (cons v (cdr ...))))) (if original (progn (org-msg-xml-walk original --cl-set-charset--))) (or original reply))))
  (let ((css (org-msg-load-css))) (let* ((--cl-enforce-- #'(lambda (xml) (let* (... ... ... ...) (if style ...)))) (--cl-fix-img-src-- #'(lambda (xml) (let (...) (if ... ...)))) (--cl-set-charset-- #'(lambda (xml) (if (eq ... ...) (progn ...))))) (progn (let* ((reply (org-msg-org-to-xml org default-directory)) (temp-files (org-msg-get-prop "reply-to")) (original (if temp-files (progn ...)))) (assq-delete-all 'h1 (assq 'div (assq 'body reply))) (org-msg-xml-walk (assq 'body reply) --cl-fix-img-src--) (if css (progn (assq-delete-all 'style (assq ... reply)) (org-msg-xml-walk (assq ... reply) --cl-enforce--))) (if (not original) (assq-delete-all 'script (assq 'head reply)) (org-msg-improve-reply-header original css) (let* ((v ...) (v ...)) (setcdr (cdr v) (cons v ...)))) (if original (progn (org-msg-xml-walk original --cl-set-charset--))) (or original reply)))))
  org-msg-build(#("#+OPTIONS: html-postamble:nil H:5 num:nil ^:{} toc..." 0 86 (face org-meta-line font-lock-fontified t fontified t) 86 87 (fontified t) 87 110 (face org-meta-line font-lock-fontified t fontified t) 110 111 (fontified t) 111 123 (font-lock-fontified t face org-drawer fontified t) 123 124 (fontified t) 124 134 (face org-special-keyword fontified t) 134 135 (fontified t) 135 158 (face org-property-value fontified t) 158 159 (fontified t) 159 171 (face org-special-keyword fontified t) 171 172 (fontified t) 172 175 (face org-property-value fontified t) 175 176 (fontified t) 176 190 (face org-special-keyword fontified t) 190 191 (fontified t) ...))
  (let ((browse-url-browser-function (if arg 'xwidget-webkit-browse-url browse-url-browser-function)) (tmp-file (make-temp-file "org-msg" nil ".html")) (mail (org-msg-build (buffer-substring (org-msg-start) (org-msg-end))))) (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert (org-msg-xml-to-str mail)) (write-file tmp-file)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (browse-url (concat "file://" tmp-file)))
  (progn (let ((browse-url-browser-function (if arg 'xwidget-webkit-browse-url browse-url-browser-function)) (tmp-file (make-temp-file "org-msg" nil ".html")) (mail (org-msg-build (buffer-substring (org-msg-start) (org-msg-end))))) (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert (org-msg-xml-to-str mail)) (write-file tmp-file)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (browse-url (concat "file://" tmp-file))))
  (unwind-protect (progn (let ((browse-url-browser-function (if arg 'xwidget-webkit-browse-url browse-url-browser-function)) (tmp-file (make-temp-file "org-msg" nil ".html")) (mail (org-msg-build (buffer-substring (org-msg-start) (org-msg-end))))) (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert ...) (write-file tmp-file)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (browse-url (concat "file://" tmp-file)))) (set-window-configuration wconfig))
  (let ((wconfig (current-window-configuration))) (unwind-protect (progn (let ((browse-url-browser-function (if arg 'xwidget-webkit-browse-url browse-url-browser-function)) (tmp-file (make-temp-file "org-msg" nil ".html")) (mail (org-msg-build (buffer-substring ... ...)))) (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn ... ...) (and ... ...)))) (browse-url (concat "file://" tmp-file)))) (set-window-configuration wconfig)))
  org-msg-preview(nil)
  funcall-interactively(org-msg-preview nil)
  call-interactively(org-msg-preview nil nil)
  command-execute(org-msg-preview)

When sending:

Debugger entered--Lisp error: (wrong-type-argument consp nil)
  setcar(nil nil)
  (let* ((v div)) (setcar (cdr v) (assq-delete-all 'style (car (cdr div)))))
  (progn (assq-delete-all 'hr (assq 'body xml)) (assq-delete-all 'align (car (cdr div))) (let* ((v div)) (setcar (cdr v) (assq-delete-all 'style (car (cdr div))))) (let ((div-style (org-msg-build-style 'div org-msg-reply-header-class css)) (p-style (org-msg-build-style 'p org-msg-reply-header-class css))) (if div-style (progn (let* ((v (cons ... div-style)) (v div)) (setcar (cdr v) (cons v (car ...)))))) (if p-style (progn (let* ((v div)) (setcdr (cdr v) (list (cons ... ...))))))))
  (if css (progn (assq-delete-all 'hr (assq 'body xml)) (assq-delete-all 'align (car (cdr div))) (let* ((v div)) (setcar (cdr v) (assq-delete-all 'style (car (cdr div))))) (let ((div-style (org-msg-build-style 'div org-msg-reply-header-class css)) (p-style (org-msg-build-style 'p org-msg-reply-header-class css))) (if div-style (progn (let* ((v ...) (v div)) (setcar (cdr v) (cons v ...))))) (if p-style (progn (let* ((v div)) (setcdr (cdr v) (list ...))))))))
  (let ((div (assq 'div (assq 'body xml)))) (let ((e (cdr div))) (while e (if (and (stringp (car e)) (eq (car (car ...)) 'br) (and (stringp (car ...)) (string-prefix-p "\n " (car ...)))) (progn (setcar e (replace-regexp-in-string "\n +" " " (concat ... ...))) (setcdr e (cdr (cdr ...)))) (setq e (cdr e))))) (let ((e (cdr div))) (while e (if (stringp (car (cdr e))) (progn (let ((prefix ...)) (setcar (cdr e) (replace-regexp-in-string prefix "" ...)) (setcdr e (cons ... ...)) (setq e (cdr e))))) (let ((temp e)) (setq e (cdr temp))))) (let ((e (cdr div))) (while e (if (stringp (car (cdr e))) (progn (let ((mailto ...)) (if mailto (progn ... ...))))) (let ((temp e)) (setq e (cdr temp))))) (if css (progn (assq-delete-all 'hr (assq 'body xml)) (assq-delete-all 'align (car (cdr div))) (let* ((v div)) (setcar (cdr v) (assq-delete-all 'style (car (cdr div))))) (let ((div-style (org-msg-build-style 'div org-msg-reply-header-class css)) (p-style (org-msg-build-style 'p org-msg-reply-header-class css))) (if div-style (progn (let* (... ...) (setcar ... ...)))) (if p-style (progn (let* (...) (setcdr ... ...))))))))
  org-msg-improve-reply-header((top nil (comment nil " Inliner Build Version 438...") (html (... ... ...) (head nil ... ... ...) (body ... "\n    " ... "\n" ... ... ... ...)) (comment nil " cV: FcpQMbfGFUOtb/al.4.1....")) ((del nil (... ... ... ... ... ... ... ...)) (a nil (...)) (a reply-header (... ...)) (div reply-header (... ... ...)) (span underline (...)) (li nil (... ... ... ... ...)) (nil org-ul (...)) (nil org-ol (... ... ... ... ... ... ... ...)) (nil signature (... ... ...)) (blockquote nil (... ... ... ... ... ... ...)) (div quote0 (... ... ... ... ... ... ...)) (div quote1 (... ... ... ... ... ... ... ...)) (div quote2 (... ... ... ... ... ... ... ...)) (div quote3 (... ... ... ... ... ... ... ...)) (div quote4 (... ... ... ... ... ... ... ...)) (div quote5 (... ... ... ... ... ... ... ...)) (div quote6 (... ... ... ... ... ... ... ...)) (div quote7 (... ... ... ... ... ... ... ...)) (div quote8 (... ... ... ... ... ... ... ...)) (div quote9 (... ... ... ... ... ... ... ...)) (div quote10 (... ... ... ... ... ... ... ...)) (div quote11 (... ... ... ... ... ... ... ...)) (div quote12 (... ... ... ... ... ... ... ...)) (code nil (... ... ...)) (code src\ src-asl (... ...)) (code src\ src-c (... ...)) ...))
  (if (not original) (assq-delete-all 'script (assq 'head reply)) (org-msg-improve-reply-header original css) (let* ((v (or (assq 'article (assq 'body reply)) (assq 'div (assq 'body reply)))) (v (assq 'body original))) (setcdr (cdr v) (cons v (cdr (cdr v))))))
  (let* ((reply (org-msg-org-to-xml org default-directory)) (temp-files (org-msg-get-prop "reply-to")) (original (if temp-files (progn (org-msg-load-html-file (car temp-files)))))) (assq-delete-all 'h1 (assq 'div (assq 'body reply))) (org-msg-xml-walk (assq 'body reply) --cl-fix-img-src--) (if css (progn (assq-delete-all 'style (assq 'head reply)) (org-msg-xml-walk (assq 'body reply) --cl-enforce--))) (if (not original) (assq-delete-all 'script (assq 'head reply)) (org-msg-improve-reply-header original css) (let* ((v (or (assq 'article (assq ... reply)) (assq 'div (assq ... reply)))) (v (assq 'body original))) (setcdr (cdr v) (cons v (cdr (cdr v)))))) (if original (progn (org-msg-xml-walk original --cl-set-charset--))) (or original reply))
  (progn (let* ((reply (org-msg-org-to-xml org default-directory)) (temp-files (org-msg-get-prop "reply-to")) (original (if temp-files (progn (org-msg-load-html-file (car temp-files)))))) (assq-delete-all 'h1 (assq 'div (assq 'body reply))) (org-msg-xml-walk (assq 'body reply) --cl-fix-img-src--) (if css (progn (assq-delete-all 'style (assq 'head reply)) (org-msg-xml-walk (assq 'body reply) --cl-enforce--))) (if (not original) (assq-delete-all 'script (assq 'head reply)) (org-msg-improve-reply-header original css) (let* ((v (or (assq ... ...) (assq ... ...))) (v (assq 'body original))) (setcdr (cdr v) (cons v (cdr (cdr v)))))) (if original (progn (org-msg-xml-walk original --cl-set-charset--))) (or original reply)))
  (let* ((--cl-enforce-- #'(lambda (xml) (let* ((tag ...) (tmp ...) (class ...) (style ...)) (if style (progn ... ... ...))))) (--cl-fix-img-src-- #'(lambda (xml) (let ((src ...)) (if (string-prefix-p "file://" ...) (progn ...))))) (--cl-set-charset-- #'(lambda (xml) (if (eq 'meta (car xml)) (progn (let ... ...)))))) (progn (let* ((reply (org-msg-org-to-xml org default-directory)) (temp-files (org-msg-get-prop "reply-to")) (original (if temp-files (progn (org-msg-load-html-file ...))))) (assq-delete-all 'h1 (assq 'div (assq 'body reply))) (org-msg-xml-walk (assq 'body reply) --cl-fix-img-src--) (if css (progn (assq-delete-all 'style (assq 'head reply)) (org-msg-xml-walk (assq 'body reply) --cl-enforce--))) (if (not original) (assq-delete-all 'script (assq 'head reply)) (org-msg-improve-reply-header original css) (let* ((v (or ... ...)) (v (assq ... original))) (setcdr (cdr v) (cons v (cdr ...))))) (if original (progn (org-msg-xml-walk original --cl-set-charset--))) (or original reply))))
  (let ((css (org-msg-load-css))) (let* ((--cl-enforce-- #'(lambda (xml) (let* (... ... ... ...) (if style ...)))) (--cl-fix-img-src-- #'(lambda (xml) (let (...) (if ... ...)))) (--cl-set-charset-- #'(lambda (xml) (if (eq ... ...) (progn ...))))) (progn (let* ((reply (org-msg-org-to-xml org default-directory)) (temp-files (org-msg-get-prop "reply-to")) (original (if temp-files (progn ...)))) (assq-delete-all 'h1 (assq 'div (assq 'body reply))) (org-msg-xml-walk (assq 'body reply) --cl-fix-img-src--) (if css (progn (assq-delete-all 'style (assq ... reply)) (org-msg-xml-walk (assq ... reply) --cl-enforce--))) (if (not original) (assq-delete-all 'script (assq 'head reply)) (org-msg-improve-reply-header original css) (let* ((v ...) (v ...)) (setcdr (cdr v) (cons v ...)))) (if original (progn (org-msg-xml-walk original --cl-set-charset--))) (or original reply)))))
  org-msg-build(#("#+OPTIONS: html-postamble:nil H:5 num:nil ^:{} toc..." 0 86 (read-only nil face org-meta-line font-lock-fontified t fontified nil) 86 87 (read-only nil fontified nil) 87 110 (read-only nil face org-meta-line font-lock-fontified t fontified nil) 110 111 (read-only nil fontified nil) 111 123 (read-only nil font-lock-fontified t face org-drawer fontified nil) 123 124 (read-only nil fontified nil) 124 134 (read-only nil face org-special-keyword fontified nil) 134 135 (read-only nil fontified nil) 135 158 (read-only nil face org-property-value fontified nil) 158 159 (read-only nil fontified nil) 159 171 (read-only nil face org-special-keyword fontified nil) 171 172 (read-only nil fontified nil) 172 175 (read-only nil face org-property-value fontified nil) 175 176 (read-only nil fontified nil) 176 190 (read-only nil face org-special-keyword fontified nil) 190 191 (read-only nil fontified nil) ...))
  (org-msg-xml-to-str (org-msg-build str))
  org-msg-export-as-html(#("#+OPTIONS: html-postamble:nil H:5 num:nil ^:{} toc..." 0 86 (read-only nil face org-meta-line font-lock-fontified t fontified nil) 86 87 (read-only nil fontified nil) 87 110 (read-only nil face org-meta-line font-lock-fontified t fontified nil) 110 111 (read-only nil fontified nil) 111 123 (read-only nil font-lock-fontified t face org-drawer fontified nil) 123 124 (read-only nil fontified nil) 124 134 (read-only nil face org-special-keyword fontified nil) 134 135 (read-only nil fontified nil) 135 158 (read-only nil face org-property-value fontified nil) 158 159 (read-only nil fontified nil) 159 171 (read-only nil face org-special-keyword fontified nil) 171 172 (read-only nil fontified nil) 172 175 (read-only nil face org-property-value fontified nil) 175 176 (read-only nil fontified nil) 176 190 (read-only nil face org-special-keyword fontified nil) 190 191 (read-only nil fontified nil) ...))
  funcall(org-msg-export-as-html #("#+OPTIONS: html-postamble:nil H:5 num:nil ^:{} toc..." 0 86 (read-only nil face org-meta-line font-lock-fontified t fontified nil) 86 87 (read-only nil fontified nil) 87 110 (read-only nil face org-meta-line font-lock-fontified t fontified nil) 110 111 (read-only nil fontified nil) 111 123 (read-only nil font-lock-fontified t face org-drawer fontified nil) 123 124 (read-only nil fontified nil) 124 134 (read-only nil face org-special-keyword fontified nil) 134 135 (read-only nil fontified nil) 135 158 (read-only nil face org-property-value fontified nil) 158 159 (read-only nil fontified nil) 159 171 (read-only nil face org-special-keyword fontified nil) 171 172 (read-only nil fontified nil) 172 175 (read-only nil face org-property-value fontified nil) 175 176 (read-only nil fontified nil) 176 190 (read-only nil face org-special-keyword fontified nil) 190 191 (read-only nil fontified nil) ...))
  (cons (car exporter) (funcall (cdr exporter) str))
  (let ((exporter (cdr (assq alt org-msg-alternative-exporters)))) (cons (car exporter) (funcall (cdr exporter) str)))
  (closure ((str . #("#+OPTIONS: html-postamble:nil H:5 num:nil ^:{} toc..." 0 86 (read-only nil face org-meta-line font-lock-fontified t fontified nil) 86 87 (read-only nil fontified nil) 87 110 (read-only nil face org-meta-line font-lock-fontified t fontified nil) 110 111 (read-only nil fontified nil) 111 123 (read-only nil font-lock-fontified t face org-drawer fontified nil) 123 124 (read-only nil fontified nil) 124 134 (read-only nil face org-special-keyword fontified nil) 134 135 (read-only nil fontified nil) 135 158 (read-only nil face org-property-value fontified nil) 158 159 (read-only nil fontified nil) 159 171 (read-only nil face org-special-keyword fontified nil) 171 172 (read-only nil fontified nil) 172 175 (read-only nil face org-property-value fontified nil) 175 176 (read-only nil fontified nil) 176 190 (read-only nil face org-special-keyword fontified nil) 190 191 (read-only nil fontified nil) ...)) (available text html) (alternatives html text) t) (alt) (let ((exporter (cdr (assq alt org-msg-alternative-exporters)))) (cons (car exporter) (funcall (cdr exporter) str))))(html)
  mapcar((closure ((str . #("#+OPTIONS: html-postamble:nil H:5 num:nil ^:{} toc..." 0 86 (read-only nil face org-meta-line font-lock-fontified t fontified nil) 86 87 (read-only nil fontified nil) 87 110 (read-only nil face org-meta-line font-lock-fontified t fontified nil) 110 111 (read-only nil fontified nil) 111 123 (read-only nil font-lock-fontified t face org-drawer fontified nil) 123 124 (read-only nil fontified nil) 124 134 (read-only nil face org-special-keyword fontified nil) 134 135 (read-only nil fontified nil) 135 158 (read-only nil face org-property-value fontified nil) 158 159 (read-only nil fontified nil) 159 171 (read-only nil face org-special-keyword fontified nil) 171 172 (read-only nil fontified nil) 172 175 (read-only nil face org-property-value fontified nil) 175 176 (read-only nil fontified nil) 176 190 (read-only nil face org-special-keyword fontified nil) 190 191 (read-only nil fontified nil) ...)) (available text html) (alternatives html text) t) (alt) (let ((exporter (cdr (assq alt org-msg-alternative-exporters)))) (cons (car exporter) (funcall (cdr exporter) str)))) (html text))
  (let ((available (mapcar #'car org-msg-alternative-exporters)) (str (buffer-substring (org-msg-start) (org-msg-end)))) (let ((--dolist-tail-- alternatives)) (while --dolist-tail-- (let ((alt (car --dolist-tail--))) (if (member alt available) nil (error "%s is not a valid alternative, must be one of %s" missing available)) (setq --dolist-tail-- (cdr --dolist-tail--))))) (mapcar #'(lambda (alt) (let ((exporter (cdr ...))) (cons (car exporter) (funcall (cdr exporter) str)))) alternatives))
  org-msg-build-alternatives((html text))
  (setq org-msg-alternatives (org-msg-build-alternatives alternatives))
  (let ((alternatives (org-msg-get-prop "alternatives")) (attachments (org-msg-get-prop "attachment"))) (let ((--dolist-tail-- attachments)) (while --dolist-tail-- (let ((file (car --dolist-tail--))) (if (file-exists-p file) nil (error "File '%s' does not exist" file)) (setq --dolist-tail-- (cdr --dolist-tail--))))) (setq org-msg-attachment attachments) (setq org-msg-alternatives (org-msg-build-alternatives alternatives)) (goto-char (org-msg-start)) (delete-region (org-msg-start) (point-max)) (if (or (org-msg-mml-recursive-support) (not (assq 'html org-msg-alternatives))) (progn (if attachments (progn (mml-insert-multipart "mixed"))) (if (> (length org-msg-alternatives) 1) (progn (mml-insert-multipart "alternative"))) (let ((--dolist-tail-- org-msg-alternatives)) (while --dolist-tail-- (let ((alt ...)) (mml-insert-part (car alt)) (insert (cdr alt)) (forward-line) (setq --dolist-tail-- (cdr --dolist-tail--))))) (if (> (length org-msg-alternatives) 1) (progn (forward-line))) (let ((--dolist-tail-- attachments)) (while --dolist-tail-- (let ((file ...)) (mml-insert-tag 'part 'type (org-msg-file-mime-type file) 'filename file 'disposition "attachment") (setq --dolist-tail-- (cdr --dolist-tail--)))))) (mml-insert-part "text/html") (insert (cdr (assoc "text/html" org-msg-alternatives)))) (add-text-properties (save-excursion (message-goto-body)) (point-max) '(mml t)))
  (if (get-text-property (org-msg-start) 'mml) (message "Warning: org-msg: %S is already a MML buffer" (current-buffer)) (let ((alternatives (org-msg-get-prop "alternatives")) (attachments (org-msg-get-prop "attachment"))) (let ((--dolist-tail-- attachments)) (while --dolist-tail-- (let ((file (car --dolist-tail--))) (if (file-exists-p file) nil (error "File '%s' does not exist" file)) (setq --dolist-tail-- (cdr --dolist-tail--))))) (setq org-msg-attachment attachments) (setq org-msg-alternatives (org-msg-build-alternatives alternatives)) (goto-char (org-msg-start)) (delete-region (org-msg-start) (point-max)) (if (or (org-msg-mml-recursive-support) (not (assq 'html org-msg-alternatives))) (progn (if attachments (progn (mml-insert-multipart "mixed"))) (if (> (length org-msg-alternatives) 1) (progn (mml-insert-multipart "alternative"))) (let ((--dolist-tail-- org-msg-alternatives)) (while --dolist-tail-- (let (...) (mml-insert-part ...) (insert ...) (forward-line) (setq --dolist-tail-- ...)))) (if (> (length org-msg-alternatives) 1) (progn (forward-line))) (let ((--dolist-tail-- attachments)) (while --dolist-tail-- (let (...) (mml-insert-tag ... ... ... ... file ... "attachment") (setq --dolist-tail-- ...))))) (mml-insert-part "text/html") (insert (cdr (assoc "text/html" org-msg-alternatives)))) (add-text-properties (save-excursion (message-goto-body)) (point-max) '(mml t))))
  (progn (if (get-text-property (org-msg-start) 'mml) (message "Warning: org-msg: %S is already a MML buffer" (current-buffer)) (let ((alternatives (org-msg-get-prop "alternatives")) (attachments (org-msg-get-prop "attachment"))) (let ((--dolist-tail-- attachments)) (while --dolist-tail-- (let ((file ...)) (if (file-exists-p file) nil (error "File '%s' does not exist" file)) (setq --dolist-tail-- (cdr --dolist-tail--))))) (setq org-msg-attachment attachments) (setq org-msg-alternatives (org-msg-build-alternatives alternatives)) (goto-char (org-msg-start)) (delete-region (org-msg-start) (point-max)) (if (or (org-msg-mml-recursive-support) (not (assq 'html org-msg-alternatives))) (progn (if attachments (progn (mml-insert-multipart "mixed"))) (if (> (length org-msg-alternatives) 1) (progn (mml-insert-multipart "alternative"))) (let ((--dolist-tail-- org-msg-alternatives)) (while --dolist-tail-- (let ... ... ... ... ...))) (if (> (length org-msg-alternatives) 1) (progn (forward-line))) (let ((--dolist-tail-- attachments)) (while --dolist-tail-- (let ... ... ...)))) (mml-insert-part "text/html") (insert (cdr (assoc "text/html" org-msg-alternatives)))) (add-text-properties (save-excursion (message-goto-body)) (point-max) '(mml t)))))
  (if (eq major-mode 'org-msg-edit-mode) (progn (if (get-text-property (org-msg-start) 'mml) (message "Warning: org-msg: %S is already a MML buffer" (current-buffer)) (let ((alternatives (org-msg-get-prop "alternatives")) (attachments (org-msg-get-prop "attachment"))) (let ((--dolist-tail-- attachments)) (while --dolist-tail-- (let (...) (if ... nil ...) (setq --dolist-tail-- ...)))) (setq org-msg-attachment attachments) (setq org-msg-alternatives (org-msg-build-alternatives alternatives)) (goto-char (org-msg-start)) (delete-region (org-msg-start) (point-max)) (if (or (org-msg-mml-recursive-support) (not (assq ... org-msg-alternatives))) (progn (if attachments (progn ...)) (if (> ... 1) (progn ...)) (let (...) (while --dolist-tail-- ...)) (if (> ... 1) (progn ...)) (let (...) (while --dolist-tail-- ...))) (mml-insert-part "text/html") (insert (cdr (assoc "text/html" org-msg-alternatives)))) (add-text-properties (save-excursion (message-goto-body)) (point-max) '(mml t))))))
  (progn (if (eq major-mode 'org-msg-edit-mode) (progn (if (get-text-property (org-msg-start) 'mml) (message "Warning: org-msg: %S is already a MML buffer" (current-buffer)) (let ((alternatives (org-msg-get-prop "alternatives")) (attachments (org-msg-get-prop "attachment"))) (let ((--dolist-tail-- attachments)) (while --dolist-tail-- (let ... ... ...))) (setq org-msg-attachment attachments) (setq org-msg-alternatives (org-msg-build-alternatives alternatives)) (goto-char (org-msg-start)) (delete-region (org-msg-start) (point-max)) (if (or (org-msg-mml-recursive-support) (not ...)) (progn (if attachments ...) (if ... ...) (let ... ...) (if ... ...) (let ... ...)) (mml-insert-part "text/html") (insert (cdr ...))) (add-text-properties (save-excursion (message-goto-body)) (point-max) '(mml t)))))))
  (unwind-protect (progn (if (eq major-mode 'org-msg-edit-mode) (progn (if (get-text-property (org-msg-start) 'mml) (message "Warning: org-msg: %S is already a MML buffer" (current-buffer)) (let ((alternatives ...) (attachments ...)) (let (...) (while --dolist-tail-- ...)) (setq org-msg-attachment attachments) (setq org-msg-alternatives (org-msg-build-alternatives alternatives)) (goto-char (org-msg-start)) (delete-region (org-msg-start) (point-max)) (if (or ... ...) (progn ... ... ... ... ...) (mml-insert-part "text/html") (insert ...)) (add-text-properties (save-excursion ...) (point-max) '...)))))) (set-window-configuration wconfig))
  (let ((wconfig (current-window-configuration))) (unwind-protect (progn (if (eq major-mode 'org-msg-edit-mode) (progn (if (get-text-property (org-msg-start) 'mml) (message "Warning: org-msg: %S is already a MML buffer" (current-buffer)) (let (... ...) (let ... ...) (setq org-msg-attachment attachments) (setq org-msg-alternatives ...) (goto-char ...) (delete-region ... ...) (if ... ... ... ...) (add-text-properties ... ... ...)))))) (set-window-configuration wconfig)))
  org-msg-prepare-to-send()
  run-hooks(message-send-hook)
  message-send(nil)
  message-send-and-exit()
  apply(message-send-and-exit nil)
  (progn (apply default arg))
  (if default (progn (apply default arg)))
  (if (functionp fun) (apply fun arg) (if default (progn (apply default arg))))
  (let ((fun (intern (format "org-msg-%s-%s" sym mua)))) (if (functionp fun) (apply fun arg) (if default (progn (apply default arg)))))
  (if mua (let ((fun (intern (format "org-msg-%s-%s" sym mua)))) (if (functionp fun) (apply fun arg) (if default (progn (apply default arg))))) (error "Backend not found"))
  (let ((mua (assoc-default mail-user-agent org-msg-supported-mua))) (if mua (let ((fun (intern (format "org-msg-%s-%s" sym mua)))) (if (functionp fun) (apply fun arg) (if default (progn (apply default arg))))) (error "Backend not found")))
  org-msg-mua-call(send-and-exit message-send-and-exit)
  (progn (org-msg-mua-call 'send-and-exit 'message-send-and-exit))
  (if (eq major-mode 'org-msg-edit-mode) (progn (org-msg-mua-call 'send-and-exit '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)

jeremy-compostella added a commit that referenced this issue Jan 11, 2021
In some rare cases, the original email contains comments preceding the
html tag. Most of the org-msg functions expects the html tag to be
root the XML tree. This patch strips all the comments before turning
the original email into an XML tree.

This patch addresses #81.

Signed-off-by: Jeremy Compostella <jeremy.compostella@gmail.com>
@jeremy-compostella
Copy link
Owner

I think that the patch I have pushed on the experimental branch should fix this particular issue. Could you give it a try ?

@morganwillcock
Copy link
Author

That change does fix it. Thank you.

jeremy-compostella added a commit that referenced this issue Jan 11, 2021
In some rare cases, the original email contains comments preceding the
html tag. The `org-msg-html-buffer-to-xml' should return a XML tree
which root tag is the HTML tag.

This patch addresses #81.

Signed-off-by: Jeremy Compostella <jeremy.compostella@gmail.com>
@jeremy-compostella
Copy link
Owner

Thanks for testing. I was not very satisfied with my original solution. I find it a little bit too agressive. I made a more subtle fix. Could you verify that it also work for you?

@morganwillcock
Copy link
Author

This change works too.

jeremy-compostella added a commit that referenced this issue Jan 12, 2021
This patch addresses #81.

In some rare cases, the original email contains comments preceding the
html tag. The `org-msg-html-buffer-to-xml' should return a XML tree
which root tag is the HTML tag.

Signed-off-by: Jeremy Compostella <jeremy.compostella@gmail.com>
@jeremy-compostella
Copy link
Owner

fix pushed to master.

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