jeremy-compostella / org-msg

OrgMsg is a GNU/Emacs global minor mode mixing up Org mode and Message mode to compose and reply to emails in a Outlook HTML friendly style.
GNU General Public License v3.0
275 stars 58 forks source link

using unsupported alternative results in lisp error #85

Closed adl closed 3 years ago

adl commented 3 years ago

(I was trying to use the org alternative from the experimental branch, but my org-msg-alternative-exporters was still defined as on the master branch.)

I believe org-msg-build-alternatives uses missing instead of alt.

Debugger entered--Lisp error: (void-variable missing)
  (error "%s is not a valid alternative, must be one of %s" missing available)
  (if (member alt available) nil (error "%s is not a valid alternative, must be one of %s" missing available))
  (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--)))
  (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--))))
  (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--)))))
  (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 org 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()