Re: Alt editor failure cause found -- vim returning errors

Joseph Tam <[email protected]>
Newsgroups gmane.mail.pine.general
Message-ID <[email protected]>
On Thu, 15 Feb 2007, Matt Ackeret wrote:

> Well, I found the problem.  If vim gets any error, including searching for
> text that's not found (like if I do /ZZZ right now in vim launched from
> pine), then vim returns an error.

I noticed this annoying messages a long time ago when I set my default editor to
vi (the one packed with Solaris):

 	editor=/usr/bin/vi
 	feature-list=enable-alternate-editor-implicitly, enable-alternate-editor-cmd, ...

If you have an editor error (the last command?), you would get the message.  Every
build from then on, I applied this patch (taken from my notes):

         # Do not check for alternate editor exit status (don't worry, be happy):
         #       //      /*
         #       //       * Report child's unnatural or unhappy exit...
         #       //       */
         #       //      if(WIFEXITED(stat) && WEXITSTATUS(stat) == 0)
         #       //        strcpy(result, "Alternate %s done");
         #       //      else {
         #       //        sprintf(result, "Alternate %%s terminated abnormally (%d)",
         #       //                WIFEXITED(stat) ? WEXITSTATUS(stat) : -1);
         #       //        if(f)
         #       //          ret = -1;
         #       //        else{
         #       //            sprintf(prmpt, "Alt editor failed, use file %.20s of size %%ld chars anyway", fn)
;
         #       //            ret = -2;
         #       //        }
         #       //      }
         #               strcpy(result, "Alternate %s done");
         #
         # To test:
         #       - start pine and start composing a message
         #       - do something that causes an error (e.g. ":g"), then quit
         #       - it ought to say "Alternate editor done"
         vi pico/osdep/unix

I guess maybe you can also make a wrapper script around vi that cleanses the
exit code and use that:

 	cat ___EOF_ >/my/version/of/vi
 	#!/bin/sh

 	/usr/bin/vi
 	exit 0
 	_EOF_

 	chmod +x /my/version/of/vi

Joseph Tam <[email protected]>
_______________________________________________
Pine-info mailing list
[email protected]
http://mailman1.u.washington.edu/mailman/listinfo/pine-info
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.