Path: utzoo!attcan!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.editors Subject: Re: vi (vs VMS/EDT) Keywords: vi modeline showmode Message-ID: <2663@auspex.auspex.com> Date: 24 Nov 89 19:30:41 GMT References: <1989Nov14.223604.17418@cs.eur.nl> <13836@orstcs.CS.ORST.EDU> <2640@wtkatz.oakhill.UUCP> Reply-To: guy@auspex.auspex.com (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 30 >This is news to me. I noticed that my Sun3 vi has 'modeline' but >no 'showmode.' When I set modeline on, nothing appreciable changes. > >Anybody have any experience with 'modeline' on the Sun? The two are unrelated. "modeline" - or, as it's called in those System V versions of "ex"/"vi" from AT&T that have it, "modelines" - was introduced to allow people to disable a somewhat insecure and, at times, annoying "feature" of "ex"/"vi", namely the "feature" that it will, when reading in a file, check the first and last file lines of the file to see if they contain the strings "ex:" or "vi:" (or, in sufficiently old versions, "ei:" or "vx:") preceded by a space or tab and, if so, take everything after the ":" and execute it as a command. If "modeline"/"modelines" is set in those versions of "ex"/"vi" that support it (which comprise a smaller set, alas, then the set of those versions of "ex"/"vi" that have "mode lines" like that), this checking is enabled; it is disabled by default. You may not want to leave "modeline" on, therefore.... "showmode" was introduced in a version of "vi" later than any of the ones that came out of Berkeley, and causes it to display an indication of the current mode. SunOS "vi"s prior to the SunOS 4.1 one are based on BSD "vi"s, and lack "showmode". The 4.1 one will be based on the System V Release 3.1 one (mainly to pick up support for 8-bit character sets), barring a surprise, and will have "showmode".