Weird problem with vi... "Not that many lines in buffer"

Joe Boykin boykin at encore.UUCP
Tue Sep 27 01:19:37 AEST 1988


In article <508 at icus.islp.ny.us>, lenny at icus.islp.ny.us (Lenny Tropiano) writes:
>I just created this .signature file, and for some reason every time this
>is in a file, and I do a "vi" of that file I get the following message...
...
>-- 
>Lenny Tropiano             ICUS Software Systems         w: +1 (516) 582-5525
>lenny at icus.islp.ny.us      Telex: 154232428 ICUS         h: +1 (516) 968-8576
>{talcott,boulder,hombre,pacbell,sbcs}!icus!lenny         attmail!icus!lenny
>        ICUS Software Systems -- PO Box 1; Islip Terrace, NY  11752

The "problem" is that the "modeline" feature of VI is getting in your way.
If the first or last five lines of the file contains:

	ex: command :
    or  vi: command :

the command is executed for you.  VI is very flexible when it comes to
initialization.  The first thing it does is to check for the EXINIT
environment variable.  If this does not exist it looks for ".exrc" in
your home directory.  After this a ".exrc" in your current directory
is searched for.  The last part is to look for "modelines".

Usually, the $home/.exrc contains things you always want (set ic report=1).
The .exrc in a directory contains directory specific stuff, i.e.
"set ai sm" for source directories; "set wm=10" for document directories.

The modelines are a per-file initialization.  If you have a "document
file" in a "source" directory you can override the initialization by
doing:

	ex: set wm=10 noai nosm :
	...text....

Now, your .signature file contains:

	.... Telex: 154232428 ICUS         h: ....

VI is trying to go to line 154232428 in the file (which doesn't exist)
hence the error message.  If you did have that many lines you would
then get a message to the effect that "ICUS" is an invalid command.

Some versions of VI now have a "modeline/nomodeline" command to
turn this off.  You might try it in your EXINIT environment variable
or $home/.exrc file.  If that doesn't work, you'll need to change
your signature file.

----

Joe Boykin
Encore Computer Corp
Chairman, IEEE Computer Societies
    Technical Committee on Operating Systems

UUCP: encore!boykin
ARPA: boykin at multimax.arpa



More information about the Comp.unix.wizards mailing list