davy@ecn-ee.UUCP (04/27/84)
#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