From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: Re: replying to emai with org-mode syntax in mu4e Date: Fri, 18 Nov 2016 00:12:28 -0500 Message-ID: References: <87a8dorq62.fsf@dell-desktop.WORKGROUP> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113ecf9442ea3905418c5ac5 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40778) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c7bTT-0005NT-NN for emacs-orgmode@gnu.org; Fri, 18 Nov 2016 00:12:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c7bTS-0001nX-8k for emacs-orgmode@gnu.org; Fri, 18 Nov 2016 00:12:31 -0500 Received: from mail-it0-x22e.google.com ([2607:f8b0:4001:c0b::22e]:38692) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c7bTS-0001nR-1R for emacs-orgmode@gnu.org; Fri, 18 Nov 2016 00:12:30 -0500 Received: by mail-it0-x22e.google.com with SMTP id j191so13952857ita.1 for ; Thu, 17 Nov 2016 21:12:29 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Org Mode --001a113ecf9442ea3905418c5ac5 Content-Type: text/plain; charset=UTF-8 one last thing: I had some further trouble when I tried to turn on org-mu4e-compose-org-mode as a hook to mu4e-compose-mode. I'm pretty sure there's some kind of a loop related to the funky post-command-hook-setting internal function org~mu4e-mime-switch-headers-or-body. Anyway, turning off hte hook and applying the above hook fixed my issue. Added a couple of keybindings and now everything works! On Thu, Nov 17, 2016 at 8:42 PM, Matt Price wrote: > > > On Thu, Nov 17, 2016 at 1:10 PM, Matt Price wrote: > >> Hey everyone, I am definitely still seeing this problem; I just sent a >> new email to the mu list to see if anyone there has the same issue. Google >> groups link is here: >> https://groups.google.com/forum/#!topic/mu-discuss/Hvl9wzI01DA >> > > In case, at some point, someone else starts seeing the same problem, I > seem to have fixed it. There appears to be some kind of bad chemistry > between recent org-mode, recent mu4e, and message mode. The trick for me > was making sure that org-mu4e-compose-org-mode was switched off before > message-send-and-exit ran: > > (defun htmlize-and-send () > "When in an org-mu4e-compose-org-mode message, htmlize and send it." > (interactive) > (when (member 'org~mu4e-mime-switch-headers-or-body post-command-hook) > (org-mime-htmlize) > (org-mu4e-compose-org-mode) > (message-send-and-exit))) > > The second-to-last line is my only change. > > Matt > > > >> >> if you are able to reproduce or can see immediate errors in my ocnfig I'd >> be grateful to hear about it. >> Thanks! >> >> On Tue, Nov 1, 2016 at 2:13 PM, Matt Price wrote: >> >>> OK, I will try -- doesn't immediatley seem to work but I may have some >>> crud kicking around my config that I need to get rid of. >>> >>> With both your orgmime and the standard library, htmlize-and-send works >>> perfectly well when run from the headers. When run form the message body, >>> sending fails with "Already sent by mail. Resend?" and drops me back into >>> the buffer if I say "n". If I say "y", the send and save both fail. If I >>> say "n", and go bak to the headers & execute C-c, sending now succeeds. >>> >>> No time to track down rihgt now but frustrating for sure!! >>> >>> >>> On Tue, Nov 1, 2016 at 12:17 PM, John Kitchin >>> wrote: >>> >>>> you could try my adapted version here: >>>> https://github.com/jkitchin/scimax/blob/master/org-mime.el >>>> >>>> Matt Price writes: >>>> >>>> > On Mon, Oct 31, 2016 at 1:05 PM, John Kitchin < >>>> jkitchin@andrew.cmu.edu> >>>> > wrote: >>>> > >>>> >> I got that too for a while. Then it seemed to go away. >>>> > >>>> > >>>> > If only I could copy-paste that part of your code ("seemed to go >>>> away...")! >>>> > Is pretty persistent for me. Odldy, the first email I send in a new >>>> emas >>>> > seems to go out fine, and ot save fine in myu sent folder; after that >>>> I get >>>> > that error. Message sends if I hit C-c C-c again from the headers >>>> section >>>> > of the htmlized buffer. So, not a atastrophe, but not especially >>>> > streamlined either. >>>> >>>> >>>> -- >>>> Professor John Kitchin >>>> Doherty Hall A207F >>>> Department of Chemical Engineering >>>> Carnegie Mellon University >>>> Pittsburgh, PA 15213 >>>> 412-268-7803 >>>> @johnkitchin >>>> http://kitchingroup.cheme.cmu.edu >>>> >>> >>> >> > --001a113ecf9442ea3905418c5ac5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
one last thing:

