Re: [O] org-mime-org-buffer-htmlize sending hangs ...

2014-07-22 Thread Alan Schmitt
On 2014-07-21 19:45, Peter Davis p...@pfdstudio.com writes:

 Alas, despite years of emacs abuse, I have not managed to master even
 the rudiments of emacs lisp, and don't even know how to edebug.

To get you started, you could try the following.

- set up two emacs frames
- in one frame, do a M-x describe-function then type the name of the
  function of interest (smtpmail-send-it iirc)
- there will be a link to smtpmail.el, follow it
- this will take you to the definition of the function, there type C-u
  C-M-x to tell emacs you want to edebug it
- now in the other frame, do what you need to do to trigger the bug
- when the function is called, you should see a small triangle in the
  fringe showing the point being executed. You can step through the
  different instructions by hitting space, and you will see in the echo
  area the results of the computations

You can interrupt the debugging at any time by hitting 'q'. And if you
no longer want to debug that function, hit C-M-x while in the
function's source code, or restart emacs.

Try it, it's fun! ;-)

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7


pgpGDmMDt8dt5.pgp
Description: PGP signature


Re: [O] org-mime-org-buffer-htmlize sending hangs ...

2014-07-22 Thread Peter Davis
Alan Schmitt alan.schm...@polytechnique.org writes:

 On 2014-07-21 19:45, Peter Davis p...@pfdstudio.com writes:

 Alas, despite years of emacs abuse, I have not managed to master even
 the rudiments of emacs lisp, and don't even know how to edebug.

 To get you started, you could try the following.

 - set up two emacs frames
 - in one frame, do a M-x describe-function then type the name of the
   function of interest (smtpmail-send-it iirc)
 - there will be a link to smtpmail.el, follow it
 - this will take you to the definition of the function, there type C-u
   C-M-x to tell emacs you want to edebug it
 - now in the other frame, do what you need to do to trigger the bug
 - when the function is called, you should see a small triangle in the
   fringe showing the point being executed. You can step through the
   different instructions by hitting space, and you will see in the echo
   area the results of the computations

 You can interrupt the debugging at any time by hitting 'q'. And if you
 no longer want to debug that function, hit C-M-x while in the
 function's source code, or restart emacs.

 Try it, it's fun! ;-)

This sounds like something even I could do! Thanks, Alan. I'll give it a
shot.

-pd



[O] org-mime-org-buffer-htmlize sending hangs ...

2014-07-21 Thread Peter Davis
I've used org-mode-org-mime-htmlize in the past to send email from org, 
via Gnus. However, recently I've discovered that after I edit the To: 
field and enter C-c C-c, I get Sending via mail... in the mini-buffer, 
and then emacs just sits there, apparently hung. Typing C-g enough times 
brings it back, but the mail never gets sent.


I have started running Gnus in a different emacs concurrently on the 
same machine (On OS X, I run org-mode in emacs-mac-port, and run Gnus in 
Aquamacs), using the same .gnus.el, but I would not expect that to cause 
any problems.


Any suggestions as to what may be going on here, or how to trouble shoot 
it? I really like sending nicely formatted emails from org.


Thanks!
-pd

--
Peter Davis
The Tech Curmudgeon
www.techcurmudgeon.com




Re: [O] org-mime-org-buffer-htmlize sending hangs ...

2014-07-21 Thread Thorsten Jolitz
Peter Davis p...@pfdstudio.com writes:

 I've used org-mode-org-mime-htmlize in the past to send email from
 org, via Gnus. However, recently I've discovered that after I edit the
 To: field and enter C-c C-c, I get Sending via mail... in the
 mini-buffer, and then emacs just sits there, apparently hung. Typing
 C-g enough times brings it back, but the mail never gets sent.

Does Emacs really hang or is it still responsive? Did you try moving
point or so? These messages sometimes don't disappear although the work
is long finished.  Did you try

,
| top
`

on the command-line to see if Emacs uses 100pc CPU?

 I have started running Gnus in a different emacs concurrently on the
 same machine (On OS X, I run org-mode in emacs-mac-port, and run Gnus
 in Aquamacs), using the same .gnus.el, but I would not expect that to
 cause any problems.

 Any suggestions as to what may be going on here, or how to trouble
 shoot it? I really like sending nicely formatted emails from org.

Just had a similar problem.
Try this, if Emacs actually really hangs:

1. M-x load-library RET org-elements.el

2. do as described (- make Emacs hang)

3. send from command line

,
| kill -s usr2 4352
`

(get the PID with 'ps -e | grep emacs')

or, equivalently (?)

