[comp.unix.questions] Vi and modeline interaction on Sun 4/330

dwm@fibercom.COM (David W. Minnich) (07/19/90)

We recently got a Sun 4/330 at our site, and I've been noticing some strange
behavior in vi.  In my .exrc I set the modeline option to vi.  This allows
me to set file-specific defaults in vi by including a modeline at the bottom
of the file.  On our other systems this works fine.  On the 4/330, if a 
modeline is present in the file, then vi always thinks I've modified the file
whether I have or not.  (e.g. if I type "vi <filename>" followed immediately
by ":q", vi complains about "No write since last change").  The contents of the
modeline command appear to make no difference; everything I tried behaved the
same way.  We are running SunOS 4.1 on this machine.  Does anyone know what's
going on, and how to fix it?

As always, email to me and I'll summarize if warranted.
-- 
David W. Minnich               INTERNET: dwm@fibercom.com
FiberCom, Inc.                 UUCP: ...!uunet!fibercom!dwm   
P.O. Box 11966                 PHONE: (703) 342-6700, (800) 423-1183 ext. 347
Roanoke, VA  24022-1966        FAX: (703) 342-5961

gert@fwi.uva.nl (Gert Poletiek) (07/20/90)

dwm@fibercom.COM (David W. Minnich) writes:

>We recently got a Sun 4/330 at our site, and I've been noticing some strange
>behavior in vi.  In my .exrc I set the modeline option to vi.  This allows
>me to set file-specific defaults in vi by including a modeline at the bottom
>of the file.  On our other systems this works fine.  On the 4/330, if a 
>modeline is present in the file, then vi always thinks I've modified the file
>whether I have or not.  (e.g. if I type "vi <filename>" followed immediately
>by ":q", vi complains about "No write since last change").  The contents of the
>modeline command appear to make no difference; everything I tried behaved the
>same way.  We are running SunOS 4.1 on this machine.  Does anyone know what's
>going on, and how to fix it?

>As always, email to me and I'll summarize if warranted.
>-- 

You're running SunOS 4.1 which is becoming more and more System V comaptible.
One of the things that are changed is that vi now comes from the SVR4 
distribution and not from de BSD part of SunOS. SVR4 vi does not
know the modeline feature.

You're out of luck...or get the BSD sources and compile them for the sun.


Gert Poletiek  Dept. of Math. and Computing Science, University of Amsterdam,
               Kruislaan 409, NL-1098 SJ  Amsterdam, The Netherlands
Internet:      gert@fwi.uva.nl                   uucp:          gert@uva.uucp
bitnet:        gert%fwi.uva.nl@mcvax.bitnet

--
Gert Poletiek  Dept. of Math. and Computing Science, University of Amsterdam,
               Kruislaan 409, NL-1098 SJ  Amsterdam, The Netherlands
Internet:      gert@fwi.uva.nl                   uucp:          gert@uva.uucp
bitnet:        gert%fwi.uva.nl@mcvax.bitnet

guy@auspex.auspex.com (Guy Harris) (07/22/90)

>You're running SunOS 4.1 which is becoming more and more System V comaptible.

True.

>One of the things that are changed is that vi now comes from the SVR4 
>distribution

False.  It comes from S5R3.1, not S5R4.  This was, BTW, mainly done to
get support of 8-bit character sets, not for S5 compatibility.

> SVR4 vi does not know the modeline feature.

I don't have the S5R4 source handy, but the S5R3.1 one, while it doesn't
know the "modeline" feature, does know the "modelines" feature. :-)

In other words, both Berkeley and AT&T realized that always interpreting
modelines was extremely stupid, and changed their "vi"s to

	1) not interpret modelines by default

and

	2) to have an option you had to turn on in order to have them
	   interpret modelines.

(Earlier versions of both the BSD and S5 "vi"s did understand modelines
- whether you wanted them to or not!)

Unfortunately, they chose different names for that option....

For SunOS 4.1, we changed the S5R3.1 "vi" to use "modeline" for BSD
compatibility, rather than "modelines".

The problem he's having is probably a bug somewhere.  (I don't know
whether he's running 4.1 on the other machines; if so, the problem
probably has nothing to do with the fact that it's a 4/330 and
everything to do with the fact that it's running 4.1.)