GithubHelp home page GithubHelp logo

Comments (6)

jeremy-compostella avatar jeremy-compostella commented on August 22, 2024

I am a bit lost here. What is the status of this issue ?

from org-msg.

titaniumbones avatar titaniumbones commented on August 22, 2024

Sorry to leave you hanging. From what I can tell, the status is "still a problem". Calling mu4e-compose-reply from the mu4e mailbox summary buffer (*mu4e-headers*) when *mu4e-view* is not open will cause an error as seen below, because org-msg-article-htmlp-mu4e will try to open and parse an existing *mu4e-view* buffer to test if the message is html. My guess is that there's a lower-level function available somewhere that would allow org-msg to parse the underlying message itself, but I haven't had a chance to look mroe closely at the mu4e code. When I get a change I can try to ask o nthe mu-discuss mailing list, or perhaps there's someone else better positioned to fix this...

Debugger entered--Lisp error: (error "No buffer named *mu4e-view*")
  set-buffer("*mu4e-view*")
  (save-current-buffer (set-buffer mu4e~view-buffer-name) (if (mu4e-message-field-at-point :body-html) (progn t)))
  org-msg-article-htmlp-mu4e()
  apply(org-msg-article-htmlp-mu4e nil)
  (progn (apply fun arg))
  (if (functionp fun) (progn (apply fun arg)))
  (let ((fun (intern (format "org-msg-%s-%s" sym mua)))) (if (functionp fun) (progn (apply fun arg))))
  (if mua (let ((fun (intern (format "org-msg-%s-%s" sym mua)))) (if (functionp fun) (progn (apply fun 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) (progn (apply fun arg)))) (error "Backend not found")))
  org-msg-mua-call(article-htmlp)
  (or new (org-msg-mua-call 'article-htmlp))
  (if (or new (org-msg-mua-call 'article-htmlp)) (progn (if new nil (setq reply-to (org-msg-mua-call 'save-article-for-reply))) (insert (org-msg-header reply-to)) (if org-msg-greeting-fmt (progn (insert (format org-msg-greeting-fmt (if new "" (org-msg-get-to-first-name)))))) (save-excursion (if with-original (progn (save-excursion (insert "\n\n" org-msg-separator "\n") (delete-region (line-beginning-position) (1+ ...)) (save-excursion (while ... ...)) (org-escape-code-in-region (point) (point-max))))) (if org-msg-signature (progn (insert org-msg-signature))) (org-msg-edit-mode))))
  (let ((new (not (and (message-fetch-field "to") (message-fetch-field "subject")))) (with-original (not (= (point) (point-max)))) (reply-to)) (if (or new (org-msg-mua-call 'article-htmlp)) (progn (if new nil (setq reply-to (org-msg-mua-call 'save-article-for-reply))) (insert (org-msg-header reply-to)) (if org-msg-greeting-fmt (progn (insert (format org-msg-greeting-fmt (if new "" ...))))) (save-excursion (if with-original (progn (save-excursion (insert "\n\n" org-msg-separator "\n") (delete-region ... ...) (save-excursion ...) (org-escape-code-in-region ... ...)))) (if org-msg-signature (progn (insert org-msg-signature))) (org-msg-edit-mode)))) (if new (message-goto-to) (org-msg-goto-body)))
  org-msg-post-setup()
  run-hooks(change-major-mode-after-body-hook text-mode-hook message-mode-hook mu4e-compose-mode-hook)
  apply(run-hooks (change-major-mode-after-body-hook text-mode-hook message-mode-hook mu4e-compose-mode-hook))
  run-mode-hooks(mu4e-compose-mode-hook)
  mu4e-compose-mode()
  mu4e~compose-handler(reply (:docid 102611 :subject "Firefox Monitor found your email in a new data bre..." :date (24027 26864 0) :size 27057 :message-id "0101016ea111eb02-4c624c51-ce86-42e2-853b-214d985fd..." :path "/home/matt/UofTMail/inbox/cur/1574686684_1.205752...." :maildir "/inbox" :priority normal :flags (replied seen) :parts ((:index 1 :name "1.msgpart" :mime-type "text/html" :type (leaf) :attachment nil :size 19769)) :from (("Firefox Monitor" . "[email protected]")) :to ((nil . "[email protected]")) :body-html "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Stric...") nil)
  mu4e~proc-filter(#<process  *mu4e-proc*> "rgin: 0px; text-decoration: none; line-height: 1.5...")

from org-msg.

titaniumbones avatar titaniumbones commented on August 22, 2024

Poking around just a little bit, I think that the call to mu4e-message-field-at-point :body-html) would succeed *without* the (set-buffer mu4e~view-buffer-name ...)if it were attached tomu4e-compose-pre-hookinstead ofmu4e-compose-hook`. That is, it would be easy to get access to the info if we could store information in a variable that persists from pre-composition to post-composition. Since the buffer changes across the composition process, I guess the variable couldn't be buffer-local, so potentially you could end up with the wrong message in the compose buffer.

If this method is not practical it might be possible to get the msg object via the msg id, which I think is preserved in the "References" header, but I haven't yet found out how

from org-msg.

guibor avatar guibor commented on August 22, 2024

Not perfect, but this seemed to help

(defun mu4e-headers-compose-reply ()
        (interactive)
        (mu4e-headers-view-message)
        (switch-to-buffer "*mu4e-headers*")
        (mu4e-compose-reply)
        (org-msg-goto-body)
        )

      (defun mu4e-headers-compose-forward ()
        (interactive)
        (mu4e-headers-view-message)
        (switch-to-buffer "*mu4e-headers*")
        (mu4e-compose-forward)        
        )

      (define-key mu4e-headers-mode-map (kbd "R") 'mu4e-headers-compose-reply)
      (define-key mu4e-view-mode-map (kbd "F") 'mu4e-headers-compose-forward)

from org-msg.

jeremy-compostella avatar jeremy-compostella commented on August 22, 2024

The method based on pre-composition hook and composition hook is not very elegant but it should work. Feel free to submit a patch one you have something which work and does not require a hack in mu4e.

from org-msg.

titaniumbones avatar titaniumbones commented on August 22, 2024

Waiting for a response form mu-discuss list to see if I can get access to the msg object through the References header instead -- this seems more sustainable to me. However, at present mu4e filters the mu process output in a way that seems to make it impossible to get the raw object directly.

from org-msg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.