,
| pkill --signal usr2 emacs
`

4. go back to emacs and check/copysend the *Backtrace* buffer

-- 
cheers,
Thorsten




Re: [O] org-mime-org-buffer-htmlize sending hangs ...

2014-07-21 Thread Peter Davis

Thank you, Thorsten,

Thorsten Jolitz tjol...@gmail.com writes:

 Peter Davis p...@pfdstudio.com writes:

 I've used org-mode-org-mime-htmlize in the past to send email from
 org, via Gnus. However, recently I've discovered that after I edit the
 To: field and enter C-c C-c, I get Sending via mail... in the
 mini-buffer, and then emacs just sits there, apparently hung. Typing
 C-g enough times brings it back, but the mail never gets sent.

 Does Emacs really hang or is it still responsive? Did you try moving
 point or so? These messages sometimes don't disappear although the work
 is long finished.  Did you try

Actually, Emacs itself does not hang, but the sending process appears to
hang. I've waited 10 or 15 minutes, and the message in the mini-buffer
never changes and the operation never completes. (I've noticed on
another system that after the Sending via mail... message, the
mini-buffer displays other messages as the message is sent.)

 ,
 | top
 `

 on the command-line to see if Emacs uses 100pc CPU?

I don't think it's using 100%, but it's using enough CPU that the Mac
keeps displaying the spinning beachball as I hover over the Emacs window.

 I have started running Gnus in a different emacs concurrently on the
 same machine (On OS X, I run org-mode in emacs-mac-port, and run Gnus
 in Aquamacs), using the same .gnus.el, but I would not expect that to
 cause any problems.

 Any suggestions as to what may be going on here, or how to trouble
 shoot it? I really like sending nicely formatted emails from org.

 Just had a similar problem.
 Try this, if Emacs actually really hangs:

 1. M-x load-library RET org-elements.el

 2. do as described (- make Emacs hang)

 3. send from command line

 ,
 | kill -s usr2 4352
 `

 (get the PID with 'ps -e | grep emacs')

 or, equivalently (?)

 ,
 | pkill --signal usr2 emacs
 `

 4. go back to emacs and check/copysend the *Backtrace* buffer

Emacs isn't hung, but maybe there's some useful information somewhere
else?

Thanks very much!

-pd




Re: [O] org-mime-org-buffer-htmlize sending hangs ...

2014-07-21 Thread Peter Davis
On more observation: I tried quitting Aquamacs, and then quitting and 
re-starting Emacs. The same problem occurred.


I also looked in the *trace of SMTP session to ... * buffer, and it was 
empty.


Thanks!
-pd


On 7/21/14, 10:14 AM, Peter Davis wrote:

Thank you, Thorsten,

Thorsten Jolitz tjol...@gmail.com writes:


Peter Davis p...@pfdstudio.com writes:


I've used org-mode-org-mime-htmlize in the past to send email from
org, via Gnus. However, recently I've discovered that after I edit the
To: field and enter C-c C-c, I get Sending via mail... in the
mini-buffer, and then emacs just sits there, apparently hung. Typing
C-g enough times brings it back, but the mail never gets sent.

Does Emacs really hang or is it still responsive? Did you try moving
point or so? These messages sometimes don't disappear although the work
is long finished.  Did you try

Actually, Emacs itself does not hang, but the sending process appears to
hang. I've waited 10 or 15 minutes, and the message in the mini-buffer
never changes and the operation never completes. (I've noticed on
another system that after the Sending via mail... message, the
mini-buffer displays other messages as the message is sent.)


,
| top
`

on the command-line to see if Emacs uses 100pc CPU?

I don't think it's using 100%, but it's using enough CPU that the Mac
keeps displaying the spinning beachball as I hover over the Emacs window.


I have started running Gnus in a different emacs concurrently on the
same machine (On OS X, I run org-mode in emacs-mac-port, and run Gnus
in Aquamacs), using the same .gnus.el, but I would not expect that to
cause any problems.

Any suggestions as to what may be going on here, or how to trouble
shoot it? I really like sending nicely formatted emails from org.

Just had a similar problem.
Try this, if Emacs actually really hangs:

1. M-x load-library RET org-elements.el

2. do as described (- make Emacs hang)

3. send from command line

,
| kill -s usr2 4352
`

(get the PID with 'ps -e | grep emacs')

or, equivalently (?)

