home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 3 / 3496 < prev    next >
Encoding:
Internet Message Format  |  1991-06-20  |  54.5 KB

  1. From: pgf@cayman.COM (Paul Fox)
  2. Newsgroups: alt.sources
  3. Subject: Vile 10/17 - vi feel-alike (multi-window)
  4. Message-ID: <4529@cayman.COM>
  5. Date: 7 Jun 91 22:09:52 GMT
  6.  
  7. #!/bin/sh
  8. # this is vileshar.10 (part 10 of Vile)
  9. # do not concatenate these parts, unpack them in order with /bin/sh
  10. # file nefunc.h continued
  11. #
  12. if test ! -r _shar_seq_.tmp; then
  13.     echo 'Please unpack part 1 first!'
  14.     exit 1
  15. fi
  16. (read Scheck
  17.  if test "$Scheck" != 10; then
  18.     echo Please unpack part "$Scheck" next!
  19.     exit 1
  20.  else
  21.     exit 0
  22.  fi
  23. ) < _shar_seq_.tmp || exit 1
  24. echo 'x - continuing file nefunc.h'
  25. sed 's/^X//' << 'SHAR_EOF' >> 'nefunc.h' &&
  26. #endif
  27. #if !SMALLER
  28. extern int cbuf40();
  29. X    CMDFUNC f_cbuf40 = { cbuf40,    REDO };
  30. #endif
  31. extern int delwind();
  32. X    CMDFUNC f_delwind = { delwind,    NONE };
  33. #if AEDIT
  34. extern int deblank();
  35. X    CMDFUNC f_deblank = { deblank,    REDO|UNDO };
  36. #endif
  37. extern int delgmode();
  38. X    CMDFUNC f_delgmode = { delgmode,    NONE };
  39. extern int delmode();
  40. X    CMDFUNC f_delmode = { delmode,    NONE|(EXRCOK|EXTRA) };
  41. extern int deltoeol();
  42. X    CMDFUNC f_deltoeol = { deltoeol,    REDO|UNDO };
  43. #if REBIND
  44. extern int desbind();
  45. X    CMDFUNC f_desbind = { desbind,    NONE };
  46. #endif
  47. #if REBIND
  48. extern int deskey();
  49. X    CMDFUNC f_deskey = { deskey,    NONE };
  50. #endif
  51. #if AEDIT
  52. extern int detab();
  53. X    CMDFUNC f_detab = { detab,    REDO|UNDO };
  54. #endif
  55. extern int dotcmdplay();
  56. X    CMDFUNC f_dotcmdplay = { dotcmdplay,    NONE };
  57. #if !SMALLER
  58. extern int execbuf();
  59. X    CMDFUNC f_execbuf = { execbuf,    NONE };
  60. #endif
  61. #if NEVER
  62. extern int execcmd();
  63. X    CMDFUNC f_execcmd = { execcmd,    NONE };
  64. #endif
  65. #if !SMALLER
  66. extern int execfile();
  67. X    CMDFUNC f_execfile = { execfile,    NONE };
  68. #endif
  69. #if PROC
  70. extern int execproc();
  71. X    CMDFUNC f_execproc = { execproc,    REDO };
  72. #endif
  73. extern int enlargewind();
  74. X    CMDFUNC f_enlargewind = { enlargewind,    NONE };
  75. #if AEDIT
  76. extern int entab();
  77. X    CMDFUNC f_entab = { entab,    REDO|UNDO };
  78. #endif
  79. extern int esc();
  80. X    CMDFUNC f_esc = { esc,    NONE };
  81. extern int fcsrch();
  82. X    CMDFUNC f_fcsrch = { fcsrch,    MOTION };
  83. extern int fcsrch_to();
  84. X    CMDFUNC f_fcsrch_to = { fcsrch_to,    MOTION };
  85. extern int filefind();
  86. X    CMDFUNC f_filefind = { filefind,    NONE|(BANG|FILE1|PLUS) };
  87. extern int filename();
  88. X    CMDFUNC f_filename = { filename,    NONE|(NAMEDF) };
  89. extern int fileread();
  90. X    CMDFUNC f_fileread = { fileread,    NONE };
  91. #if !SMALLER
  92. extern int filesave();
  93. X    CMDFUNC f_filesave = { filesave,    NONE };
  94. #endif
  95. extern int filewrite();
  96. X    CMDFUNC f_filewrite = { filewrite,    NONE };
  97. extern int filter();
  98. X    CMDFUNC f_filter = { filter,    REDO|UNDO };
  99. #if FINDERR
  100. extern int finderr();
  101. X    CMDFUNC f_finderr = { finderr,    NONE };
  102. #endif
  103. extern int firstnonwhite();
  104. X    CMDFUNC f_firstnonwhite = { firstnonwhite,    MOTION };
  105. #if ISRCH
  106. extern int fisearch();
  107. X    CMDFUNC f_fisearch = { fisearch,    NONE };
  108. #endif
  109. extern int flipchar();
  110. X    CMDFUNC f_flipchar = { flipchar,    REDO|UNDO };
  111. #if FLABEL
  112. extern int fnclabel();
  113. X    CMDFUNC f_fnclabel = { fnclabel,    NONE };
  114. #endif
  115. extern int forwdelchar();
  116. X    CMDFUNC f_forwdelchar = { forwdelchar,    REDO|UNDO };
  117. extern int forwhpage();
  118. X    CMDFUNC f_forwhpage = { forwhpage,    NONE };
  119. extern int forwchar();
  120. X    CMDFUNC f_forwchar = { forwchar,    MOTION };
  121. extern int forwpage();
  122. X    CMDFUNC f_forwpage = { forwpage,    MOTION };
  123. extern int forwline();
  124. X    CMDFUNC f_forwline = { forwline,    GOAL|MOTION|FL };
  125. extern int forwbline();
  126. X    CMDFUNC f_forwbline = { forwbline,    MOTION|FL };
  127. extern int forwword();
  128. X    CMDFUNC f_forwword = { forwword,    MOTION };
  129. extern int forwviword();
  130. X    CMDFUNC f_forwviword = { forwviword,    MOTION };
  131. extern int forwendw();
  132. X    CMDFUNC f_forwendw = { forwendw,    MOTION };
  133. extern int forwviendw();
  134. X    CMDFUNC f_forwviendw = { forwviendw,    MOTION };
  135. #if !SMALLER
  136. extern int forwhunt();
  137. X    CMDFUNC f_forwhunt = { forwhunt,    ABS|MOTION };
  138. #endif
  139. extern int forwsearch();
  140. X    CMDFUNC f_forwsearch = { forwsearch,    ABS|MOTION };
  141. #if CFENCE
  142. extern int getfence();
  143. X    CMDFUNC f_getfence = { getfence,    ABS|MOTION };
  144. #endif
  145. #if GLOBALS
  146. extern int globals();
  147. X    CMDFUNC f_globals = { globals,    NONE };
  148. #endif
  149. extern int godotplus();
  150. X    CMDFUNC f_godotplus = { godotplus,    MOTION|FL };
  151. extern int gomark();
  152. X    CMDFUNC f_gomark = { gomark,    MOTION|FL|(RANGE) };
  153. #if WORDPRO
  154. extern int gotobop();
  155. X    CMDFUNC f_gotobop = { gotobop,    ABS|MOTION };
  156. #endif
  157. #if WORDPRO
  158. extern int gotoeop();
  159. X    CMDFUNC f_gotoeop = { gotoeop,    ABS|MOTION };
  160. #endif
  161. #if !SMALLER
  162. extern int gotobob();
  163. X    CMDFUNC f_gotobob = { gotobob,    ABS|MOTION };
  164. #endif
  165. #if !SMALLER
  166. extern int gotoeob();
  167. X    CMDFUNC f_gotoeob = { gotoeob,    ABS|MOTION };
  168. #endif
  169. extern int gotobol();
  170. X    CMDFUNC f_gotobol = { gotobol,    MOTION };
  171. extern int gotoeol();
  172. X    CMDFUNC f_gotoeol = { gotoeol,    MOTION|GOAL };
  173. extern int gotobos();
  174. X    CMDFUNC f_gotobos = { gotobos,    MOTION|FL };
  175. extern int gotomos();
  176. X    CMDFUNC f_gotomos = { gotomos,    MOTION|FL };
  177. extern int gotoeos();
  178. X    CMDFUNC f_gotoeos = { gotoeos,    MOTION|FL };
  179. #if WORDPRO
  180. extern int gotobosec();
  181. X    CMDFUNC f_gotobosec = { gotobosec,    ABS|MOTION };
  182. #endif
  183. #if WORDPRO
  184. extern int gotoeosec();
  185. X    CMDFUNC f_gotoeosec = { gotoeosec,    ABS|MOTION };
  186. #endif
  187. #if TAGS
  188. extern int gototag();
  189. X    CMDFUNC f_gototag = { gototag,    NONE|(BANG|WORD1) };
  190. #endif
  191. extern int gotocol();
  192. X    CMDFUNC f_gotocol = { gotocol,    MOTION };
  193. extern int gotoline();
  194. X    CMDFUNC f_gotoline = { gotoline,    ABS|MOTION|FL|(RANGE) };
  195. extern int golinenmmark();
  196. X    CMDFUNC f_golinenmmark = { golinenmmark,    MOTION|FL };
  197. extern int goexactnmmark();
  198. X    CMDFUNC f_goexactnmmark = { goexactnmmark,    MOTION };
  199. extern int help();
  200. X    CMDFUNC f_help = { help,    NONE };
  201. extern int histbuff();
  202. X    CMDFUNC f_histbuff = { histbuff,    NONE };
  203. extern int insert();
  204. X    CMDFUNC f_insert = { insert,    REDO|UNDO };
  205. extern int insertbol();
  206. X    CMDFUNC f_insertbol = { insertbol,    REDO|UNDO };
  207. #if BEFORE
  208. extern int insfiletop();
  209. X    CMDFUNC f_insfiletop = { insfiletop,    REDO|UNDO };
  210. #endif
  211. extern int insfile();
  212. X    CMDFUNC f_insfile = { insfile,    REDO|UNDO|GLOBOK|(FROM|ZERO|NAMEDF) };
  213. #if !SMALLER
  214. extern int insspace();
  215. X    CMDFUNC f_insspace = { insspace,    REDO|UNDO };
  216. #endif
  217. #if !SMALLER
  218. extern int istring();
  219. X    CMDFUNC f_istring = { istring,    REDO|UNDO };
  220. #endif
  221. extern int join();
  222. X    CMDFUNC f_join = { join,    REDO|UNDO };
  223. extern int killbuffer();
  224. X    CMDFUNC f_killbuffer = { killbuffer,    NONE };
  225. extern int showlength();
  226. X    CMDFUNC f_showlength = { showlength,    NONE };
  227. #if !SMALLER
  228. extern int lastnonwhite();
  229. X    CMDFUNC f_lastnonwhite = { lastnonwhite,    MOTION };
  230. #endif
  231. extern int listbuffers();
  232. X    CMDFUNC f_listbuffers = { listbuffers,    NONE };
  233. extern int lineputafter();
  234. X    CMDFUNC f_lineputafter = { lineputafter,    REDO|UNDO|GLOBOK|(FROM|ZERO|WORD1) };
  235. extern int lineputbefore();
  236. X    CMDFUNC f_lineputbefore = { lineputbefore,    REDO|UNDO|GLOBOK|(FROM|WORD1) };
  237. extern int lineundo();
  238. X    CMDFUNC f_lineundo = { lineundo,    NONE };
  239. extern int map();
  240. X    CMDFUNC f_map = { map,    NONE|(EXRCOK|BANG|EXTRA) };
  241. extern int cntl_af();
  242. X    CMDFUNC f_cntl_af = { cntl_af,    NONE };
  243. extern int opermove();
  244. X    CMDFUNC f_opermove = { opermove,    OPER|(RANGE|EXTRA) };
  245. extern int mvdnnxtwind();
  246. X    CMDFUNC f_mvdnnxtwind = { mvdnnxtwind,    NONE };
  247. extern int mvupnxtwind();
  248. X    CMDFUNC f_mvupnxtwind = { mvupnxtwind,    NONE };
  249. extern int mvdnwind();
  250. X    CMDFUNC f_mvdnwind = { mvdnwind,    GOAL };
  251. extern int mvupwind();
  252. X    CMDFUNC f_mvupwind = { mvupwind,    GOAL };
  253. extern int mvrightwind();
  254. X    CMDFUNC f_mvrightwind = { mvrightwind,    GOAL };
  255. extern int mvleftwind();
  256. X    CMDFUNC f_mvleftwind = { mvleftwind,    GOAL };
  257. extern int nextbuffer();
  258. X    CMDFUNC f_nextbuffer = { nextbuffer,    NONE|(BANG|NAMEDFS) };
  259. extern int namebuffer();
  260. X    CMDFUNC f_namebuffer = { namebuffer,    NONE };
  261. #if !SMALLER
  262. extern int newline();
  263. X    CMDFUNC f_newline = { newline,    REDO|UNDO };
  264. #endif
  265. extern int newlength();
  266. X    CMDFUNC f_newlength = { newlength,    NONE };
  267. extern int newwidth();
  268. X    CMDFUNC f_newwidth = { newwidth,    NONE };
  269. extern int nextwind();
  270. X    CMDFUNC f_nextwind = { nextwind,    NONE };
  271. extern int nullproc();
  272. X    CMDFUNC f_nullproc = { nullproc,    NONE };
  273. extern int onamedcmd();
  274. X    CMDFUNC f_onamedcmd = { onamedcmd,    NONE };
  275. extern int namedcmd();
  276. X    CMDFUNC f_namedcmd = { namedcmd,    NONE };
  277. extern int ex();
  278. X    CMDFUNC f_ex = { ex,    NONE|(BANG|FILE1) };
  279. extern int operchg();
  280. X    CMDFUNC f_operchg = { operchg,    OPER|REDO|UNDO };
  281. extern int operlinechg();
  282. X    CMDFUNC f_operlinechg = { operlinechg,    OPER|REDO|UNDO|(RANGE) };
  283. extern int operdel();
  284. X    CMDFUNC f_operdel = { operdel,    OPER|REDO|UNDO };
  285. extern int operlinedel();
  286. X    CMDFUNC f_operlinedel = { operlinedel,    OPER|REDO|UNDO|GLOBOK|(RANGE+WORD1) };
  287. extern int operfilter();
  288. X    CMDFUNC f_operfilter = { operfilter,    OPER|REDO|UNDO|(EXRCOK|RANGE|NAMEDFS|DFLNONE|NL) };
  289. #if WORDPRO
  290. extern int operformat();
  291. X    CMDFUNC f_operformat = { operformat,    OPER|REDO|UNDO|(RANGE) };
  292. #endif
  293. extern int operflip();
  294. X    CMDFUNC f_operflip = { operflip,    OPER|REDO|UNDO|GLOBOK|(RANGE) };
  295. #if GLOBALS
  296. extern int operglobals();
  297. X    CMDFUNC f_operglobals = { operglobals,    OPER|(/*RANGE|*/BANG|EXTRA|DFLALL) };
  298. #endif
  299. #if GLOBALS
  300. extern int opervglobals();
  301. X    CMDFUNC f_opervglobals = { opervglobals,    OPER|(RANGE|BANG|EXTRA|DFLALL) };
  302. #endif
  303. extern int operlower();
  304. X    CMDFUNC f_operlower = { operlower,    OPER|REDO|UNDO|GLOBOK|(RANGE) };
  305. #if GLOBALS
  306. extern int operlist();
  307. X    CMDFUNC f_operlist = { operlist,    OPER|GLOBOK|(RANGE) };
  308. #endif
  309. #if GLOBALS
  310. extern int operprint();
  311. X    CMDFUNC f_operprint = { operprint,    OPER|GLOBOK|(RANGE) };
  312. #endif
  313. extern int operupper();
  314. X    CMDFUNC f_operupper = { operupper,    OPER|REDO|UNDO|GLOBOK|(RANGE) };
  315. extern int operlshift();
  316. X    CMDFUNC f_operlshift = { operlshift,    OPER|REDO|UNDO|GLOBOK|(RANGE) };
  317. extern int operrshift();
  318. X    CMDFUNC f_operrshift = { operrshift,    OPER|REDO|UNDO|GLOBOK|(RANGE) };
  319. extern int opersubst();
  320. X    CMDFUNC f_opersubst = { opersubst,    OPER|REDO|UNDO|GLOBOK|(RANGE|EXTRA) };
  321. extern int operyank();
  322. X    CMDFUNC f_operyank = { operyank,    OPER };
  323. extern int operlineyank();
  324. X    CMDFUNC f_operlineyank = { operlineyank,    OPER|(RANGE|WORD1) };
  325. extern int openup();
  326. X    CMDFUNC f_openup = { openup,    REDO|UNDO|(FROM) };
  327. extern int opendown();
  328. X    CMDFUNC f_opendown = { opendown,    REDO|UNDO|(FROM|ZERO) };
  329. extern int operwrite();
  330. X    CMDFUNC f_operwrite = { operwrite,    OPER|(RANGE|BANG|FILE1|DFLALL) };
  331. extern int overwrite();
  332. X    CMDFUNC f_overwrite = { overwrite,    REDO|UNDO };
  333. extern int onlywind();
  334. X    CMDFUNC f_onlywind = { onlywind,    NONE };
  335. extern int poswind();
  336. X    CMDFUNC f_poswind = { poswind,    NONE };
  337. extern int prevwind();
  338. X    CMDFUNC f_prevwind = { prevwind,    NONE };
  339. extern int pipecmd();
  340. X    CMDFUNC f_pipecmd = { pipecmd,    NONE };
  341. extern int putafter();
  342. X    CMDFUNC f_putafter = { putafter,    REDO|UNDO };
  343. extern int putbefore();
  344. X    CMDFUNC f_putbefore = { putbefore,    REDO|UNDO };
  345. extern int quit();
  346. X    CMDFUNC f_quit = { quit,    NONE|(BANG) };
  347. extern int quithard();
  348. X    CMDFUNC f_quithard = { quithard,    NONE };
  349. extern int quickexit();
  350. X    CMDFUNC f_quickexit = { quickexit,    NONE|(BANG|NL) };
  351. extern int quote();
  352. X    CMDFUNC f_quote = { quote,    REDO|UNDO };
  353. extern int refresh();
  354. X    CMDFUNC f_refresh = { refresh,    NONE };
  355. #if !SMALLER
  356. extern int reposition();
  357. X    CMDFUNC f_reposition = { reposition,    NONE };
  358. #endif
  359. extern int rep_csrch();
  360. X    CMDFUNC f_rep_csrch = { rep_csrch,    MOTION };
  361. extern int replacechar();
  362. X    CMDFUNC f_replacechar = { replacechar,    REDO|UNDO };
  363. extern int respawn();
  364. X    CMDFUNC f_respawn = { respawn,    NONE };
  365. #if !SMALLER
  366. extern int resize();
  367. X    CMDFUNC f_resize = { resize,    NONE };
  368. #endif
  369. #if !SMALLER
  370. extern int restwnd();
  371. X    CMDFUNC f_restwnd = { restwnd,    NONE };
  372. #endif
  373. extern int rev_csrch();
  374. X    CMDFUNC f_rev_csrch = { rev_csrch,    MOTION };
  375. #if ISRCH
  376. extern int risearch();
  377. X    CMDFUNC f_risearch = { risearch,    NONE };
  378. #endif
  379. extern int revsearch();
  380. X    CMDFUNC f_revsearch = { revsearch,    ABS|MOTION };
  381. extern int scrforwsearch();
  382. X    CMDFUNC f_scrforwsearch = { scrforwsearch,    ABS|MOTION };
  383. extern int scrbacksearch();
  384. X    CMDFUNC f_scrbacksearch = { scrbacksearch,    ABS|MOTION };
  385. extern int scrsearchpat();
  386. X    CMDFUNC f_scrsearchpat = { scrsearchpat,    NONE };
  387. extern int settab();
  388. X    CMDFUNC f_settab = { settab,    NONE };
  389. extern int spawncli();
  390. X    CMDFUNC f_spawncli = { spawncli,    NONE };
  391. #if !SMALLER
  392. extern int savewnd();
  393. X    CMDFUNC f_savewnd = { savewnd,    NONE };
  394. #endif
  395. extern int scrnextup();
  396. X    CMDFUNC f_scrnextup = { scrnextup,    NONE };
  397. extern int scrnextdw();
  398. X    CMDFUNC f_scrnextdw = { scrnextdw,    NONE };
  399. extern int setfillcol();
  400. X    CMDFUNC f_setfillcol = { setfillcol,    NONE };
  401. #if CRYPT
  402. extern int setkey();
  403. X    CMDFUNC f_setkey = { setkey,    NONE };
  404. #endif
  405. extern int setmode();
  406. X    CMDFUNC f_setmode = { setmode,    NONE|(EXRCOK|EXTRA) };
  407. extern int setgmode();
  408. X    CMDFUNC f_setgmode = { setgmode,    NONE };
  409. extern int setnmmark();
  410. X    CMDFUNC f_setnmmark = { setnmmark,    NONE|(FROM+WORD1) };
  411. #if !SMALLER
  412. extern int setvar();
  413. X    CMDFUNC f_setvar = { setvar,    NONE };
  414. #endif
  415. #if VMALLOC
  416. extern int setvmalloc();
  417. X    CMDFUNC f_setvmalloc = { setvmalloc,    NONE };
  418. #endif
  419. extern int showcpos();
  420. X    CMDFUNC f_showcpos = { showcpos,    NONE };
  421. extern int showmodes();
  422. X    CMDFUNC f_showmodes = { showmodes,    NONE };
  423. extern int showgmodes();
  424. X    CMDFUNC f_showgmodes = { showgmodes,    NONE };
  425. extern int showversion();
  426. X    CMDFUNC f_showversion = { showversion,    NONE|(EXRCOK) };
  427. extern int shrinkwind();
  428. X    CMDFUNC f_shrinkwind = { shrinkwind,    NONE };
  429. extern int source();
  430. X    CMDFUNC f_source = { source,    NONE|(EXRCOK|NAMEDF) };
  431. extern int spawn();
  432. X    CMDFUNC f_spawn = { spawn,    NONE };
  433. extern int splitwind();
  434. X    CMDFUNC f_splitwind = { splitwind,    NONE };
  435. extern int storemac();
  436. X    CMDFUNC f_storemac = { storemac,    NONE };
  437. #if PROC
  438. extern int storeproc();
  439. X    CMDFUNC f_storeproc = { storeproc,    NONE };
  440. #endif
  441. extern int subst_again();
  442. X    CMDFUNC f_subst_again = { subst_again,    REDO|UNDO|GLOBOK|(RANGE|EXTRA) };
  443. extern int opertransf();
  444. X    CMDFUNC f_opertransf = { opertransf,    OPER|(RANGE+EXTRA) };
  445. extern int togglelistbuffers();
  446. X    CMDFUNC f_togglelistbuffers = { togglelistbuffers,    NONE };
  447. extern int trimline();
  448. X    CMDFUNC f_trimline = { trimline,    REDO|UNDO|GLOBOK };
  449. #if !SMALLER
  450. extern int twiddle();
  451. X    CMDFUNC f_twiddle = { twiddle,    REDO|UNDO };
  452. #endif
  453. #if REBIND
  454. extern int unbindkey();
  455. X    CMDFUNC f_unbindkey = { unbindkey,    NONE };
  456. #endif
  457. extern int undo();
  458. X    CMDFUNC f_undo = { undo,    NONE };
  459. extern int unarg();
  460. X    CMDFUNC f_unarg = { unarg,    NONE };
  461. extern int unimpl();
  462. X    CMDFUNC f_unimpl = { unimpl,    NONE };
  463. extern int unmark();
  464. X    CMDFUNC f_unmark = { unmark,    NONE };
  465. extern int unmap();
  466. X    CMDFUNC f_unmap = { unmap,    NONE|(EXRCOK|BANG|EXTRA) };
  467. #if TAGS
  468. extern int untagpop();
  469. X    CMDFUNC f_untagpop = { untagpop,    NONE };
  470. #endif
  471. #if !SMALLER
  472. extern int upscreen();
  473. X    CMDFUNC f_upscreen = { upscreen,    NONE };
  474. #endif
  475. extern int usebuffer();
  476. X    CMDFUNC f_usebuffer = { usebuffer,    NONE };
  477. extern int usekreg();
  478. X    CMDFUNC f_usekreg = { usekreg,    REDO };
  479. extern int visual();
  480. X    CMDFUNC f_visual = { visual,    NONE };
  481. #if GLOBALS
  482. extern int vglobals();
  483. X    CMDFUNC f_vglobals = { vglobals,    NONE };
  484. #endif
  485. extern int viewfile();
  486. X    CMDFUNC f_viewfile = { viewfile,    NONE };
  487. extern int writequit();
  488. X    CMDFUNC f_writequit = { writequit,    NONE|(NL) };
  489. #if !SMALLER
  490. extern int wrapword();
  491. X    CMDFUNC f_wrapword = { wrapword,    REDO|UNDO };
  492. #endif
  493. #if !SMALLER
  494. extern int writemsg();
  495. X    CMDFUNC f_writemsg = { writemsg,    NONE };
  496. #endif
  497. extern int yankline();
  498. X    CMDFUNC f_yankline = { yankline,    NONE };
  499. SHAR_EOF
  500. echo 'File nefunc.h is complete' &&
  501. chmod 0664 nefunc.h ||
  502. echo 'restore of nefunc.h failed'
  503. Wc_c="`wc -c < 'nefunc.h'`"
  504. test 19211 -eq "$Wc_c" ||
  505.     echo 'nefunc.h: original size 19211, current size' "$Wc_c"
  506. # ============= nename.h ==============
  507. echo 'x - extracting nename.h (Text)'
  508. sed 's/^X//' << 'SHAR_EOF' > 'nename.h' &&
  509. /* nename.h: this header file was produced automatically by
  510. X * the ./mktbls program, based on input from the file cmdtbl
  511. X */
  512. X
  513. /* if you maintain this by hand, keep it in */
  514. /* alphabetical order!!!! */
  515. X
  516. NTAB nametbl[] = {
  517. X    { "!",    &f_operfilter },
  518. X    { "!!",    &f_respawn },
  519. X    { "&",    &f_subst_again },
  520. X    { "*",    &f_togglelistbuffers },
  521. X    { ":",    &f_namedcmd },
  522. X    { "<",    &f_operlshift },
  523. X    { "=",    &f_showlength },
  524. X    { ">",    &f_operrshift },
  525. X    { "E",    &f_filefind },
  526. X    { "L",    &f_operlower },
  527. X    { "Put",    &f_lineputbefore },
  528. X    { "Q",    &f_quit },
  529. #if (BEFORE)
  530. X    { "R",    &f_insfiletop },
  531. #endif
  532. X    { "U",    &f_operupper },
  533. X    { "W",    &f_operwrite },
  534. X    { "WQ",    &f_writequit },
  535. X    { "Wq",    &f_writequit },
  536. X    { "_",    &f_histbuff },
  537. X    { "a",    &f_opendown },
  538. #if (!FEWNAMES)
  539. X    { "abort-command",    &f_esc },
  540. #endif
  541. #if (!FEWNAMES)
  542. X    { "alternate-buffer",    &f_altbuff },
  543. #endif
  544. X    { "append",    &f_opendown },
  545. #if (!FEWNAMES)
  546. X    { "append-eol",    &f_appendeol },
  547. #endif
  548. #if (!FEWNAMES)
  549. X    { "appendchar",    &f_append },
  550. #endif
  551. #if (APROP|REBIND)
  552. X    { "apropos",    &f_apro },
  553. #endif
  554. X    { "b",    &f_usebuffer },
  555. #if (!FEWNAMES)
  556. X    { "backward-char-scan",    &f_bcsrch },
  557. #endif
  558. #if (!FEWNAMES)
  559. X    { "backward-char-scan-to",    &f_bcsrch_to },
  560. #endif
  561. #if (!FEWNAMES)
  562. X    { "backward-character",    &f_backchar },
  563. #endif
  564. #if (!FEWNAMES)
  565. X    { "begin-macro",    &f_ctlxlp },
  566. #endif
  567. #if (!SMALLER) & (!FEWNAMES)
  568. X    { "beginning-of-file",    &f_gotobob },
  569. #endif
  570. #if (!FEWNAMES)
  571. X    { "beginning-of-line",    &f_gotobol },
  572. #endif
  573. #if (!FEWNAMES)
  574. X    { "beginning-of-screen",    &f_gotobos },
  575. #endif
  576. #if (REBIND)
  577. X    { "bind-key",    &f_bindkey },
  578. #endif
  579. X    { "buffer",    &f_usebuffer },
  580. #if (!FEWNAMES)
  581. X    { "buffer-length",    &f_showlength },
  582. #endif
  583. X    { "c",    &f_opercopy },
  584. X    { "ch",    &f_operlinechg },
  585. #if (!FEWNAMES)
  586. X    { "change-char",    &f_chgchar },
  587. #endif
  588. #if (!FEWNAMES)
  589. X    { "change-file-name",    &f_filename },
  590. #endif
  591. #if (!FEWNAMES)
  592. X    { "change-line",    &f_chgline },
  593. #endif
  594. #if (!FEWNAMES)
  595. X    { "change-lines-til",    &f_operlinechg },
  596. #endif
  597. #if (!FEWNAMES)
  598. X    { "change-til",    &f_operchg },
  599. #endif
  600. #if (!FEWNAMES)
  601. X    { "change-to-end-of-line",    &f_chgtoeol },
  602. #endif
  603. #if (!FEWNAMES)
  604. X    { "clear-and-redraw",    &f_refresh },
  605. #endif
  606. #if (!FEWNAMES)
  607. X    { "clear-message-line",    &f_clrmes },
  608. #endif
  609. X    { "cntl_a-prefix",    &f_cntl_af },
  610. #if (!FEWNAMES)
  611. X    { "cntl_x-prefix",    &f_cntl_xf },
  612. #endif
  613. #if (!FEWNAMES)
  614. X    { "continue-search",    &f_consearch },
  615. #endif
  616. X    { "copy",    &f_opercopy },
  617. X    { "d",    &f_operlinedel },
  618. #if (AEDIT) & (!FEWNAMES)
  619. X    { "delete-blank-lines",    &f_deblank },
  620. #endif
  621. #if (!FEWNAMES)
  622. X    { "delete-buffer",    &f_killbuffer },
  623. #endif
  624. #if (!FEWNAMES)
  625. X    { "delete-global-mode",    &f_delgmode },
  626. #endif
  627. #if (!FEWNAMES)
  628. X    { "delete-lines-til",    &f_operlinedel },
  629. #endif
  630. #if (!FEWNAMES)
  631. X    { "delete-mode",    &f_delmode },
  632. #endif
  633. #if (!FEWNAMES)
  634. X    { "delete-next-character",    &f_forwdelchar },
  635. #endif
  636. #if (!FEWNAMES)
  637. X    { "delete-other-windows",    &f_onlywind },
  638. #endif
  639. #if (!FEWNAMES)
  640. X    { "delete-previous-character",    &f_backdelchar },
  641. #endif
  642. #if (!FEWNAMES)
  643. X    { "delete-til",    &f_operdel },
  644. #endif
  645. #if (!FEWNAMES)
  646. X    { "delete-to-end-of-line",    &f_deltoeol },
  647. #endif
  648. #if (!FEWNAMES)
  649. X    { "delete-window",    &f_delwind },
  650. #endif
  651. #if (REBIND)
  652. X    { "describe-bindings",    &f_desbind },
  653. #endif
  654. #if (REBIND)
  655. X    { "describe-key",    &f_deskey },
  656. #endif
  657. #if (AEDIT) & (!FEWNAMES)
  658. X    { "detab-line",    &f_detab },
  659. #endif
  660. X    { "e",    &f_filefind },
  661. X    { "e!",    &f_fileread },
  662. #if (!FEWNAMES)
  663. X    { "edit-file",    &f_filefind },
  664. #endif
  665. #if (!FEWNAMES)
  666. X    { "end-macro",    &f_ctlxrp },
  667. #endif
  668. #if (!SMALLER) & (!FEWNAMES)
  669. X    { "end-of-file",    &f_gotoeob },
  670. #endif
  671. #if (!FEWNAMES)
  672. X    { "end-of-line",    &f_gotoeol },
  673. #endif
  674. #if (!FEWNAMES)
  675. X    { "end-of-screen",    &f_gotoeos },
  676. #endif
  677. #if (AEDIT) & (!FEWNAMES)
  678. X    { "entab-line",    &f_entab },
  679. #endif
  680. X    { "ex",    &f_ex },
  681. #if (!SMALLER) & (!FEWNAMES)
  682. X    { "execute-buffer",    &f_execbuf },
  683. #endif
  684. #if (NEVER) & (!FEWNAMES)
  685. X    { "execute-command-line",    &f_execcmd },
  686. #endif
  687. #if (!SMALLER) & (!FEWNAMES)
  688. X    { "execute-file",    &f_execfile },
  689. #endif
  690. #if (!FEWNAMES)
  691. X    { "execute-macro",    &f_ctlxe },
  692. #endif
  693. #if (!FEWNAMES)
  694. X    { "execute-macro-1",    &f_cbuf1 },
  695. #endif
  696. #if (!FEWNAMES)
  697. X    { "execute-macro-10",    &f_cbuf10 },
  698. #endif
  699. #if (!SMALLER) & (!FEWNAMES)
  700. X    { "execute-macro-11",    &f_cbuf11 },
  701. #endif
  702. #if (!SMALLER) & (!FEWNAMES)
  703. X    { "execute-macro-12",    &f_cbuf12 },
  704. #endif
  705. #if (!SMALLER) & (!FEWNAMES)
  706. X    { "execute-macro-13",    &f_cbuf13 },
  707. #endif
  708. #if (!SMALLER) & (!FEWNAMES)
  709. X    { "execute-macro-14",    &f_cbuf14 },
  710. #endif
  711. #if (!SMALLER) & (!FEWNAMES)
  712. X    { "execute-macro-15",    &f_cbuf15 },
  713. #endif
  714. #if (!SMALLER) & (!FEWNAMES)
  715. X    { "execute-macro-16",    &f_cbuf16 },
  716. #endif
  717. #if (!SMALLER) & (!FEWNAMES)
  718. X    { "execute-macro-17",    &f_cbuf17 },
  719. #endif
  720. #if (!SMALLER) & (!FEWNAMES)
  721. X    { "execute-macro-18",    &f_cbuf18 },
  722. #endif
  723. #if (!SMALLER) & (!FEWNAMES)
  724. X    { "execute-macro-19",    &f_cbuf19 },
  725. #endif
  726. #if (!FEWNAMES)
  727. X    { "execute-macro-2",    &f_cbuf2 },
  728. #endif
  729. #if (!SMALLER) & (!FEWNAMES)
  730. X    { "execute-macro-20",    &f_cbuf20 },
  731. #endif
  732. #if (!SMALLER) & (!FEWNAMES)
  733. X    { "execute-macro-21",    &f_cbuf21 },
  734. #endif
  735. #if (!SMALLER) & (!FEWNAMES)
  736. X    { "execute-macro-22",    &f_cbuf22 },
  737. #endif
  738. #if (!SMALLER) & (!FEWNAMES)
  739. X    { "execute-macro-23",    &f_cbuf23 },
  740. #endif
  741. #if (!SMALLER) & (!FEWNAMES)
  742. X    { "execute-macro-24",    &f_cbuf24 },
  743. #endif
  744. #if (!SMALLER) & (!FEWNAMES)
  745. X    { "execute-macro-25",    &f_cbuf25 },
  746. #endif
  747. #if (!SMALLER) & (!FEWNAMES)
  748. X    { "execute-macro-26",    &f_cbuf26 },
  749. #endif
  750. #if (!SMALLER) & (!FEWNAMES)
  751. X    { "execute-macro-27",    &f_cbuf27 },
  752. #endif
  753. #if (!SMALLER) & (!FEWNAMES)
  754. X    { "execute-macro-28",    &f_cbuf28 },
  755. #endif
  756. #if (!SMALLER) & (!FEWNAMES)
  757. X    { "execute-macro-29",    &f_cbuf29 },
  758. #endif
  759. #if (!FEWNAMES)
  760. X    { "execute-macro-3",    &f_cbuf3 },
  761. #endif
  762. #if (!SMALLER) & (!FEWNAMES)
  763. X    { "execute-macro-30",    &f_cbuf30 },
  764. #endif
  765. #if (!SMALLER) & (!FEWNAMES)
  766. X    { "execute-macro-31",    &f_cbuf31 },
  767. #endif
  768. #if (!SMALLER) & (!FEWNAMES)
  769. X    { "execute-macro-32",    &f_cbuf32 },
  770. #endif
  771. #if (!SMALLER) & (!FEWNAMES)
  772. X    { "execute-macro-33",    &f_cbuf33 },
  773. #endif
  774. #if (!SMALLER) & (!FEWNAMES)
  775. X    { "execute-macro-34",    &f_cbuf34 },
  776. #endif
  777. #if (!SMALLER) & (!FEWNAMES)
  778. X    { "execute-macro-35",    &f_cbuf35 },
  779. #endif
  780. #if (!SMALLER) & (!FEWNAMES)
  781. X    { "execute-macro-36",    &f_cbuf36 },
  782. #endif
  783. #if (!SMALLER) & (!FEWNAMES)
  784. X    { "execute-macro-37",    &f_cbuf37 },
  785. #endif
  786. #if (!SMALLER) & (!FEWNAMES)
  787. X    { "execute-macro-38",    &f_cbuf38 },
  788. #endif
  789. #if (!SMALLER) & (!FEWNAMES)
  790. X    { "execute-macro-39",    &f_cbuf39 },
  791. #endif
  792. #if (!FEWNAMES)
  793. X    { "execute-macro-4",    &f_cbuf4 },
  794. #endif
  795. #if (!SMALLER) & (!FEWNAMES)
  796. X    { "execute-macro-40",    &f_cbuf40 },
  797. #endif
  798. #if (!FEWNAMES)
  799. X    { "execute-macro-5",    &f_cbuf5 },
  800. #endif
  801. #if (!FEWNAMES)
  802. X    { "execute-macro-6",    &f_cbuf6 },
  803. #endif
  804. #if (!FEWNAMES)
  805. X    { "execute-macro-7",    &f_cbuf7 },
  806. #endif
  807. #if (!FEWNAMES)
  808. X    { "execute-macro-8",    &f_cbuf8 },
  809. #endif
  810. #if (!FEWNAMES)
  811. X    { "execute-macro-9",    &f_cbuf9 },
  812. #endif
  813. #if (!FEWNAMES)
  814. X    { "execute-named-command",    &f_namedcmd },
  815. #endif
  816. #if (!FEWNAMES)
  817. X    { "execute-named-command-old",    &f_onamedcmd },
  818. #endif
  819. #if (PROC) & (!FEWNAMES)
  820. X    { "execute-procedure",    &f_execproc },
  821. #endif
  822. X    { "exit",    &f_quit },
  823. X    { "f",    &f_filename },
  824. X    { "file",    &f_filename },
  825. X    { "filename",    &f_filename },
  826. #if (!FEWNAMES)
  827. X    { "filter-buffer",    &f_filter },
  828. #endif
  829. #if (!FEWNAMES)
  830. X    { "filter-til",    &f_operfilter },
  831. #endif
  832. #if (!FEWNAMES)
  833. X    { "find-file",    &f_filefind },
  834. #endif
  835. #if (FINDERR) & (!FEWNAMES)
  836. X    { "find-next-error",    &f_finderr },
  837. #endif
  838. #if (TAGS) & (!FEWNAMES)
  839. X    { "find-tag",    &f_gototag },
  840. #endif
  841. #if (!FEWNAMES)
  842. X    { "first-nonwhite",    &f_firstnonwhite },
  843. #endif
  844. #if (!FEWNAMES)
  845. X    { "flip-character",    &f_flipchar },
  846. #endif
  847. #if (!FEWNAMES)
  848. X    { "flip-til",    &f_operflip },
  849. #endif
  850. #if (WORDPRO) & (!FEWNAMES)
  851. X    { "format-til",    &f_operformat },
  852. #endif
  853. #if (!FEWNAMES)
  854. X    { "forward-char-scan",    &f_fcsrch },
  855. #endif
  856. #if (!FEWNAMES)
  857. X    { "forward-char-scan-to",    &f_fcsrch_to },
  858. #endif
  859. #if (!FEWNAMES)
  860. X    { "forward-character",    &f_forwchar },
  861. #endif
  862. #if (GLOBALS)
  863. X    { "g",    &f_operglobals },
  864. #endif
  865. #if (GLOBALS)
  866. X    { "global",    &f_operglobals },
  867. #endif
  868. X    { "gmodes",    &f_showgmodes },
  869. #if (!FEWNAMES)
  870. X    { "goto-column",    &f_gotocol },
  871. #endif
  872. #if (!FEWNAMES)
  873. X    { "goto-line",    &f_gotoline },
  874. #endif
  875. #if (CFENCE) & (!FEWNAMES)
  876. X    { "goto-matching-fence",    &f_getfence },
  877. #endif
  878. #if (!FEWNAMES)
  879. X    { "goto-named-mark",    &f_golinenmmark },
  880. #endif
  881. #if (!FEWNAMES)
  882. X    { "goto-named-mark-exact",    &f_goexactnmmark },
  883. #endif
  884. #if (!FEWNAMES)
  885. X    { "grow-window",    &f_enlargewind },
  886. #endif
  887. X    { "h",    &f_help },
  888. #if (!FEWNAMES)
  889. X    { "handle-tab",    &f_settab },
  890. #endif
  891. X    { "help",    &f_help },
  892. #if (!FEWNAMES)
  893. X    { "historical-buffer",    &f_histbuff },
  894. #endif
  895. #if (!SMALLER)
  896. X    { "hunt-backward",    &f_backhunt },
  897. #endif
  898. #if (!SMALLER) & (!FEWNAMES)
  899. X    { "hunt-forward",    &f_forwhunt },
  900. #endif
  901. X    { "i",    &f_openup },
  902. #if (!FEWNAMES)
  903. X    { "i-shell",    &f_spawncli },
  904. #endif
  905. #if (ISRCH) & (!FEWNAMES)
  906. X    { "incremental-search",    &f_fisearch },
  907. #endif
  908. X    { "insert",    &f_openup },
  909. #if (!FEWNAMES)
  910. X    { "insert-bol",    &f_insertbol },
  911. #endif
  912. #if (!FEWNAMES)
  913. X    { "insert-file",    &f_insfile },
  914. #endif
  915. #if (BEFORE) & (!FEWNAMES)
  916. X    { "insert-file-at-top",    &f_insfiletop },
  917. #endif
  918. #if (!SMALLER) & (!FEWNAMES)
  919. X    { "insert-space",    &f_insspace },
  920. #endif
  921. #if (!SMALLER)
  922. X    { "insert-string",    &f_istring },
  923. #endif
  924. #if (!FEWNAMES)
  925. X    { "insertchar",    &f_insert },
  926. #endif
  927. #if (!FEWNAMES)
  928. X    { "join-lines",    &f_join },
  929. #endif
  930. X    { "k",    &f_setnmmark },
  931. X    { "ki",    &f_killbuffer },
  932. #if (!FEWNAMES)
  933. X    { "kill-buffer",    &f_killbuffer },
  934. #endif
  935. #if (GLOBALS)
  936. X    { "l",    &f_operlist },
  937. #endif
  938. #if (FLABEL)
  939. X    { "label-fkey",    &f_fnclabel },
  940. #endif
  941. #if (FLABEL) & (!FEWNAMES)
  942. X    { "label-function-key",    &f_fnclabel },
  943. #endif
  944. #if (!SMALLER) & (!FEWNAMES)
  945. X    { "last-nonwhite",    &f_lastnonwhite },
  946. #endif
  947. #if (!FEWNAMES)
  948. X    { "list-buffers",    &f_listbuffers },
  949. #endif
  950. #if (GLOBALS) & (!FEWNAMES)
  951. X    { "list-lines-til",    &f_operlist },
  952. #endif
  953. #if (!FEWNAMES)
  954. X    { "lower-til",    &f_operlower },
  955. #endif
  956. X    { "m",    &f_opermove },
  957. X    { "map",    &f_map },
  958. #if (!FEWNAMES)
  959. X    { "middle-of-screen",    &f_gotomos },
  960. #endif
  961. X    { "modes",    &f_showmodes },
  962. X    { "move",    &f_opermove },
  963. #if (!FEWNAMES)
  964. X    { "move-next-window-down",    &f_mvdnnxtwind },
  965. #endif
  966. #if (!FEWNAMES)
  967. X    { "move-next-window-up",    &f_mvupnxtwind },
  968. #endif
  969. #if (!FEWNAMES)
  970. X    { "move-window-down",    &f_mvdnwind },
  971. #endif
  972. #if (!FEWNAMES)
  973. X    { "move-window-left",    &f_mvleftwind },
  974. #endif
  975. #if (!FEWNAMES)
  976. X    { "move-window-right",    &f_mvrightwind },
  977. #endif
  978. #if (!FEWNAMES)
  979. X    { "move-window-up",    &f_mvupwind },
  980. #endif
  981. X    { "n",    &f_nextbuffer },
  982. #if (!SMALLER)
  983. X    { "newline",    &f_newline },
  984. #endif
  985. #if (!FEWNAMES)
  986. X    { "next-buffer",    &f_nextbuffer },
  987. #endif
  988. #if (!FEWNAMES)
  989. X    { "next-half-page",    &f_forwhpage },
  990. #endif
  991. #if (!FEWNAMES)
  992. X    { "next-line",    &f_forwline },
  993. #endif
  994. #if (!FEWNAMES)
  995. X    { "next-line-at-bol",    &f_forwbline },
  996. #endif
  997. #if (!FEWNAMES)
  998. X    { "next-page",    &f_forwpage },
  999. #endif
  1000. #if (WORDPRO) & (!FEWNAMES)
  1001. X    { "next-paragraph",    &f_gotoeop },
  1002. #endif
  1003. #if (!FEWNAMES)
  1004. X    { "next-punc-word",    &f_forwviword },
  1005. #endif
  1006. #if (!FEWNAMES)
  1007. X    { "next-punc-word-end",    &f_forwviendw },
  1008. #endif
  1009. #if (WORDPRO) & (!FEWNAMES)
  1010. X    { "next-section",    &f_gotoeosec },
  1011. #endif
  1012. #if (!FEWNAMES)
  1013. X    { "next-window",    &f_nextwind },
  1014. #endif
  1015. #if (!FEWNAMES)
  1016. X    { "next-word",    &f_forwword },
  1017. #endif
  1018. #if (!FEWNAMES)
  1019. X    { "next-word-end",    &f_forwendw },
  1020. #endif
  1021. #if (!FEWNAMES)
  1022. X    { "nop",    &f_nullproc },
  1023. #endif
  1024. #if (GLOBALS)
  1025. X    { "og",    &f_globals },
  1026. #endif
  1027. #if (!FEWNAMES)
  1028. X    { "open-line-above",    &f_openup },
  1029. #endif
  1030. #if (!FEWNAMES)
  1031. X    { "open-line-below",    &f_opendown },
  1032. #endif
  1033. #if (GLOBALS)
  1034. X    { "ov",    &f_vglobals },
  1035. #endif
  1036. #if (!FEWNAMES)
  1037. X    { "overwrite",    &f_overwrite },
  1038. #endif
  1039. #if (GLOBALS)
  1040. X    { "p",    &f_operprint },
  1041. #endif
  1042. #if (!FEWNAMES)
  1043. X    { "pipe-command",    &f_pipecmd },
  1044. #endif
  1045. #if (!FEWNAMES)
  1046. X    { "position",    &f_showcpos },
  1047. #endif
  1048. #if (!FEWNAMES)
  1049. X    { "position-window",    &f_poswind },
  1050. #endif
  1051. #if (!FEWNAMES)
  1052. X    { "previous-half-page",    &f_backhpage },
  1053. #endif
  1054. #if (!FEWNAMES)
  1055. X    { "previous-line",    &f_backline },
  1056. #endif
  1057. #if (!FEWNAMES)
  1058. X    { "previous-line-at-bol",    &f_backbline },
  1059. #endif
  1060. #if (!FEWNAMES)
  1061. X    { "previous-page",    &f_backpage },
  1062. #endif
  1063. #if (WORDPRO) & (!FEWNAMES)
  1064. X    { "previous-paragraph",    &f_gotobop },
  1065. #endif
  1066. #if (!FEWNAMES)
  1067. X    { "previous-punc-word",    &f_backviword },
  1068. #endif
  1069. #if (WORDPRO) & (!FEWNAMES)
  1070. X    { "previous-section",    &f_gotobosec },
  1071. #endif
  1072. #if (!FEWNAMES)
  1073. X    { "previous-window",    &f_prevwind },
  1074. #endif
  1075. #if (!FEWNAMES)
  1076. X    { "previous-word",    &f_backword },
  1077. #endif
  1078. #if (GLOBALS) & (!FEWNAMES)
  1079. X    { "print-lines-til",    &f_operprint },
  1080. #endif
  1081. X    { "put",    &f_lineputafter },
  1082. #if (!FEWNAMES)
  1083. X    { "put-after",    &f_putafter },
  1084. #endif
  1085. #if (!FEWNAMES)
  1086. X    { "put-as-lines-after",    &f_lineputafter },
  1087. #endif
  1088. #if (!FEWNAMES)
  1089. X    { "put-as-lines-before",    &f_lineputbefore },
  1090. #endif
  1091. #if (!FEWNAMES)
  1092. X    { "put-before",    &f_putbefore },
  1093. #endif
  1094. X    { "q",    &f_quit },
  1095. X    { "q!",    &f_quithard },
  1096. #if (!FEWNAMES)
  1097. X    { "quick-exit",    &f_quickexit },
  1098. #endif
  1099. #if (!FEWNAMES)
  1100. X    { "quote-character",    &f_quote },
  1101. #endif
  1102. X    { "r",    &f_insfile },
  1103. #if (REBIND)
  1104. X    { "rebind-key",    &f_bindkey },
  1105. #endif
  1106. #if (!SMALLER)
  1107. X    { "redraw-display",    &f_reposition },
  1108. #endif
  1109. X    { "rename-buffer",    &f_namebuffer },
  1110. #if (!FEWNAMES)
  1111. X    { "repeat-char-scan",    &f_rep_csrch },
  1112. #endif
  1113. #if (!FEWNAMES)
  1114. X    { "repeat-last-cmd",    &f_dotcmdplay },
  1115. #endif
  1116. #if (!FEWNAMES)
  1117. X    { "replace-character",    &f_replacechar },
  1118. #endif
  1119. #if (!FEWNAMES)
  1120. X    { "replace-with-file",    &f_fileread },
  1121. #endif
  1122. #if (!FEWNAMES)
  1123. X    { "rerun-shell-command",    &f_respawn },
  1124. #endif
  1125. #if (!SMALLER)
  1126. X    { "resize-window",    &f_resize },
  1127. #endif
  1128. #if (!SMALLER)
  1129. X    { "restore-window",    &f_restwnd },
  1130. #endif
  1131. #if (!FEWNAMES)
  1132. X    { "reverse-char-scan",    &f_rev_csrch },
  1133. #endif
  1134. #if (ISRCH) & (!FEWNAMES)
  1135. X    { "reverse-incremental-search",    &f_risearch },
  1136. #endif
  1137. #if (!FEWNAMES)
  1138. X    { "reverse-search",    &f_revsearch },
  1139. #endif
  1140. #if (PROC)
  1141. X    { "run",    &f_execproc },
  1142. #endif
  1143. X    { "s",    &f_opersubst },
  1144. #if (!SMALLER)
  1145. X    { "save-file",    &f_filesave },
  1146. #endif
  1147. #if (!SMALLER)
  1148. X    { "save-window",    &f_savewnd },
  1149. #endif
  1150. X    { "screen-columns",    &f_newwidth },
  1151. X    { "screen-rows",    &f_newlength },
  1152. #if (!FEWNAMES)
  1153. X    { "screen-search-forward",    &f_scrforwsearch },
  1154. #endif
  1155. #if (!FEWNAMES)
  1156. X    { "screen-search-pattern-grab",    &f_scrsearchpat },
  1157. #endif
  1158. #if (!FEWNAMES)
  1159. X    { "screen-search-reverse",    &f_scrbacksearch },
  1160. #endif
  1161. #if (!FEWNAMES)
  1162. X    { "scroll-next-down",    &f_scrnextdw },
  1163. #endif
  1164. #if (!FEWNAMES)
  1165. X    { "scroll-next-up",    &f_scrnextup },
  1166. #endif
  1167. #if (!FEWNAMES)
  1168. X    { "search-forward",    &f_forwsearch },
  1169. #endif
  1170. #if (!FEWNAMES)
  1171. X    { "search-reverse",    &f_backsearch },
  1172. #endif
  1173. #if (!FEWNAMES)
  1174. X    { "select-buffer",    &f_usebuffer },
  1175. #endif
  1176. X    { "set",    &f_setmode },
  1177. #if (CRYPT)
  1178. X    { "set-crypt-key",    &f_setkey },
  1179. #endif
  1180. X    { "set-fill-column",    &f_setfillcol },
  1181. X    { "set-global-mode",    &f_setgmode },
  1182. #if (!FEWNAMES)
  1183. X    { "set-mode",    &f_setmode },
  1184. #endif
  1185. #if (!FEWNAMES)
  1186. X    { "set-named-mark",    &f_setnmmark },
  1187. #endif
  1188. X    { "set-tab",    &f_settab },
  1189. #if (!SMALLER)
  1190. X    { "set-variable",    &f_setvar },
  1191. #endif
  1192. X    { "setall",    &f_showmodes },
  1193. X    { "setg",    &f_setgmode },
  1194. X    { "setgall",    &f_showgmodes },
  1195. X    { "setgno",    &f_delgmode },
  1196. X    { "setno",    &f_delmode },
  1197. #if (!SMALLER)
  1198. X    { "setv",    &f_setvar },
  1199. #endif
  1200. X    { "sh",    &f_spawncli },
  1201. X    { "shell",    &f_spawncli },
  1202. #if (!FEWNAMES)
  1203. X    { "shell-command",    &f_spawn },
  1204. #endif
  1205. #if (!FEWNAMES)
  1206. X    { "shift-left-til",    &f_operlshift },
  1207. #endif
  1208. #if (!FEWNAMES)
  1209. X    { "shift-right-til",    &f_operrshift },
  1210. #endif
  1211. X    { "show-global-modes",    &f_showgmodes },
  1212. X    { "show-modes",    &f_showmodes },
  1213. #if (!FEWNAMES)
  1214. X    { "shrink-window",    &f_shrinkwind },
  1215. #endif
  1216. X    { "source",    &f_source },
  1217. #if (!FEWNAMES)
  1218. X    { "split-current-window",    &f_splitwind },
  1219. #endif
  1220. X    { "store-macro",    &f_storemac },
  1221. #if (PROC)
  1222. X    { "store-procedure",    &f_storeproc },
  1223. #endif
  1224. #if (!FEWNAMES)
  1225. X    { "substitute",    &f_opersubst },
  1226. #endif
  1227. #if (!FEWNAMES)
  1228. X    { "substitute-again",    &f_subst_again },
  1229. #endif
  1230. #if (UNIX&&defined(SIGTSTP)) & (!FEWNAMES)
  1231. X    { "suspend-emacs",    &f_bktoshell },
  1232. #endif
  1233. X    { "t",    &f_opertransf },
  1234. #if (TAGS)
  1235. X    { "ta",    &f_gototag },
  1236. #endif
  1237. #if (TAGS)
  1238. X    { "tag",    &f_gototag },
  1239. #endif
  1240. #if (!FEWNAMES)
  1241. X    { "toggle-buffer-list",    &f_togglelistbuffers },
  1242. #endif
  1243. #if (!SMALLER) & (!FEWNAMES)
  1244. X    { "transpose-characters",    &f_twiddle },
  1245. #endif
  1246. X    { "trim",    &f_trimline },
  1247. #if (!FEWNAMES)
  1248. X    { "trim-line",    &f_trimline },
  1249. #endif
  1250. #if (REBIND)
  1251. X    { "unbind-key",    &f_unbindkey },
  1252. #endif
  1253. #if (!FEWNAMES)
  1254. X    { "undo-change",    &f_undo },
  1255. #endif
  1256. #if (!FEWNAMES)
  1257. X    { "undo-line-changes",    &f_lineundo },
  1258. #endif
  1259. #if (!FEWNAMES)
  1260. X    { "unimplemented-command",    &f_unimpl },
  1261. #endif
  1262. #if (!FEWNAMES)
  1263. X    { "universal-argument",    &f_unarg },
  1264. #endif
  1265. X    { "unmap",    &f_unmap },
  1266. X    { "unmark-buffer",    &f_unmark },
  1267. X    { "unset",    &f_delmode },
  1268. X    { "unsetg",    &f_delgmode },
  1269. #if (TAGS) & (!FEWNAMES)
  1270. X    { "untag-pop",    &f_untagpop },
  1271. #endif
  1272. #if (!SMALLER)
  1273. X    { "update-screen",    &f_upscreen },
  1274. #endif
  1275. #if (!FEWNAMES)
  1276. X    { "upper-til",    &f_operupper },
  1277. #endif
  1278. #if (!FEWNAMES)
  1279. X    { "use-named-kill-register",    &f_usekreg },
  1280. #endif
  1281. #if (GLOBALS)
  1282. X    { "v",    &f_opervglobals },
  1283. #endif
  1284. X    { "version",    &f_showversion },
  1285. #if (GLOBALS)
  1286. X    { "vglobal",    &f_opervglobals },
  1287. #endif
  1288. X    { "view-file",    &f_viewfile },
  1289. X    { "visual",    &f_visual },
  1290. #if (VMALLOC)
  1291. X    { "vmalloc",    &f_setvmalloc },
  1292. #endif
  1293. X    { "w",    &f_operwrite },
  1294. X    { "wq",    &f_writequit },
  1295. #if (!SMALLER)
  1296. X    { "wrap-word",    &f_wrapword },
  1297. #endif
  1298. #if (!FEWNAMES)
  1299. X    { "write-file",    &f_filewrite },
  1300. #endif
  1301. #if (!FEWNAMES)
  1302. X    { "write-file-and-quit",    &f_writequit },
  1303. #endif
  1304. #if (!SMALLER)
  1305. X    { "write-message",    &f_writemsg },
  1306. #endif
  1307. #if (!FEWNAMES)
  1308. X    { "write-til",    &f_operwrite },
  1309. #endif
  1310. X    { "x",    &f_quickexit },
  1311. X    { "xit",    &f_quickexit },
  1312. X    { "y",    &f_operlineyank },
  1313. #if (!FEWNAMES)
  1314. X    { "yank-line",    &f_yankline },
  1315. #endif
  1316. #if (!FEWNAMES)
  1317. X    { "yank-lines-til",    &f_operlineyank },
  1318. #endif
  1319. #if (!FEWNAMES)
  1320. X    { "yank-til",    &f_operyank },
  1321. #endif
  1322. X    { "|",    &f_filter },
  1323. X    { "~",    &f_operflip },
  1324. X    { NULL, NULL }
  1325. };
  1326. SHAR_EOF
  1327. chmod 0664 nename.h ||
  1328. echo 'restore of nename.h failed'
  1329. Wc_c="`wc -c < 'nename.h'`"
  1330. test 17247 -eq "$Wc_c" ||
  1331.     echo 'nename.h: original size 17247, current size' "$Wc_c"
  1332. # ============= news.c ==============
  1333. echo 'x - extracting news.c (Text)'
  1334. sed 's/^X//' << 'SHAR_EOF' > 'news.c' &&
  1335. /*    news:    Unix (SunOS4 and Unicos) NeWS video driver
  1336. X        for MicroEMACS
  1337. X
  1338. X    The bulk of the code is contained in news.cps.
  1339. X
  1340. X    P.R.Ove
  1341. */
  1342. X
  1343. #define    termdef    1            /* don't define "term" external */
  1344. X
  1345. #include <stdio.h>
  1346. #include    "news.h"
  1347. #include    "signal.h"
  1348. #include    "estruct.h"
  1349. #include        "edef.h"
  1350. X
  1351. #if NeWS
  1352. X
  1353. #define    MARGIN    8
  1354. #define    SCRSIZ    64
  1355. #define    NPAUSE    10            /* # times thru update to pause */
  1356. #define BEL     0x07
  1357. #define ESC     0x1B
  1358. #define min(x,y)    ((x) < (y) ? (x) : (y))
  1359. #define max(x,y)    ((x) > (y) ? (x) : (y))
  1360. #define P(i)        (0x7fff & (i))        /* avoid (-) (long ints) */
  1361. X
  1362. extern int      newsopen();
  1363. extern int      newsgetc();
  1364. extern int      newsputc();
  1365. extern int      newsflush();
  1366. extern int      newsclose();
  1367. extern int    newskopen();
  1368. extern int    newskclose();
  1369. extern int      newsmove();
  1370. extern int      newseeol();
  1371. extern int      newseeop();
  1372. extern int      newsbeep();
  1373. extern int    newsrev();
  1374. extern int    newscres();
  1375. #if    COLOR
  1376. extern    int    newsfcol();
  1377. extern    int    newsbcol();
  1378. X
  1379. int    cfcolor = -1;        /* current forground color */
  1380. int    cbcolor = -1;        /* current background color */
  1381. #endif
  1382. X
  1383. X
  1384. TERM term = {
  1385. X    NULL,    /* these four values are set dynamically at open time */
  1386. X    NULL,
  1387. X    NULL,
  1388. X    NULL,
  1389. X    MARGIN,
  1390. X    SCRSIZ,
  1391. X    NPAUSE,
  1392. X        newsopen,
  1393. X        newsclose,
  1394. X        newskopen,
  1395. X        newskclose,
  1396. X        newsgetc,
  1397. X        newsputc,
  1398. X        newsflush,
  1399. X        newsmove,
  1400. X        newseeol,
  1401. X        newseeop,
  1402. X        newsbeep,
  1403. X        newsrev,
  1404. X        newscres
  1405. #if    COLOR
  1406. X    , newsfcol,
  1407. X    newsbcol
  1408. #endif
  1409. };
  1410. X
  1411. X
  1412. newsquit()    /* for killing when ^C is received */
  1413. {
  1414. X    newsclose() ;
  1415. X    exit(0) ;
  1416. }
  1417. X
  1418. X
  1419. newsopen()
  1420. {
  1421. int    rows, cols ;
  1422. X    if (term.t_nrow <= 0) term.t_nrow = 36 ;    /* default size */
  1423. X    term.t_nrow = min(term.t_nrow, 100) ;
  1424. X    term.t_nrow = max(term.t_nrow, 5) ;
  1425. X    ps_open_PostScript() ;
  1426. X    signal(SIGHUP, newsquit) ;
  1427. X    signal(SIGINT, newsquit) ;
  1428. X    signal(SIGTERM, newsquit) ;
  1429. X    ps_initialize(term.t_nrow) ;
  1430. X    ps_flush_PostScript() ;
  1431. X    ps_getscreensize(&rows, &cols) ;
  1432. X    term.t_ncol = cols ;
  1433. X    term.t_mrow = term.t_nrow ;
  1434. X    term.t_mcol = max(term.t_ncol*2, 200) ;    /* to change screen size */
  1435. }
  1436. X
  1437. X
  1438. newsclose()
  1439. {
  1440. X    ps_terminate() ;
  1441. X    ps_flush_PostScript() ;
  1442. X    sleep(1) ;
  1443. X    ps_close_PostScript() ;
  1444. }
  1445. X
  1446. X
  1447. newskopen()        /* taken care of above */
  1448. {}
  1449. newskclose()
  1450. {}
  1451. X
  1452. X
  1453. /* refresh when the screen changes size */
  1454. newsrefresh()
  1455. {
  1456. int    rows, cols ;
  1457. X    ps_getscreensize(&rows, &cols) ;
  1458. X    if (cols != term.t_ncol) {
  1459. X        ps_statefix() ;        /* NeWS "bug" workaround */
  1460. X        newwidth(P(TRUE), P(cols)) ;
  1461. X    }
  1462. }
  1463. X
  1464. X
  1465. /* update screen without data transfer (useful for color updates) */
  1466. newslocalupdate()
  1467. {
  1468. X    ps_localupdate() ;
  1469. }
  1470. X
  1471. X
  1472. newsscroll(first, match, count)
  1473. int    first, match, count ;
  1474. {
  1475. X    ps_scroller(P(first), P(match), P(count)) ;
  1476. }
  1477. X
  1478. X
  1479. newsdump(s)    /* debugging routine */
  1480. char    *s ;
  1481. {
  1482. X    ps_dump(s) ;
  1483. X    ps_flush_PostScript() ;
  1484. }
  1485. X
  1486. X    
  1487. newsmove(row, col)
  1488. register int row, col;
  1489. {
  1490. X        ps_move(P(row),P(col)) ;
  1491. }
  1492. X
  1493. X
  1494. newsflush()
  1495. {
  1496. X    if (!typahead()) ps_flush_PostScript() ;
  1497. }
  1498. X
  1499. X
  1500. newsputc(c)    /* only ordinary characters will be sent here */
  1501. char c ;
  1502. {
  1503. X    ps_putc(P(c)) ;
  1504. }
  1505. X
  1506. X
  1507. newsputline(row, s, fgcolor, bgcolor)
  1508. int    row, fgcolor, bgcolor ;
  1509. char    *s ;
  1510. {
  1511. X    ps_putline(P(row), s, P(fgcolor), P(bgcolor)) ;
  1512. }
  1513. X
  1514. X
  1515. newsfastputline(row, s)        /* using existing colors */
  1516. int    row ;
  1517. char    *s ;
  1518. {
  1519. X    ps_fastputline(P(row), s) ;
  1520. }
  1521. X
  1522. X
  1523. newssetrowcolors(row, fg, bg)
  1524. int    row, fg, bg ;
  1525. {
  1526. X    ps_setrowcolors(P(row), P(fg), P(bg)) ;
  1527. }
  1528. X
  1529. X
  1530. newscls() {ps_cls();}
  1531. newsinserton()    {ps_inserton();}
  1532. newsinsertoff()    {ps_insertoff();}
  1533. newscmodeon()    {ps_cmodeon();}
  1534. newscmodeoff()    {ps_cmodeoff();}
  1535. newsimmediateon() {ps_immediateon();}
  1536. newsimmediateoff() {ps_immediateoff();}
  1537. X
  1538. X
  1539. #define NEWSBUFSIZ    1000
  1540. X
  1541. newsgetc()
  1542. {
  1543. static char inbuf[NEWSBUFSIZ] ;
  1544. static int buf_count = 0, buf_index = 0, raw_count = 0 ;
  1545. int    i, j ;
  1546. X    if ( buf_index >= buf_count ) {
  1547. X        ps_gets(&buf_count, inbuf) ;
  1548. X        buf_index = 0 ;
  1549. X    }
  1550. X    if ( buf_count == 0 ) return(0) ;    /* shouldn't happen */
  1551. X    buf_index++ ;
  1552. X    inhibit_update = ( buf_index < buf_count ) ;
  1553. X    /* force update before 1st special character if not on message line */
  1554. /*    if (    buf_index > 1 &&
  1555. X        ( inbuf[buf_index-1]<32 || inbuf[buf_index-1]==127 ) &&
  1556. X        isprint(inbuf[buf_index-2]) &&
  1557. X        ttrow != term.t_nrow
  1558. X    )
  1559. X        update(TRUE) ;
  1560. */
  1561. X
  1562. X    /* return the next character */
  1563. X    /* fprintf(stderr, "received char %d\n", 0xFF & inbuf[buf_index-1]) ; */
  1564. X    return( 0xFF & inbuf[buf_index-1] ) ;
  1565. }
  1566. X
  1567. X
  1568. X
  1569. newseeol()
  1570. {
  1571. X        ps_eeol() ;
  1572. }
  1573. X
  1574. X
  1575. newseeop()
  1576. {
  1577. X    ps_eeop() ;
  1578. }
  1579. X
  1580. X
  1581. newsrev(state)        /* change reverse video status */
  1582. int state;        /* FALSE = normal video, TRUE = reverse video */
  1583. {
  1584. }
  1585. X
  1586. X
  1587. newscres()    /* change screen resolution */
  1588. {
  1589. X    return(TRUE);
  1590. }
  1591. X
  1592. X
  1593. spal(dummy)    /* change palette string */
  1594. {
  1595. }
  1596. X
  1597. X
  1598. #if    COLOR    /* defined but not used, color is set by lines */
  1599. newsfcol()
  1600. {
  1601. }
  1602. newsbcol()
  1603. {
  1604. }
  1605. #endif
  1606. X
  1607. X
  1608. newsbeep()
  1609. {
  1610. }
  1611. X
  1612. X
  1613. /* REPORT_MODES
  1614. X *
  1615. X * Tell the workstation what mode we are in.  Should be called whenever
  1616. X * a buffer/window/file/mode is changed.
  1617. X */
  1618. newsreportmodes()
  1619. {
  1620. int    i ;
  1621. X
  1622. for (i=0; i < NUMMODES; i++) {
  1623. X    if (strcmp("OVER", modename[i]) == 0) {
  1624. X        if ( 1 << i & curwp->w_bufp->b_mode ) ps_insertoff() ;
  1625. X        else ps_inserton() ;
  1626. X    }
  1627. X    else if (strcmp("CMODE", modename[i]) == 0) {
  1628. X        if ( 1 << i & curwp->w_bufp->b_mode ) ps_cmodeon() ;
  1629. X        else ps_cmodeoff() ;
  1630. X    }
  1631. }
  1632. }
  1633. X
  1634. X
  1635. #if    FLABEL
  1636. fnclabel(f, n)        /* label a function key */
  1637. X
  1638. int f,n;    /* default flag, numeric argument [unused] */
  1639. X
  1640. {
  1641. X    /* on machines with no function keys...don't bother */
  1642. X    return(TRUE);
  1643. }
  1644. #endif
  1645. #else
  1646. X
  1647. hello()
  1648. {
  1649. }
  1650. X
  1651. #endif
  1652. SHAR_EOF
  1653. chmod 0444 news.c ||
  1654. echo 'restore of news.c failed'
  1655. Wc_c="`wc -c < 'news.c'`"
  1656. test 5376 -eq "$Wc_c" ||
  1657.     echo 'news.c: original size 5376, current size' "$Wc_c"
  1658. # ============= news.cps ==============
  1659. echo 'x - extracting news.cps (Text)'
  1660. sed 's/^X//' << 'SHAR_EOF' > 'news.cps' &&
  1661. %! news.cps
  1662. %
  1663. % Definitions for MicroEmacs NeWS front end.
  1664. %
  1665. % P.R.Ove
  1666. X
  1667. X
  1668. X
  1669. % C interface
  1670. %
  1671. % Keep these guys short.  The defs should be sent in ps_initdef
  1672. #define GETS_TAG        0
  1673. #define GETSCREENSIZE_TAG    1
  1674. X
  1675. % Main channel to the remote process.
  1676. cdef ps_gets(int n, string s)
  1677. X    getstring                % stack: string
  1678. X    GETS_TAG        tagprint    % id tag
  1679. X    dup length        typedprint    % send length
  1680. X                typedprint    % send string
  1681. => GETS_TAG (n, s)
  1682. X
  1683. cdef ps_getscreensize(int rows, int cols)
  1684. X    GETSCREENSIZE_TAG    tagprint
  1685. X    win /Rows get        typedprint
  1686. X    win /Cols get        typedprint
  1687. => GETSCREENSIZE_TAG (rows, cols)
  1688. X
  1689. cdef ps_move(int row, int col)
  1690. X    {row col remotemove} win send
  1691. X
  1692. cdef ps_eeol()
  1693. X    {erase_eol} win send
  1694. X
  1695. cdef ps_eeop()
  1696. X    {erase_eop} win send
  1697. X
  1698. cdef ps_cls()
  1699. X    {clrscreen} win send
  1700. X
  1701. cdef ps_setrowcolors(int row, int fg, int bg)
  1702. X    {Fgcolor row fg put Bgcolor row bg put} win send
  1703. X
  1704. cdef ps_terminate()    % why must I do this?
  1705. X    {unmap} win send
  1706. X
  1707. cdef ps_putc(int c)
  1708. X    {c putc} win send
  1709. X
  1710. cdef ps_putline(int row, string s, int fgcol, int bgcol)
  1711. X    {row s fgcol bgcol putline} win send
  1712. X
  1713. cdef ps_fastputline(int row, string s)        % first use cls
  1714. X    {row s fastputline} win send        % (for fast screen updates)
  1715. X
  1716. cdef ps_scroller(int src, int dest, int n)
  1717. X    {src dest n scroller} win send
  1718. X
  1719. cdef ps_dump(string s)        % debugging aid
  1720. {    (ps_dump: %\n) [s] dbgprintf
  1721. X    0 1 3 { (row % = %\n) [3 -1 roll dup Image exch get] dbgprintf } for
  1722. X    (\n) [] dbgprintf
  1723. } win send
  1724. X
  1725. cdef ps_insertoff()
  1726. X    {overtypemode} win send
  1727. X
  1728. cdef ps_inserton()
  1729. X    {insertmode} win send
  1730. X
  1731. cdef ps_cmodeon()
  1732. X    {cmodeon} win send
  1733. X
  1734. cdef ps_cmodeoff()
  1735. X    {cmodeoff} win send
  1736. X
  1737. cdef ps_immediateon()
  1738. X    {immediateon} win send
  1739. X
  1740. cdef ps_immediateoff()
  1741. X    {immediateoff} win send
  1742. X
  1743. cdef ps_statefix()                % NeWS bug workaround
  1744. X    {State setstate} win send
  1745. X
  1746. cdef ps_localupdate()
  1747. X    {imagetoscreen} win send
  1748. X
  1749. X
  1750. X
  1751. cdef ps_initialize(int arg_rows)
  1752. X
  1753. % basic non-graphics utilities
  1754. X    /ctrl {        % (A) => ctrl A
  1755. X        0 get dup 96 gt {32 sub} if
  1756. X        64 sub
  1757. X    } def
  1758. X    /ascii { 0 get } def    % (A) => 65
  1759. X    /ESC    27 def
  1760. X    /CTRLX    (X) ctrl def
  1761. X    /SPEC    128 def
  1762. X    /BLANK    32 def
  1763. X    /bounds {        % r c => r c  (restrain)
  1764. X        exch LastRow min exch
  1765. X        LastCol min
  1766. X        exch 0 max exch
  1767. X        0 max
  1768. X    } def
  1769. X    /rc_xy {        % r c => x y
  1770. X        bounds
  1771. X        CharWidth mul exch
  1772. X        1 add Rows exch sub CharHeight mul
  1773. X    } def
  1774. X    /xy_rc {        % x y => r c
  1775. X        CharHeight idiv LastRow exch sub
  1776. X        exch CharWidth idiv
  1777. X        bounds
  1778. X    } def
  1779. X    /clrstring {        % string => -    % slow, used to init "blanks"
  1780. X        0 1 2 index length 1 sub
  1781. X            {1 index exch 32 put } for pop
  1782. X    } def
  1783. X    /blankline {    % Image row => -    % faster, uses "blanks"
  1784. X        blanks Cols string copy put
  1785. X    } def
  1786. X    /chartostring {        % 65 => (A)
  1787. X        ( ) dup 0 4 -1 roll put
  1788. X    } def
  1789. X
  1790. X
  1791. % Color definitions
  1792. X    /setcoloring {        % flag => -    (true for color)
  1793. X         {    /WHITE        0    0    1 hsbcolor def
  1794. X        /CYAN        .5    .3    1 hsbcolor def
  1795. X        /MAGENTA    .82    .3    1 hsbcolor def
  1796. X        /YELLOW        .165    .3    1 hsbcolor def
  1797. X        /BLUE        .6    .3    1 hsbcolor def
  1798. X        /RED        1    .3    1 hsbcolor def
  1799. X        /GREEN        .3    .3    1 hsbcolor def
  1800. X        /BLACK        0    0    0 hsbcolor def
  1801. X        /shade    {colortable exch get setcolor} def
  1802. X        }
  1803. X         {    /BLACK        0 def
  1804. X        /CYAN        .87 def
  1805. X        /MAGENTA    .8 def
  1806. X        /YELLOW        .95 def
  1807. X        /BLUE        .6 def
  1808. X        /RED        .7 def
  1809. X        /GREEN        .5 def
  1810. X        /WHITE        1 def
  1811. X        /shade    {colortable exch get setgray} def
  1812. X        } ifelse
  1813. X        /colortable [WHITE RED GREEN YELLOW
  1814. X                 BLUE MAGENTA CYAN BLACK] def
  1815. X    } def
  1816. X
  1817. X
  1818. % Low level drawing utilities (don't effect the image buffer).
  1819. X    /rc_moveto {rc_xy moveto} def    % r c => -
  1820. X    /showchar {        % r c int => -
  1821. X        gsave
  1822. X        Fgcolor 3 index get shade
  1823. X        3 -1 roll 3 -1 roll
  1824. X        rc_moveto
  1825. X        chartostring show
  1826. X        grestore
  1827. X    } def
  1828. X    /whitebox {        % r c count -   (for erasing characters)
  1829. X        gsave
  1830. X        Bgcolor 3 index get shade
  1831. X        3 -1 roll 3 -1 roll rc_xy translate
  1832. X        BoxWidth mul dup        % stack: width width
  1833. X        newpath
  1834. X        0 BoxBottom moveto
  1835. X        BoxBottom lineto
  1836. X        BoxTop lineto
  1837. X        0 BoxTop lineto
  1838. X        closepath fill
  1839. X        grestore
  1840. X    } def
  1841. X    /blackbox {        % r c -   (for text cursor)
  1842. X        gsave
  1843. X        Fgcolor 2 index get shade rc_xy translate
  1844. X        newpath
  1845. X        0 BoxBottom moveto
  1846. X        BoxWidth BoxBottom lineto
  1847. X        BoxWidth BoxTop lineto
  1848. X        0 BoxTop lineto
  1849. X        closepath fill
  1850. X        grestore
  1851. X    } def
  1852. X
  1853. X
  1854. % Text manipulation routines (effect cursor and image buffer).
  1855. % These can call the lower routines, but calling each other is
  1856. % risky (accidental recursion).
  1857. X    % text cursor
  1858. X    /tcursormove {        % r c => -
  1859. X        bounds
  1860. X        Tccol Cols lt {        % screen width may have changed
  1861. X            Tcrow Tccol 1 whitebox
  1862. X            Tcrow Tccol Image Tcrow get Tccol get showchar
  1863. X        } if
  1864. X        /Tccol exch store /Tcrow exch store
  1865. X        Tcrow Tccol blackbox
  1866. X        Tcrow Tccol rc_moveto
  1867. X        gsave
  1868. X        ColorDisplay?        % can't make grey chars on b&w
  1869. X            {Bgcolor Tcrow get shade}
  1870. X            {0 shade}
  1871. X        ifelse
  1872. X        Tcrow Tccol rc_moveto
  1873. X        Image Tcrow get Tccol get chartostring show
  1874. X        grestore
  1875. X    } def
  1876. X    % mouse cursor
  1877. X    /mcursorwait {        % when waiting for remote to position
  1878. X        /hourg /hourg_m ClientCanvas setstandardcursor
  1879. X    } def
  1880. X    /mcursornormal {
  1881. X        /ptr /ptr_m ClientCanvas setstandardcursor
  1882. X    } def
  1883. X    /remotemove {        % row col => -
  1884. X        /prefix_flag false store
  1885. X        1 index MessageLine eq {no_prefixes} {normal_prefixes} ifelse
  1886. X        tcursormove
  1887. X        mcursornormal
  1888. X    } def
  1889. X    /onmessageline? {
  1890. X        {Tcrow MessageLine eq} win send
  1891. X    } def
  1892. X    /putc {            % like overtypechar, but handles backspace
  1893. X        dup 8 eq {
  1894. X            pop
  1895. X            Tcrow Tccol 1 whitebox
  1896. X            Image Tcrow get Tccol 32 put
  1897. X            Tcrow Tccol 1 sub tcursormove }
  1898. X        {overtypechar}
  1899. X        ifelse
  1900. X    } def
  1901. X    /overtypechar {        % int => -    (at current)
  1902. X        Tcrow Tccol 1 whitebox
  1903. X        BoldFont setfont
  1904. X        Tcrow Tccol 2 index showchar
  1905. X        Image Tcrow get Tccol 2 index put
  1906. X        Tcrow Tccol 1 add tcursormove
  1907. X        NormalFont setfont
  1908. X        pop
  1909. X    } def
  1910. X    /insertchar {        % int => -    (at current location)
  1911. X        Image Tcrow get Tccol            % char line index
  1912. X        2 copy Cols Tccol sub 1 sub getinterval    % char line index tail
  1913. X        exch 1 add exch                % shift index
  1914. X        putinterval                % write tail
  1915. X        gsave
  1916. X        Tcrow Tccol Cols Tccol sub whitebox    % clear line
  1917. X        Tcrow Tccol rc_moveto
  1918. X        Fgcolor Tcrow get shade
  1919. X        Image Tcrow get Tccol Cols Tccol sub getinterval show
  1920. X        overtypechar                % put char
  1921. X        grestore
  1922. X    } def
  1923. X    /writechar {        % int => -
  1924. X        InsertMode {insertchar} {overtypechar} ifelse
  1925. X    } def
  1926. X    /fastputline {        % row string => -    (assume all cleared)
  1927. X        gsave
  1928. X        Fgcolor 2 index get shade
  1929. X        exch dup 0 rc_moveto
  1930. X        Image exch get copy show        % transfer text
  1931. X        grestore
  1932. X    } def
  1933. X    /putline {        % row string fgcol bgcol => -
  1934. X        gsave
  1935. X        Bgcolor 4 index 3 -1 roll put
  1936. X        Fgcolor 3 index 3 -1 roll put
  1937. X        Fgcolor 2 index get shade
  1938. X        Image 2 index blankline            % clear image line
  1939. X        Image 2 index get copy pop        % transfer text
  1940. X        dup 0 Cols whitebox            % clear screen line
  1941. X        dup 0 rc_moveto
  1942. X        Image exch get show
  1943. X        grestore
  1944. X    } def
  1945. X    /scroller {        % src dest count => -
  1946. X        Image 3 index 2 index getinterval
  1947. X        Image 3 index 3 -1 roll putinterval
  1948. X        1 index add 1 sub 1 exch {
  1949. X            dup 0 Cols whitebox
  1950. X            dup Image exch get fastputline
  1951. X        } for
  1952. X        pop    % src popped
  1953. X    } def
  1954. X    /imagetoscreen {    % display text buffer
  1955. X        gsave
  1956. X        clearpage
  1957. X        0 1 LastRow {
  1958. X            dup Fgcolor exch get shade
  1959. X            dup 0 rc_moveto
  1960. X            Image exch get show
  1961. X        } for
  1962. X        Tcrow Tccol tcursormove
  1963. X        grestore
  1964. X    } def
  1965. X    /clearpage {        % clear the display (not Image buffer)
  1966. X        0 1 LastRow {0 Cols whitebox} for
  1967. X    } def
  1968. X    /cls {            % clear text buffer and screen
  1969. X        0 1 LastRow {Image exch blankline} for
  1970. X        clearpage
  1971. X    } def
  1972. X    /clrscreen {        % all but message line
  1973. X        Image MessageLine get dup length string copy
  1974. X        cls
  1975. X        MessageLine exch fastputline
  1976. X    } def
  1977. X    /erase_eol {        % clear to end of line, from cursor
  1978. X        Image Tcrow get                % line
  1979. X        Tccol                    % index
  1980. X        blanks 0 Cols Tccol sub getinterval    % blanks
  1981. X        putinterval                % insert them
  1982. X        Tcrow Tccol Cols Tccol sub whitebox
  1983. X        Tcrow Tccol tcursormove
  1984. X    } def
  1985. X    /erase_eop {        % clear to end of page, from cursor
  1986. X        erase_eol
  1987. X        Tcrow 1 add 1 MessageLine {
  1988. X            Image 1 index blankline
  1989. X            0 Cols whitebox
  1990. X        } for
  1991. X    } def
  1992. X
  1993. X
  1994. X
  1995. X
  1996. X    % Window definition, menus, etc
  1997. X
  1998. X    /filemenu [
  1999. X        (find)        { [CTRLX (F) ctrl] sendarray }
  2000. X        (read)        { [CTRLX (R) ctrl] sendarray }
  2001. X        (insert)    { [CTRLX (I) ctrl] sendarray }
  2002. X        (view)        { [CTRLX (V) ctrl] sendarray }
  2003. X        (save)        { [CTRLX (S) ctrl] sendarray }
  2004. X        (write)        { [CTRLX (W) ctrl] sendarray }
  2005. X    ] /new DefaultMenu send def
  2006. X    /buffermenu [
  2007. X        (next)        { [CTRLX (X) ascii] sendarray }
  2008. X        (list)        { [CTRLX (B) ctrl] sendarray }
  2009. X        (select)    { [CTRLX (B) ascii] sendarray }
  2010. X        (kill)        { [CTRLX (K) ascii] sendarray }
  2011. X        (overtype mode)    { (\201SLover\n) sendarray }
  2012. X        (C mode)    { (\201SLcmode\n) sendarray }
  2013. X    ] /new DefaultMenu send def
  2014. X    /windowmenu [
  2015. X        (split)        { [CTRLX (2) ascii] sendarray }
  2016. X        (delete)    { [CTRLX (0) ascii] sendarray }
  2017. X        (delete others)    { [CTRLX (1) ascii] sendarray }
  2018. X        (redraw)    { [ESC (L) ctrl] sendarray }
  2019. X        (white)        { (\201SLwhite\n) sendarray }
  2020. X        (blue)        { (\201SLblue\n) sendarray }
  2021. X        (yellow)    { (\201SLyellow\n) sendarray }
  2022. X        (cyan)        { (\201SLcyan\n) sendarray }
  2023. X        (red)        { (\201SLred\n) sendarray }
  2024. X        (magenta)    { (\201SLmagenta\n) sendarray }
  2025. X        (green)        { (\201SLgreen\n) sendarray }
  2026. X    ] /new DefaultMenu send def
  2027. X    /searchmenu [
  2028. X        (search)        { [(S) ctrl] sendarray }
  2029. X        (reverse search)    { [(R) ctrl] sendarray }
  2030. X        (incremental search)    { [CTRLX (S) ascii] sendarray }
  2031. X        (reverse incremental search) { [CTRLX (R) ascii] sendarray }
  2032. X    ] /new DefaultMenu send def
  2033. X    /replacemenu [
  2034. X        (replace)    { [ESC (R) ascii] sendarray }
  2035. X        (query replace)    { [ESC (R) ctrl] sendarray }
  2036. X    ] /new DefaultMenu send def
  2037. X    /argmenu
  2038. X        [(prompt) (2) (3) (4) (5) (10) (100) (1000)]
  2039. X        [{[(U) ctrl] sendarray}
  2040. X         {[(U) ctrl] sendarray currentkey (    ) cvs sendarray}    ]
  2041. X    /new DefaultMenu send def
  2042. X    /pagemenu [
  2043. X        (beginning)    { [ESC (<) ascii] sendarray }
  2044. X        (end)        { [ESC (>) ascii] sendarray }
  2045. X        (next)        { [(V) ctrl] sendarray }
  2046. X        (previous)    { [(Z) ctrl] sendarray }
  2047. X    ] /new DefaultMenu send def
  2048. X    /miscmenu [
  2049. X        (bind function key) { [ESC (K) ascii] sendarray }
  2050. X        (color)        { {true setcoloring PaintClient} win send }
  2051. X        (B & W)        { {false setcoloring PaintClient} win send }
  2052. X    ] /new DefaultMenu send def
  2053. X    /globalmodemenu [
  2054. X        (overtype)    { (\201SGover\n) sendarray }
  2055. X        (insert)    { (\201RGover\n) sendarray }
  2056. X        (C mode)    { (\201SGcmode\n) sendarray }
  2057. X        (C mode off)    { (\201RGcmode\n) sendarray }
  2058. X        (white)        { (\201SGwhite\n) sendarray }
  2059. X        (blue)        { (\201SGblue\n) sendarray }
  2060. X        (yellow)    { (\201SGyellow\n) sendarray }
  2061. X        (cyan)        { (\201SGcyan\n) sendarray }
  2062. X        (red)        { (\201SGred\n) sendarray }
  2063. X        (magenta)    { (\201SGmagenta\n) sendarray }
  2064. X        (green)        { (\201SGgreen\n) sendarray }
  2065. X    ] /new DefaultMenu send def
  2066. X
  2067. X
  2068. X    % Mode menu support
  2069. X    /emacsmode {        % (OVER) flag => -    (false to reset)
  2070. X        [CTRLX (M) 4 -1 roll {ascii} {ctrl} ifelse] sendarray
  2071. X        sendarray (\n) sendarray
  2072. X    } def
  2073. X    /overtypemode {
  2074. X        /InsertMode false store
  2075. X        (overtype mode) /searchkey buffermenu send {
  2076. X            (insert mode) { (\201RLover\n) sendarray }
  2077. X            /changeitem buffermenu send
  2078. X        } if
  2079. X    } def
  2080. X    /insertmode {
  2081. X        /InsertMode true store
  2082. X        (insert mode) /searchkey buffermenu send {
  2083. X            (overtype mode) { (\201SLover\n) sendarray }
  2084. X            /changeitem buffermenu send
  2085. X        } if
  2086. X    } def
  2087. X    /cmodeon {
  2088. X        (\)}]#) {times exch default_short put} forall
  2089. X        (C mode) /searchkey buffermenu send {
  2090. X            (C mode off) { (\201RLcmode\n) sendarray }
  2091. X            /changeitem buffermenu send
  2092. X        } if
  2093. X    } def
  2094. X    /cmodeoff {
  2095. X        (\)}]#) {times exch default_long put} forall
  2096. X        (C mode off) /searchkey buffermenu send {
  2097. X            (C mode) { (\201SLcmode\n) sendarray }
  2098. X            /changeitem buffermenu send
  2099. X        } if
  2100. X    } def
  2101. X
  2102. X    /request_refresh    { [(L) ctrl] sendarray } def
  2103. X    /zap {
  2104. X        /unmap win send        % hide it in case we miss
  2105. X        [CTRLX (C) ctrl (Y) ascii] sendarray
  2106. X    } def
  2107. X
  2108. X
  2109. X
  2110. X
  2111. X    /win framebuffer /new DefaultWindow send def    % Create a window
  2112. X    /wincanvas {win /ClientCanvas get} def
  2113. X
  2114. X    % define window context
  2115. X    {
  2116. X        /State        0 def
  2117. X        /NormalFont    0 def
  2118. X        /BoldFont    0 def
  2119. X        /Rows        arg_rows 2 add def    % space for messages
  2120. X        /Cols        80 def
  2121. X        /LastRow    Rows 1 sub def
  2122. X        /LastCol    Cols 1 sub def
  2123. X        /MessageLine    Rows 2 sub def
  2124. X        /Fgcolor    [Rows {7} repeat] def
  2125. X        /Bgcolor    [Rows {0} repeat] def
  2126. X        /Tcrow        0 def        % text cursor location
  2127. X        /Tccol        0 def
  2128. X        /Image        Rows array def    
  2129. X        /Height        0 def
  2130. X        /Width        0 def
  2131. X        /CharHeight    0 def
  2132. X        /CharWidth    0 def
  2133. X        /BoxTop        0 def        % cursor and wipeout box
  2134. X        /BoxBottom    0 def
  2135. X        /BoxWidth    0 def
  2136. X        /OldFrame    [0 0] def    % to detect resize repaints
  2137. X        /InsertMode    true def    % local insert/overtype
  2138. X        /FrameLabel    (NeWS Distributed uEMACS) def
  2139. X        /framechanged? {    
  2140. X            OldFrame 0 get Width ne
  2141. X            OldFrame 1 get Height ne
  2142. X            or
  2143. X        } def
  2144. X        /trimwindow {        % so that it is multiple of char size
  2145. X            ClientCanvas setcanvas
  2146. X            clippath pathbbox 3 -1 roll pop 3 -1 roll pop
  2147. X            /Height exch store
  2148. X            Height Rows Height Rows div round mul sub
  2149. X            dup 0 ne
  2150. X            {    FrameHeight exch sub
  2151. X                /FrameHeight exch store
  2152. X                FrameX FrameY FrameWidth FrameHeight reshape }
  2153. X            {     pop }
  2154. X            ifelse
  2155. X        } def
  2156. X        /PaintClient {
  2157. X            stopeventtraps
  2158. X            trimwindow
  2159. X            initwindow
  2160. X            framechanged?
  2161. X            {    0 1 LastRow {Image exch Cols string put} for
  2162. X                request_refresh
  2163. X            }
  2164. X            {    imagetoscreen }
  2165. X            ifelse
  2166. X            starteventtraps
  2167. X        } def
  2168. X        /ClientMenu [
  2169. X            (Paging ...)    pagemenu
  2170. X            (Files ...)    filemenu
  2171. X            (Buffers ...)    buffermenu
  2172. X            (Windows ...)    windowmenu
  2173. X            (Global modes ...) globalmodemenu
  2174. X            (Search ...)    searchmenu
  2175. X            (Replace ...)    replacemenu
  2176. X            (Argument ...)    argmenu
  2177. X            (Miscellaneous ...) miscmenu
  2178. X            (quit)        { [CTRLX (C) ctrl] sendarray }
  2179. X            (save & exit)    { [ESC (Z) ascii] sendarray }
  2180. X        ] /new DefaultMenu send def
  2181. X    } win send
  2182. X
  2183. X    /initwindow {
  2184. X        /OldFrame [Width Height] store
  2185. X        ClientCanvas setcanvas
  2186. X        clippath pathbbox 3 -1 roll pop 3 -1 roll pop
  2187. X        /Height exch store /Width exch store
  2188. X        /CharHeight Height Rows div store
  2189. X        /NormalFont (Courier) findfont CharHeight scalefont store
  2190. X        /BoldFont (Courier-Oblique) findfont CharHeight scalefont store
  2191. X        NormalFont setfont
  2192. X        /CharWidth (A) stringwidth pop store
  2193. X        /Cols Width CharWidth idiv store
  2194. X        /LastCol Cols 1 sub store
  2195. X        /BoxWidth CharWidth store
  2196. X        gsave newpath 0 0 moveto ([|/) true charpath pathbbox 
  2197. X        /BoxTop exch 1 sub store pop pop pop    
  2198. X        gsave newpath 0 0 moveto (_py) true charpath pathbbox pop pop
  2199. X        /BoxBottom exch store pop
  2200. X        /BoxTop BoxTop CharHeight BoxBottom add max store
  2201. X        /blanks Cols string dup clrstring def
  2202. X            % Make the remote guy kill us
  2203. % Don't mess around with the frame or icon menus!
  2204. % They may not have selections called "Zap"!
  2205. % Use DestroyClient instead.
  2206. %        (Zap) /searchkey win /FrameMenu get send {
  2207. %            (Zap) {zap} /changeitem
  2208. %            win /FrameMenu get send
  2209. %        } if
  2210. %        (Zap) /searchkey win /IconMenu get send {
  2211. %            (Zap) {zap} /changeitem
  2212. %            win /IconMenu get send
  2213. %        } if
  2214. X        NormalFont setfont
  2215. X        /State currentstate store
  2216. X    } def
  2217. X
  2218. X    /DestroyClient {
  2219. X        zap
  2220. X        /DestroyClient super send
  2221. X    } def
  2222. X
  2223. X    /starteventtraps {
  2224. X    % Input dispatcher.  Catches all kbd input and mouse activity.
  2225. X    /dispatcher_pid {
  2226. X        wincanvas addkbdinterests pop
  2227. X        wincanvas addfunctionstringsinterest pop
  2228. X        createevent dup begin
  2229. X            /Name dictbegin
  2230. X                0 1 127 { dup def } for
  2231. X                /MiddleMouseButton dup def
  2232. X                /InsertValue dup def
  2233. X            dictend def
  2234. X            /Action /DownTransition def
  2235. X            /Canvas wincanvas def
  2236. X        end expressinterest
  2237. X        createevent dup begin
  2238. X            /Name dictbegin
  2239. X                /LeftMouseButton dup def
  2240. X                /MouseDragged dup def
  2241. X            dictend def
  2242. X            /Action null def
  2243. X            /Canvas wincanvas def
  2244. X        end expressinterest
  2245. X        systemdict /IP currentprocess put
  2246. X
  2247. X        % input loop
  2248. X        {    clear
  2249. X            awaitevent begin
  2250. X                % only ascii allowed on message line
  2251. X                onmessageline?
  2252. X                {keyeventdict Name known}
  2253. X                {eventdict Name known}
  2254. X                ifelse
  2255. X                {    % Invoke the right handler
  2256. X                    XLocation YLocation Action
  2257. X                    eventdict Name get exec
  2258. X                } if
  2259. X            end
  2260. X        } loop
  2261. X    } fork def
  2262. X
  2263. X    % Mouse still handler (derived from mouse drag event).
  2264. X    /stillmouse_pid {
  2265. X        createevent dup begin
  2266. X            /Name /MouseStill def
  2267. X            /Canvas wincanvas def
  2268. X        end expressinterest
  2269. X
  2270. X        % input loop
  2271. X        {    clear
  2272. X            awaitevent begin
  2273. X                128 addtobuf    % SPEC code
  2274. X                Xl Yl /xy_rc win send
  2275. X                exch addtobuf addtobuf
  2276. X                default_short outtimerrefresh
  2277. X            end
  2278. X        } loop
  2279. X    } fork def
  2280. X    } def
  2281. X
  2282. X    /stopeventtraps {
  2283. X        currentdict /dispatcher_pid known
  2284. X            {dispatcher_pid killprocess} if
  2285. X        currentdict /stillmouse_pid known
  2286. X            {stillmouse_pid killprocess} if
  2287. X    } def
  2288. X
  2289. X
  2290. X    % distribution mechanism: character timing and prefixes
  2291. SHAR_EOF
  2292. true || echo 'restore of news.cps failed'
  2293. echo 'End of Vile part 10'
  2294. echo 'File news.cps is continued in part 11'
  2295. echo 11 > _shar_seq_.tmp
  2296. exit 0
  2297. -- 
  2298.         paul fox, pgf@cayman.com, (617)494-1999
  2299.         Cayman Systems, 26 Landsdowne St., Cambridge, MA 02139
  2300.