Re: Writing a wrapper for the editor: mutt aborts in-between

2014-05-18 Thread Chris Green
On Sat, May 17, 2014 at 11:51:40AM -0700, Kevin J. McCarthy wrote: > Karl Voit wrote: > > After renaming, I want to invoke my editor, make my manual changes > > to the email body and after quitting the editor, mutt should take > > over again. > > > > However, when I rename TMPFILENAME to muttfilen

Re: Writing a wrapper for the editor: mutt aborts in-between

2014-05-18 Thread Karl Voit
Hi Cameron! Cameron Simpson (c...@zip.com.au) wrote: > 1: Why not just take care to make the temp file in the same > directory as mutt's temp file? > > 2: Why not just rewrite the muttfile? Mutt isn't touching it. Right. Very valid questions. So far, I am only working on a proof of concept unt

Re: Writing a wrapper for the editor: mutt aborts in-between

2014-05-17 Thread Cameron Simpson
On 17May2014 23:59, Karl Voit wrote: Mike Glover (mglo...@pobox.com) wrote: Have you tried something like: try: os.rename(TMPFILENAME, muttfilename) except Exception, e: log.write("Rename failed: %s" % e) That rename call is almost certainly failing, and this would at least tell you wh

Re: Writing a wrapper for the editor: mutt aborts in-between

2014-05-17 Thread Gary Johnson
On 2014-05-17, Karl Voit wrote: > I thought that mutt has a "weird" method of tracking changes to the > tempfile. Mutt checks the modification time on the temp file before it runs the editor, then checks the modification time again when the editor exits. If the modification time hasn't changed,

Re: Writing a wrapper for the editor: mutt aborts in-between

2014-05-17 Thread Karl Voit
Hi Mike! Mike Glover (mglo...@pobox.com) wrote: > Have you tried something like: > > try: > os.rename(TMPFILENAME, muttfilename) > except Exception, e: > log.write("Rename failed: %s" % e) > > That rename call is almost certainly failing, and this would > at least tell you why... Absol

Re: Writing a wrapper for the editor: mutt aborts in-between

2014-05-17 Thread Mike Glover
Have you tried something like: try: os.rename(TMPFILENAME, muttfilename) except Exception, e: log.write("Rename failed: %s" % e) That rename call is almost certainly failing, and this would at least tell you why... -mg (Also, what OS is this on?) On Sat, May 17, 2014 at 06:19:32PM +020

Re: Writing a wrapper for the editor: mutt aborts in-between

2014-05-17 Thread Kevin J. McCarthy
Karl Voit wrote: > After renaming, I want to invoke my editor, make my manual changes > to the email body and after quitting the editor, mutt should take > over again. > > However, when I rename TMPFILENAME to muttfilename, mutt takes over > the process again. This skips the editor part completely

Writing a wrapper for the editor: mutt aborts in-between

2014-05-17 Thread Karl Voit
Hi! For a works-for-me-hack[1], I need to write a Python wrapper-script for the editor (vim at my side). The wrapper basically parses the temporary file which was created by mutt (muttfilename), creates a new temporary file with modified content (TMPFILENAME), and currently tries to replace muttf