,
| pkill --signal usr2 emacs
`

4. go back to emacs and check/copysend the *Backtrace* buffer

Emacs isn't hung, but maybe there's some useful information somewhere
else?

Thanks very much!

-pd



--
Peter Davis
The Tech Curmudgeon
www.techcurmudgeon.com




Re: [O] org-mime-org-buffer-htmlize sending hangs ...

2014-07-21 Thread Nick Dokos
Peter Davis p...@pfdstudio.com writes:

 On more observation: I tried quitting Aquamacs, and then quitting and
 re-starting Emacs. The same problem occurred.

 I also looked in the *trace of SMTP session to ... * buffer, and it
 was empty.


C-h v message-send-mail-function RET

What the value is depends on which package you use to send mail.  For
smtpmail, this is probably `message-smtpmail-send-it' which just
executes a hook and then calls `smtpmail-send-it'. I would edebug this
function and step through it until it goes off the rails, then do the
same thing on the next level down until you either find the culprit or
give up in disgust. Even a partial descent into it however should be
helpful to whoever you can beg/coerce to look at the problem (most
probably you :-) )

If not smtpmail, then do the same thing with whatever function
you *do* use.

Check any buffers generated and watch out for any debug settings as you
follow the flow. You might want to set any debug variables you find
before doing it again for the Nth time where 2 = N ...

At least, that's how I would go about it.

Nick




Re: [O] org-mime-org-buffer-htmlize sending hangs ...

2014-07-21 Thread Peter Davis

Thank you, Nick.


On 7/21/14, 12:23 PM, Nick Dokos wrote:

Peter Davis p...@pfdstudio.com writes:


On more observation: I tried quitting Aquamacs, and then quitting and
re-starting Emacs. The same problem occurred.

I also looked in the *trace of SMTP session to ... * buffer, and it
was empty.


C-h v message-send-mail-function RET

What the value is depends on which package you use to send mail.  For
smtpmail, this is probably `message-smtpmail-send-it' which just
executes a hook and then calls `smtpmail-send-it'.


Actually, it was set to just smtpmail-send-it (no message-). I tried 
changing it back but that seems to have made no difference. For some 
reason, my .gnus.el had this:


+
| (setq send-mail-function 'smtpmail-send-it
|  message-send-mail-function 'smtpmail-send-it)
+

I changed the second one, so it's now:

+
| (setq send-mail-function 'smtpmail-send-it
|   message-send-mail-function 'message-smtpmail-send-it)
+

Still no good.



I would edebug this
function and step through it until it goes off the rails, then do the
same thing on the next level down until you either find the culprit or
give up in disgust. Even a partial descent into it however should be
helpful to whoever you can beg/coerce to look at the problem (most
probably you :-) )

If not smtpmail, then do the same thing with whatever function
you *do* use.

Check any buffers generated and watch out for any debug settings as you
follow the flow. You might want to set any debug variables you find
before doing it again for the Nth time where 2 = N ...

At least, that's how I would go about it.


Alas, despite years of emacs abuse, I have not managed to master even 
the rudiments of emacs lisp, and don't even know how to edebug.


Thanks!
-pd

--
Peter Davis
The Tech Curmudgeon
www.techcurmudgeon.com




Re: [O] org-mime-org-buffer-htmlize sending hangs ...

2014-07-21 Thread Nick Dokos
Peter Davis p...@pfdstudio.com writes:


 At least, that's how I would go about it.

 Alas, despite years of emacs abuse, I have not managed to master even
 the rudiments of emacs lisp, and don't even know how to edebug.


So this is your opportunity to learn!

This might be a bit too complicated to learn on, but I would encourage
you (and everybody else too) to learn both. My favorite quote in this
respect was somebody's post on this list, who was caught completely by
surprise at having learnt enough lisp to do useful things, and he wasn't
even trying :-) I wish I had kept a reference to that mail: if anybody
(perhaps the author) recognizes it and can find a reference, please let
me know!

I'll also mention that I'm pretty sure that neither John Hendy
nor Tom Dye knew much (anything?) about emacs lisp before org-mode
entangled them[fn:1] - and look at them now!

Footnotes:

[fn:1] That's a little known feature of org-mode: in addition to
   exporting documents and tangling programs, it also entangles
   people. Instead of a unicorn, the logo should be an octopus :-)

Nick




Re: [O] org-mime-org-buffer-htmlize sending hangs ...

2014-07-21 Thread Peter Davis


On 7/21/14, 2:25 PM, Nick Dokos wrote:

Peter Davis p...@pfdstudio.com writes:


At least, that's how I would go about it.

Alas, despite years of emacs abuse, I have not managed to master even
the rudiments of emacs lisp, and don't even know how to edebug.


So this is your opportunity to learn!


Learning emacs lisp is definitely on my bucket list, but not, I confess, 
at the top.


;^)

-pd

--
Peter Davis
The Tech Curmudgeon
www.techcurmudgeon.com