I had some further trou= ble when I tried to turn on=20 org-mu4e-compose-org-mode as a hook to mu4e-compose-mode. I'm pretty=20 sure there's some kind of a loop related to the funky=20 post-command-hook-setting internal function=20 org~mu4e-mime-switch-headers-or-body. Anyway, turning off hte hook and appl= ying the above hook fixed my issue.=C2=A0 Added a couple of keybindings and= now everything works!

On Thu, Nov 17, 2016 at 8:42 PM, Matt Price &= lt;moptop99@gmail.c= om> wrote:


On Thu, Nov 17, 2016 at 1:10 PM, Matt Price <moptop99@gmail.com= > wrote:
Hey ev= eryone, I am definitely still seeing this problem; I=20 just sent a new email to the mu list to see if anyone there has the same issue. Google groups link is here:
https://groups.g= oogle.com/forum/#!topic/mu-discuss/Hvl9wzI01DA

In case, at some point, s= omeone else starts seeing the same problem, I seem to have fixed it.=C2=A0 = There appears to be some kind of bad chemistry between=C2=A0 recent org-mod= e, recent mu4e, and message mode.=C2=A0 The trick for me was making sure th= at org-mu4e-compose-org-mode was switched off before message-send-and-exit = ran:

(defun htmlize-and-send ()
=C2=A0 "When in an org-mu4e-= compose-org-mode message, htmlize and send it."
=C2=A0 (interactive= )
=C2=A0 (when (member 'org~mu4e-mime-switch-headers-or-body po= st-command-hook)
=C2=A0=C2=A0=C2=A0 (org-mime-htmlize)
=C2=A0=C2=A0= =C2=A0 (org-mu4e-compose-org-mode)
=C2=A0=C2=A0=C2=A0 (message-send-and-= exit)))

The second-to-last line is my only change.

Matt
<= div>




if you are able to reproduce or can see immediat= e errors in my ocnfig I'd be grateful to hear about it.=C2=A0
Thanks!

On Tue, Nov 1, 2016 at 2:1= 3 PM, Matt Price <moptop99@gmail.com> wrote:
OK, I will try -- doesn= 9;t immediatley seem to work but I may have some crud kicking around my con= fig that I need to get rid of.

With both your orgmime and the= standard library, htmlize-and-send works perfectly well when run from the = headers. When run form the message body, sending fails with "Already s= ent by mail. Resend?" and drops me back into the buffer if I say "= ;n". If I say "y", the send and save both fail. If I say &qu= ot;n", and go bak to the headers & execute C-c, sending now succee= ds.=C2=A0

No time to track down rihgt now but frustrating for= sure!!


On Tue, Nov = 1, 2016 at 12:17 PM, John Kitchin <jkitchin@andrew.cmu.edu> wrote:
you could= try my adapted version here:
https://github.com/jkitchin/scimax/b= lob/master/org-mime.el

Matt Price writes:

> On Mon, Oct 31, 2016 at 1:05 PM, John Kitchin <jkitchin@andrew.cmu.edu> > wrote:
>
>> I got that too for a while. Then it seemed to go away.
>
>
> If only I could copy-paste that part of your code ("seemed to go = away...")!
> Is pretty persistent for me.=C2=A0 Odldy, the first email I send in a = new emas
> seems to go out fine, and ot save fine in myu sent folder; after that = I get
> that error. Message sends if I hit C-c C-c again from the headers sect= ion
> of the htmlized buffer. So, not a atastrophe, but not especially
> streamlined either.


--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-2= 68-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu




--001a113ecf9442ea3905418c5ac5--