Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!ames!lll-winken!uunet!mcvax!ukc!reading!cf-cm!cybaswan!cs9h7atw From: cs9h7atw@cybaswan.UUCP (Alex Williams) Newsgroups: comp.mail.elm Subject: Re: ctrl-c Keywords: messing up elm when used in vi Message-ID: <485@cybaswan.UUCP> Date: 1 Jun 89 00:00:41 GMT References: <464@cybaswan.UUCP> <471@wubios.wustl.edu> <970@texbell.swbt.com> Reply-To: cs9h7atw@cybaswan.UUCP (Alex Williams) Lines: 60 In article <970@texbell.swbt.com> root@texbell.swbt.com (Greg Hackney) writes: >In article <471@wubios.wustl.edu> david@wubios.UUCP (David J. Camp) writes: >>: "Problems invoking editor /usr/ucb/vi" >> >>elm does something like this to me when I use ^Z to suspend vi >>temporarily. Luckily, the edited message can be retrieved when I >>reenter reply or forward mode. It would be better if elm would just >>send them message the first time, but I do not know what the code looks >>like. > >In editmsg.c, the code looks like this: > > if ((stat = system_call(buffer, SH, TRUE)) != 0) { > dprint(1,(debugfile, > "System call failed with stat %d (edit_the_message)\n", > stat)); > dprint(1, (debugfile, "** %s - %s **\n", error_name(errno), > error_description(errno))); > ClearLine(LINES-1); > error1("Can't invoke editor '%s' for composition.", editor); > sleep(2); > return_value = 1; > } > >And in odd situations (like mine) can be changed >to ignore return codes: > > stat = system_call(buffer, SH, TRUE); > >Some suggest using a fake shell script that invokes the editor, and always >exits with zero. Thanks greg, This is how I have *fixed* it :-) if ((stat = system_call(buffer, SH, TRUE)) !=0 ) { dprint(1,(debugfile, "System call failed with stat %d (edit_the_message)\n", stat)); dprint(1, (debugfile, "** %s - %s **\n", error_name(errno), error_description(errno))); if(errno!=1) { ClearLine(LINES-1); error1("Can't invoke editor '%s' for composition.", editor); sleep(2); return_value = 1; } else return_value = 0; } -- Janet: pyr.swan.ac.uk UUCP : cybaswan.uucp Alex Williams: Department of Computer Scence, University College Swansea, Singleton Park, Swansea, Wales.