$OpenBSD: patch-pico_osdep_spell_unx,v 1.1 2002/12/01 20:57:10 jakob Exp $
--- pico/osdep/spell.unx.orig	Wed Apr  3 22:10:57 2002
+++ pico/osdep/spell.unx	Sun Dec  1 15:17:46 2002
@@ -84,6 +84,14 @@ spell(f, n)
     setimark(0, 1);
     emlwrite("Checking spelling...", NULL); 	/* greetings */
 
+    if((sp = (char *)getenv("SPELL")) == NULL)
+      sp = SPELLER;
+
+    /* This code only works with "spell", which doesn't exist, and
+       alt_speller is only set via command line -s argument. */
+    if (strstr(sp, "ispell") != NULL)
+      alt_speller = sp;
+
     if(alt_speller)
       return(alt_editor(1, 0));			/* f == 1 means fork speller */
 
@@ -91,9 +99,6 @@ spell(f, n)
 	emlwrite("Can't write temp file for spell checker", NULL);
 	return(-1);
     }
-
-    if((sp = (char *)getenv("SPELL")) == NULL)
-      sp = SPELLER;
 
     sprintf(cb, "( %s ) < %s", sp, fn);		/* pre-use buffer! */
     if((p = P_open(cb)) == NULL){ 		/* read output from command */
