Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site pur-ee.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!ihnp4!inuxc!pur-ee!ecn-ee!davy From: davy@ecn-ee.UUCP Newsgroups: net.unix-wizards Subject: vi modelines fix (reposting) - (nf) Message-ID: <1827@pur-ee.UUCP> Date: Fri, 27-Apr-84 02:24:50 EST Article-I.D.: pur-ee.1827 Posted: Fri Apr 27 02:24:50 1984 Date-Received: Sat, 28-Apr-84 11:21:31 EST Sender: notes@pur-ee.UUCP Organization: Electrical Engineering Department , Purdue University Lines: 97 #N:ecn-ee:13000016:000:1996 ecn-ee!davy Apr 26 18:21:00 1984 This is a reposting of the vi modelines fix. Our notes system got confused and posted it to "net.unix-wizar" instead of "net.unix-wizards". ------------------------ With all the discussion of vi's modelines, I figured I'd post this here. The diffs below show how to install a new on/off variable, "modelines", which enables/disables interpretation of the modelines. By default, it is set to "nomodelines", and must be explicitly set by the user in order to use modelines. *** /tmp/,RCSt1011136 Tue Apr 24 08:06:11 1984 --- ex_data.c Tue Apr 24 08:04:18 1984 *************** *** 77,81 "wrapscan", "ws", ONOFF, 1, 1, 0, "wrapmargin", "wm", NUMERIC, 0, 0, 0, "writeany", "wa", ONOFF, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; --- 91,96 ----- "wrapscan", "ws", ONOFF, 1, 1, 0, "wrapmargin", "wm", NUMERIC, 0, 0, 0, "writeany", "wa", ONOFF, 0, 0, 0, + "modelines", "ml", ONOFF, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; *** /tmp/,RCSt1011255 Tue Apr 24 08:08:55 1984 --- ex_io.c Tue Apr 24 08:04:20 1984 *************** *** 423,429 if (a==first+5 && last-first > 10) a = last - 4; getline(*a); ! checkmodeline(linebuf); } } --- 435,443 ----- if (a==first+5 && last-first > 10) a = last - 4; getline(*a); ! ! if (value(MODELINES)) ! checkmodeline(linebuf); } } *** /tmp/,RCSt1011374 Tue Apr 24 08:10:41 1984 --- ex_vars.h Tue Apr 24 08:04:21 1984 *************** *** 39,43 #define WRAPSCAN 37 #define WRAPMARGIN 38 #define WRITEANY 39 #define NOPTS 40 --- 51,56 ----- #define WRAPSCAN 37 #define WRAPMARGIN 38 #define WRITEANY 39 + #define MODELINES 40 #define NOPTS 41 *************** *** 40,43 #define WRAPMARGIN 38 #define WRITEANY 39 ! #define NOPTS 40 --- 53,56 ----- #define WRITEANY 39 #define MODELINES 40 ! #define NOPTS 41 ----------------------------------------- --Dave Curry decvax!pur-ee!davy eevax.davy@purdue