File: modetbl

package info (click to toggle)
vile 9.6m-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 8,196 kB
  • ctags: 8,459
  • sloc: ansic: 90,876; lex: 9,514; sh: 3,223; cpp: 3,137; perl: 2,928; makefile: 785; awk: 276
file content (636 lines) | stat: -rw-r--r-- 28,262 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
# This file contains all of the editor's buffer and window modes
#
# It should be processed by the "mktbls" program, which produces the
#  headers #included by main.c
#
# All that is necessary to add a new mode to the editor is to add
#  an entry to this file, write the supporting code, and rebuild.
#
# If you want to know which modes are already taken, look
#  at nemode.h, after you build it.
#
# The modes are table entries in the BUFFER and WINDOW structures.
#
# $Header: /usr/build/vile/vile/RCS/modetbl,v 1.275 2008/05/05 20:59:46 tom Exp $
#
#
# Mode-table entries.  Capitalized letters are used for abbreviations.
# The second column is the root of the index-definition.
# The third column is flags used to control updates after a mode is changed.
# The fourth column (if present) controls conditional compilation of the mode.
.globals
bool							# GMD prefix
	"AllVersions"	ALL_VERSIONS	0		SYS_VMS # show all versions when globbing
	"AutoBuffer"	ABUFF		chgd_autobuf	# auto-buffer (lru)
	"cd-on-open"	CD_ON_OPEN	0		OPT_SHELL # set working directory to that containing each newly opened buffer
	"dirc"		DIRC		0		COMPLETE_DIRS # directory-completion (slow!)
	"Alt-TabPos"	ALTTABPOS	0		# emacs-style cursor positioning
	"echo-to-clipboard"	CBRD_ECHO	0	SYS_WINNT
	"expand-path"	EXPAND_PATH	0		# true iff %/# don't substitute shortened-path
	"ErrorBells"	ERRORBELLS	0		# audible/visible-bells
	"flash"		FLASH		0		OPT_FLASH # visible-bell (flash)
	"force-console"	FORCE_CONSOLE	0		SYS_WINNT&&DISP_NTWIN
	"glob"		GLOB		0		!OPT_GLOB_PIPE # enable/disable filename globbing
	"HIstory"	HISTORY		0		OPT_HISTORY # command-history
	"ImplyBuffer"	IMPLYBUFF	0		# imply-buffer (vi-like)
	"Insert-Exec"	INSEXEC		0		# allow ^F/^B, etc., to be interpreted during insert mode
	"mouse"		MOUSE		chgd_mouse	SYS_OS2 # mode to control whether we allow mouse-clicking
	"multibeep"	MULTIBEEP	0		# multiple successive identical failed motions all beep
	"maplonger"	MAPLONGER	0		# favor longer maps
	"pin-tagstack"	PIN_TAGSTACK	0		# tagstack push/pop ops are pinned to curwin
	"Popup-Choices"	POPUP_CHOICES	0		OPT_POPUPCHOICE&&!OPT_ENUM_MODES # popup buffer showing file-completion choices
	"Popup-Msgs"	POPUP_MSGS	0		OPT_POPUP_MSGS	# popup buffer when multiple messages emitted
	"popup-menu"	POPUPMENU	chgd_popupmenu	SYS_WINNT&&DISP_NTWIN # enable popup menu (win32)
	"ReadOnly-on-ReadOnly" RONLYRONLY	0	# set readonly mode for readonly files
	"remap"		REMAP		0		# should mappings be reapplied
	"remapfirst"	REMAPFIRST	0		# should 1st char of a map be remapped?
	"resolve-links"	RESOLVE_LINKS	0		defined(HAVE_SYMLINK)	# cache/resolve directory names (can be slow if NFS times-out)
	"ShowRam"	HEAPSIZE	0		OPT_HEAPSIZE	# show heap usage
	"SameBangs"	SAMEBANGS	0		# use same "!!" data for ^X-!
	"swap-title"	SWAPTITLE	chgd_swaptitle	OPT_TITLE	# title -> 'buffer - prognam'
	"working"	WORKING		chgd_working	OPT_WORKING	# "working" message
	"usefilelock"	USEFILELOCK	0		OPT_LCKFILES	# okay use filelocks
	"unique-buffers" UNIQ_BUFS	chgd_uniqbuf	# only one buffer per file
	"VIEW-on-ReadOnly" RONLYVIEW	0		# set view mode for readonly files
	"w32pipes"	W32PIPES	0		OPT_W32PIPES
	"warn-blanks"   WARNBLANKS	0		!SMALLER # warn if filename has blanks, etc.
	"warn-unread"	WARNUNREAD	0		# warn if quitting with unread buffers
	"warn-reread"	WARNREREAD	0		# warn before rereading a buffer
	"warn-rename"	WARNRENAME	0		# warn before renaming a buffer
	"xterm-fkeys"	XTERM_FKEYS	chgd_xtermkeys	# mode to control whether we recognize xterm's function-key modifiers
	"xterm-mouse"	XTERM_MOUSE	chgd_xterm	# mode to control whether we allow mouse-clicking
	"xterm-title"	XTERM_TITLE	chgd_swaptitle	OPT_TITLE	# mode to control whether we allow xterm title updates
	"SmoothScroll"	SMOOTH_SCROLL	0		# should we update even if there is typeahead?
	"Spaces-After-Sentence" SPACESENT	0	# add two spaces after a
enum
	"Color-Scheme"	COLOR_SCHEME	chgd_scheme	OPT_COLOR_SCHEMES # color palette combination
	"ccolor"	CCOLOR		chgd_color	OPT_COLOR	# cursor color
	"fcolor"	FCOLOR		chgd_color	OPT_COLOR	# foreground color
	"For-Buffers"	FOR_BUFFERS	0		OPT_FORBUFFERS_CHOICES	# for-buffers pattern style
	"bcolor"	BCOLOR		chgd_color	OPT_COLOR	# background color
	"mcolor"	MCOLOR		chgd_hilite	OPT_HILITEMATCH # modeline color
	"Mini-Hilite"   MINI_HILITE	0		# highlight minibuffer when using vi-commands
	"Popup-Choices"	POPUP_CHOICES	0		OPT_POPUPCHOICE&&OPT_ENUM_MODES # popup buffer showing file-completion choices
	"Reader-Policy"	READER_POLICY	0		# tell whether slowreadf() should be used if we run out of memory
	"video-attrs"	VIDEO		chgd_color	OPT_COLOR	# video attributes, especially reverse
	"vtflash"	VTFLASH		0		VTFLASH_HOST&&(OPT_FLASH) # flash using DEC VT esc sequences
int							# VAL_ prefix
	"maplength"	MAPLENGTH	0		# maximum length of :map string
	"printing-low"	PRINT_LOW	chgd_charset	# low end of high-bit-set printable range
	"printing-high"	PRINT_HIGH	chgd_charset	# high end of high-bit-set printable range
	"recent-files"	RECENT_FILES	chgd_rcntfiles	SYS_WINNT # how many recently visited files saved in registry
	"recent-folders" RECENT_FLDRS	chgd_rcntfldrs	SYS_WINNT # how many recently visited folders saved in registry
	"report"	REPORT		0		# threshold for reporting changes
	"scroll-pause"	SCROLLPAUSE	0		SYS_WINNT # how long to catnap after scrolling
	"timeoutlen"	TIMEOUTVAL	0		# how long to catnap for more input
	"timeoutlen-user" TIMEOUTUSERVAL 0		# how long to catnap for more input
regex							# VAL_ prefix
	"C-SUFfixes"	CSUFFIXES	0		!OPT_MAJORMODE # match against filenames to turn on c-mode
string							# VAL_ prefix
	"backup-style"  BACKUPSTYLE	0		OPT_FILEBACK # file backup style
	"expand-chars"	EXPAND_CHARS	0		# list of chars we can expand (%,#,:)
	"find-cfg"	FINDCFG		chgd_find_cfg	OPT_FINDPATH # configuration of the "find" feature
	"icursor"	ICURSOR		chgd_icursor	OPT_ICURSOR # specify insertion cursor
	"glob"		GLOB		0		OPT_GLOB_PIPE # select filename globbing style
	"redirect-keys"	REDIRECT_KEYS	chgd_redir_keys	SYS_WINNT&&defined(VILE_OLE) # send keys to another process

.buffers
bool							# MD prefix
	"animated"	UPBUFF		0		OPT_UPBUFF # update scratch-buffers
	"AutoIndent"	AIND		0		# auto-indent
	"AutoSave"	ASAVE		0		# auto-save mode
	"AutoWrite"	AUTOWRITE	0		# auto-write when shelling out
	"BackspaceLimit" BACKLIMIT	0		# backspace limited in insert mode
	"check-modtime" CHK_MODTIME	0		!SMALLER # check buffer-modtime
	"CIndent"	CINDENT		0		# c-style indent
	"cmode"		CMOD		chgd_win_mode	!OPT_MAJORMODE # C indentation and fence match
	"crypt"		CRYPT		chgd_major	OPT_ENCRYPT	# encrytion mode active
	"dos"		DOS		chgd_dos_mode	# "dos" mode -- lines end in crlf
	"FilterMsgs"	FILTERMSGS	0		OPT_MAJORMODE&&OPT_FILTER # Name of syntax-filter
	"HighLight"	HILITE		chgd_filter	OPT_MAJORMODE # true if we enable syntax highlighting
	"IgnoreCase"	IGNCASE		chgd_hilite	# Exact matching for searches
	"Rectangle-Insert-Mode" INS_RECTS 0		# insert or overwrite when changing rectangles
	"loading"	LOADING		0		# Are we asynchronously loading a file?
	"locked"	LOCKED		chgd_disabled	OPT_LCKFILES # mode locked
	"magic"		MAGIC		chgd_hilite	# regular expressions in search
	"Meta-Insert-Bindings" METAINSBIND 0		# honor meta bindings in insert mode
	"ModeLine"	MODELINE	0		OPT_MODELINE # modeline (selected :setl only) (vi-style)
	"NewLine"	NEWLINE		chgd_buffer	# trailing newline (vi-style)
	"ReadOnly"	READONLY	chgd_major	# allow writing the buffer
	"ShowMatch"	SHOWMAT		0		# show matching braces during insert
	"ShowMoDe"	SHOWMODE	chgd_status	# show insert/replace/command mode
	"TabInsert"	TABINSERT	0		# okay to insert tab chars
	"TagignoreCase"	TAGIGNORECASE	0		!SMALLER # ignore upper/lower case in tags
	"TagRelative"	TAGSRELTIV	0		# tags are relative to tagsfile path
	"TagWord"	TAGWORD		0		# apply tag to whole word, not only string at cursor
	"terse"		TERSE		0		# be terse -- suppress messages
	"view"		VIEW		chgd_major	# read-only buffer
	"overlap-matches"  HILITEOVERLAP	chgd_hilite	OPT_HILITEMATCH # highlight all search matches
	"UndoAble"	UNDOABLE	chgd_undoable	# changes to buffer are undoable (or not)
	"Undo-Dos-Trim"	UNDO_DOS_TRIM	0		# changes to buffer made when setting dosmode are undoable (or not)
	"WrapScan"	SWRAP		0		# wrap-around search mode
	"WrapWords"	WRAP		0		# word wrap
	"YankMotion"	YANKMOTION	0		# honor vi-style motion after yanking text
enum
	"ByteOrder-Mark" BYTEORDER_MARK	chgd_byteorder	OPT_MULTIBYTE # byte-order-mark
	"file-encoding"	FILE_ENCODING	chgd_fileencode	OPT_MULTIBYTE # file-encoding
	"cursor-tokens"	CURSOR_TOKENS	0		OPT_CURTOKENS # specify whether to use regex/cclass for cursor tokens
	"record-format" RECORD_FORMAT	0		SYS_VMS	# specify record-format to use
	"record-attrs"	RECORD_ATTRS	0		SYS_VMS	# specify record-attributes to use
	"RecordSeparator" RECORD_SEP	chgd_rs		# record-separator affects dos/unix modes
	"ShowFormat"	SHOW_FORMAT	chgd_window	# show record-separator
	"visual-matches"  HILITEMATCH	chgd_hilite	OPT_HILITEMATCH # highlight all search matches
int							# VAL_ prefix
	"AutoColor"	AUTOCOLOR	0		OPT_COLOR&&!SMALLER # auto color
	"AutoSaveCNT"	ASAVECNT	0		# how often auto-saves occur
	"C-ShiftWidth"	C_SWIDTH	0		!OPT_MAJORMODE # shift-width for C buffers
	"C-TabStop"	C_TAB		chgd_win_mode	!OPT_MAJORMODE # tab spacing for C buffers
	"fence-limit"	FENCE_LIMIT	0		OPT_MAJORMODE # fence iteration-limit
	"FillCol"	FILL		0		# column for paragraph reformat, and line break
	"ModeLineS"	MODELINES	0		OPT_MODELINE # modeline (selected :setl only) (vi-style)
	"percent-crlf"	PERCENT_CRLF	0		# threshold for converting to DOS-mode
	"percent-utf8"	PERCENT_UTF8	0		OPT_MULTIBYTE # threshold for detecting UTF-16 or UTF-32 converting to UTF-8
	"record-length" RECORD_LENGTH	0		SYS_VMS	# specify record-length to use
	"ShiftWidth"	SWIDTH		0		# shiftwidth for ^T/^D/<</>>
	"TabStop"	TAB		chgd_win_mode	# tab spacing for most buffers
	"TagLength"	TAGLEN		0		# required significant length for tag lookups
	"UndoLimit"	UNDOLIM		0		# how much undo stack is saved
	"WrapMargin"	WRAPMARGIN	0		# width of right margin for autowrap
string							# VAL_ prefix
	"CIndent-Chars"	CINDENT_CHARS	0		# c-style indent flags
	"FENCE-pairS"	FENCES		chgd_fences	# pairs of fences {,}; (,); etc.
	"FilterName"	FILTERNAME	0		OPT_MAJORMODE # Name of syntax-filter
	"locker"	LOCKER		chgd_disabled	OPT_LCKFILES  # Name of locker
	"tags"		TAGS		0		# list of tags files
regex							# VAL_ prefix
	"bufname-expr"	BUFNAME_EXPR	chgd_curtokens	OPT_CURTOKENS # $bufname
	"comments"	COMMENTS	0		# matches leading comment for comment reformatting
	"comment-prefix" CMT_PREFIX	0		# prefix to ignore/preserve when formatting comment
	"fence-begin"	FENCE_BEGIN	0		# begin a simple (character, non-nestable) fence
	"fence-end"	FENCE_END	0		# end a simple fence
	"fence-if"	FENCE_IF	0		# begin a complex (line, nestable) fence
	"fence-elif"	FENCE_ELIF	0		# next complex fence
	"fence-else"	FENCE_ELSE	0		# final complex fence
	"fence-fi"	FENCE_FI	0		# end a complex fence
	"identifier-expr" IDENTIFIER_EXPR 0		OPT_CURTOKENS # $identifier
	"pathname-expr" PATHNAME_EXPR	chgd_curtokens	OPT_CURTOKENS # $pathname
	"paragraphs"	PARAGRAPHS	0		# delimits a paragraph
	"sections"	SECTIONS	0		# delimits a section
	"sentences"	SENTENCES	0		# delimits a sentence
	"IgnoreSuffix"	STRIPSUFFIX	0		OPT_MAJORMODE # strip pattern before matching majormode suffix

.windows
bool							# WMD prefix
	"LIst"		LIST		chgd_window	# "list" mode -- show tabs and EOL
	"HorizScroll"	HORSCROLL	0		# scroll whole screen
	"LineWrap"	LINEWRAP	chgd_window	OPT_LINEWRAP # wrap lines wider than screen
	"NUmber"	NUMBER		chgd_window	# line-numbers shown
	"ruler"		RULER		chgd_status	!SMALLER # display line+col in modeline
	"ShowChar"	SHOWCHAR	chgd_status	!SMALLER # display $char in modeline
	"ShowVariables"	SHOWVARS	0		!SMALLER # update [Variables] with cursor-movement
	"Unprintable-as-Octal" NONPRINTOCTAL  chgd_window # print non-printing chars in octal
	"Unicode-as-Hex" UNICODE_AS_HEX	chgd_window	OPT_MULTIBYTE # print Unicode chars as hexadecimal even if displayable
	"Terse-SELections" TERSELECT	0		OPT_SELECTIONS # don't display extent of selections on message line
int							# VAL_ prefix
	"SIDEways"	SIDEWAYS	chgd_window	# sideways offset for display

# Put the majormode definitions after buffers to simplify logic in mktbls.
# The arguments of .majormode are the predefined majormodes and submodes.

.majormode c	tabstop
.majormode c	shiftwidth
.majormode vile
enum
	"qualifiers"	QUALIFIERS	0		# denotes how preamble/suffixes are combined
regex							# MVAL_ prefix
	"PREamble"	PREAMBLE	0		# match against file header to turn on mode
	"Mode-Pathname"	MODE_PATHNAME	0		# match against pathnames to turn on mode
	"Mode-Filename"	MODE_FILENAME	0		# match against filenames to turn on mode
	"SUFfixes"	MODE_SUFFIXES	0		# match against filename's suffix to turn on mode
string
	"before"	BEFORE		chgd_mm_order	# check mode before given
	"after"		AFTER		chgd_mm_order	# check mode after given
#	"mode-wildcard" MODE_WILDCARD	0		# e.g., "*.c"

.qualifier
string
	"name"		NAME		0
	"group"		GROUP		0

# special cases for abbreviations which do not correspond to actual characters
.abbr
	"file-encoding"	"fk"

#
# The "environment" variables are similar to modes, but are not so neatly
# organized into groups of universal/buffer/window.
.environment
"_"		_STATUS		OPT_EVAL	"function's result (external)"
"abufname"	ABUFNAME	1		"alternate buffer name (i.e. '#')"
"autocolor-hook" AUTOCOLORHOOK	OPT_HOOKS&&OPT_COLOR	"procedure to run for auto-coloring"
"bchars"	BCHARS		1		"chars in current buffer"
"bflags"	BFLAGS		1		"status flags for current buffer"
"blines"	BLINES		1		"lines in current buffer"
"brightness"	BRIGHTNESS	DISP_NTWIN	"intensity of normal, bold"
"buf-encoding"	BUF_ENCODING	OPT_MULTIBYTE	"buffer's encoding, derived from file-encoding, buffer content and locale"
"buf-fname-expr" BUF_FNAME_EXPR	OPT_CURTOKENS	"buffer+fname expression"
"buffer-hook"	BUFHOOK		OPT_HOOKS	"procedure to run when entering buf"
"bufname"	BUFNAME		OPT_CURTOKENS	"buffer name under cursor"
"bwindows"	BWINDOWS	1		"windows open on current buffer"
"cbufname"	CBUFNAME	1		"current buffer name"
"cd-hook"	CDHOOK		OPT_HOOKS	"procedure to run when cd'ing"
"cdpath"	CDPATH		OPT_PATHLOOKUP	"runtime copy of CDPATH env var"
"cfgopts"	CFGOPTS		1		"'interesting' compiled options (comma-delimited)"
"cfilname"	CFNAME		1		"current file name"
"char"		CHAR		1		"current character under the cursor"
"cmd-count"	CMD_COUNT	OPT_EVAL	"repeat-counter for macros"
"cryptkey"	CRYPTKEY	OPT_ENCRYPT	"write-only encryption-key"
"curchar"	CURCHAR		!SMALLER	"current character index in buffer"
"curcol"	CURCOL		1		"current column pos of cursor"
"curline"	CURLINE		1		"current line in file"
"cwd"		CWD		OPT_SHELL	"current directory"
"cwline"	CWLINE		1		"current screen line in window"
"debug"		DEBUG		1		"macro debugging"
"directory"	DIRECTORY	OPT_SHELL	"controls location of temp-files"
"discmd"	DISCMD		1		"display commands on command line"
"disinp"	DISINP		1		"display command line input characters"
"encoding"	ENCODING	OPT_LOCALE	"8-bit encoding associated with buffer contents"
"end-of-cmd"	EOC		1		"true if they ended the cmd with <CR>"
"error-buffer"	ERROR_BUFFER	OPT_FINDERR	"buffer to use for find-next-error"
"error-expr"	ERROR_EXPR	OPT_FINDERR	"last matched error pattern"
"error-match"	ERROR_MATCH	OPT_FINDERR	"last matching text for error-pattern"
"error-tabstop"	ERROR_TABSTOP	OPT_FINDERR	"tabstop to use when interpreting %C"
"exec-path"	EXEC_PATH	1		"directory where vile's executable is found"
"exec-suffix"	EXEC_SUFFIX	1		"suffix to append when looking for execable programs"
"exit-hook"	EXITHOOK	OPT_HOOKS	"procedure to run when quitting"
"favorites"	FAVORITES	SYS_WINNT	"path to favorites directory"
"filename-expr"	FILENAME_EXPR	OPT_FINDERR	"regular expression for %F"
"filename-ic"	FILENAME_IC	1		"true if we set OPT_CASELESS"
"filter-list"	FILTER_LIST	OPT_FILTER	"list of builtin-filters"
"find-cmd"	FINDCMD		OPT_FINDPATH	"shell cmd emitted via 'find' feature (debug)"
"findpath"	FINDPATH	OPT_FINDPATH	"directory(s) used with 'find' feature"
"font"		FONT		DISP_X11||DISP_NTWIN	"current font"
"forward-search" FWD_SEARCH	1		"search-direction (true if forward)"
"goal-column"	GOAL_COLUMN	OPT_TRACE	"goal-column (debug-only)"
"helpfile"	HELPFILE	1		"helpfile (vile.hlp)"
"iconname"	ICONNAME	DISP_X11	"current font"
"identifier"	IDENTIFIER	OPT_CURTOKENS	"identifier under cursor"
"kbd-macro"	KBDMACRO	1		"keyboard-macro buffer (read only)"
"kill"		KILL		1		"kill buffer (read only)"
"lastkey"	LASTKEY		1		"last keyboard char struck"
"lcols"		LCOLS		1		"length of current line, in columns"
"libdir-path"	LIBDIR_PATH	1		"library directory(s)"
"line"		LINE		1		"text of current line"
"llength"	LLENGTH		1		"length of current line"
"locale"	LOCALE		OPT_LOCALE	"8-bit locale associated with buffer contents"
"majormode"	MAJORMODE	OPT_MAJORMODE "current majormode, if any"
"majormode-hook" MAJORMODEHOOK	OPT_HOOKS&&OPT_MAJORMODE	"procedure to run for majormodes"
"match"		MATCH		1		"last matched magic pattern"
"menu-file"	MENU_FILE	OPT_MENUS	"the name of the menu-file (e.g., .vilemenu)"
"mode"		MODE		1		"are we inserting/overwriting/command"
"modeline-format" MLFORMAT	OPT_MLFORMAT	"modeline format string"
"modified"	MODIFIED	1		"is current buffer modified?"
"ncolors"	NCOLORS		1		"number of colors displayed"
"ntildes"	NTILDES		1		"number of tildes displayed at eob"
"ocwd"		OCWD		OPT_SHELL	"previous directory"
"os"		OS		1		"what os are we on?"
"pagelen"	PAGELEN		1		"number of lines used by editor"
"pagewid"	CURWIDTH	1		"current screen width"
"palette"	PALETTE		1		"current palette string"
"patchlevel"	PATCHLEVEL	1		"current patch-level of vile (empty for release)"
"pathlist-separator" PATHCHR	1		"separator for lists of pathnames"
"pathname"	PATHNAME	OPT_CURTOKENS	"path-like word under cursor"
"pathname-separator" PATHSEP	1		"separator for levels of pathnames"
"pending"	PENDING		1		"type ahead pending flag"
"pid"		PROCESSID	1		"vile's process-id"
"position-format" POSFORMAT	OPT_POSFORMAT	"position format string"
"progname"	PROGNAME	1		"returns current prog name - 'vile'"
"prompt"	PROMPT		1		"command-prompt string - ': '"
"qidentifier"	QIDENTIFIER	1		"current qualified identifier"
"read-hook"	RDHOOK		OPT_HOOKS	"procedure to run when reading"
"replace"	REPLACE		1		"replacement pattern"
"return"	RETURN		OPT_EVAL	"function's return-result (internal)"
"search"	SEARCH		1		"search pattern"
"seed"		SEED		1		"current random number seed"
"shell"		SHELL		OPT_SHELL	"shell-environment variable"
"sres"		SRES		1		"current screen resolution"
"startup-file"	STARTUP_FILE	1		"the name of the startup-file (e.g., .vilerc)"
"startup-path"	STARTUP_PATH	1		"where to find the startup-file (e.g., .)"
"status"	STATUS		1		"returns the status of the last command"
"term-encoding" TERM_ENCODING	OPT_MULTIBYTE	"terminal's encoding support"
"title"		TITLE		OPT_TITLE	"window title"
"title-format"	TITLEFORMAT	OPT_TITLE	"window title format"
"version"	VERSION		1		"current version number"
"with-prefix"	WITHPREFIX	OPT_EVAL	"current '~with' prefix"
"wlines"	WLINES		1		"# of lines in current window"
"word"		WORD		1		"current word"
"write-hook"	WRHOOK		OPT_HOOKS	"procedure to run when writing"
"xdisplay"	XDISPLAY	DISP_X11&&OPT_SHELL	"X Windows display, etc."
"xshell"	XSHELL		DISP_X11&&OPT_SHELL	"xterm emulator, etc."
"xshell-flags"	XSHELLFLAGS	DISP_X11&&OPT_SHELL	"$xshell flags, e.g., '-c'"

# function name, id, numargs
.functions
"abs"		ABS		1|NUM|NRET	"absolute value of a number"
"add"		ADD		2|NUM|NRET	"add two numbers together"
"and"		AND		2|BOOL|BRET	"logical and"
"ascii"		ASCII		1|NRET		"char to integer conversion"
"bind"		BIND		1|STR|SRET	"lookup what function name is bound to a key"
"cat"		CAT		2|STR|SRET	"concatenate string"
"cclass"	CCLASS		1|STR|SRET	"character-class"
"chr"		CHR		1|NUM		"integer to char conversion"
"classof"	CLASSOF		1|STR|SRET	"class of (various types)"
"cmatch"	CMATCH		2|STR|BRET	"caseless regular expression check"
"date"		DATE		2|NUM|SRET	"formatted date/timestamp"
"default"	DEFAULT		1|STR|SRET	"return initial/default value for mode or state-variable"
"divide"	DIV		2|NUM|NRET	"division"
"dquery"	DQUERY		2|STR|SRET	"query the user, given default value"
"env"		ENV		1|STR|SRET	"retrieve a system environment var"
"equal"		EQUAL		2|NUM|BRET	"logical equality check"
"error"		ERROR		1|STR|BRET	"check if parameter was the ERROR token"
"execable"	EXECABLE	1|BRET		"is a file executable?"
"filter"	FILTER		1|STR|BRET	"check if internal filter exists"
"ftime"		FTIME		1|STR|NRET	"file-timestamp (last-modified)"
"geq"		GEQ		2|NUM|BRET	"logical greater than or equal"
"global"	GLOBMODE	1|STR|SRET	"retrieve global setting"
"greater"	GREATER		2|NUM|BRET	"logical greater than"
"gt"		GT		2|NUM|BRET	"logical greater than (greater)"
"gtkey"		GTKEY		0		"get 1 character"
"gtmotion"	GTMOTION	1|STR|SRET	"get keyboard-sequence (characters), result is motion's name"
"gtsequence"	GTSEQ		0		"get keyboard-sequence (characters)"
"indirect"	INDIRECT	1|STR|SRET	"evaluate indirect value"
"isa"		ISA		2|STR|BRET	"test classification of an identifier"
"left"		LEFT		2|STR|SRET	"left string(string, len)"
"length"	LENGTH		1|NRET		"string length"
"leq"		LEQ		2|NUM|BRET	"logical less than or equal"
"lessthan"	LESS		2|NUM|BRET	"logical less than"
"local"		LOCMODE		1|STR|SRET	"retrieve local setting"
"lookup"	LOOKUP		2|STR|SRET	"lookup an external file"
"lower"		LOWER		1|STR|SRET	"lower case string"
"lt"		LT		2|NUM|BRET	"logical less than (lessthan)"
"match"		MATCH		2|STR|BRET	"regular expression check"
"mclass"	MCLASS		1|STR|SRET	"mode-class"
"middle"	MID		3|STR|SRET	"mid string(string, pos, len)"
"modulo"	MOD		2|NUM|NRET	"modulo"
"negate"	NEG		1|NUM|NRET	"negate"
"neq"		NEQ		2|NUM|BRET	"logical not equal"
"not"		NOT		1|BOOL|BRET	"logical not"
"or"		OR		2|BOOL|BRET	"logical or"
"path"		PATH		2|STR|SRET	"transform pathnames"
"pcat"		PATHCAT		2|STR|SRET	"concat directory and filename"
"pquote"	PATHQUOTE	1|STR|SRET	"quote pathname if needed"
"qpasswd"	QPASSWD		1|STR|SRET	"query user for password, echo '*'"
"query"		QUERY		1|STR|SRET	"query the user"
"random"	RANDOM		1|NUM|NRET	"get a random number"
"rd"		RD		1|BRET		"is a file readable?"
"readable"	READABLE	1|BRET		"is a file readable?"
"register"	REGISTER	1|STR|SRET	"register, e.g. 'a'"
"right"		RIGHT		2|STR|SRET	"right string(string, pos)"
"rnd"		RND		1|NUM|NRET	"get a random number"
"sequal"	SEQUAL		2|STR|BRET	"string logical equality check"
"sgeq"		SGEQ		2|STR|BRET	"string greater than or equal"
"sgreater"	SGREAT		2|STR|BRET	"string logical greater than"
"sgt"		SGT		2|STR|BRET	"string logical greater than (sgreater)"
"sindex"	SINDEX		2|NRET		"find the index of one string in another"
"sleq"		SLEQ		2|STR|BRET	"string less than or equal"
"sless"		SLESS		2|STR|BRET	"string logical less than"
"slt"		SLT		2|STR|BRET	"string logical less than (sless)"
"sneq"		SNEQ		2|STR|BRET	"string not equal"
"stime"		STIME		0|NRET		"system-timestamp"
"stoken"	STOKEN		3|BRET		"find a token in a string, given delims"
"subtract"	SUB		2|NUM|NRET	"subtraction"
"times"		TIMES		2|NUM|NRET	"multiplication"
"token"		TOKEN		3|STR|SRET	"select n'th token of string, given delims"
"translate"	TRANS		3|STR|SRET	"translate string, changing chars from 2nd to 3rd param"
"trim"		TRIM		1|STR|SRET	"trims leading/trailing/repeated whitespace"
"upper"		UPPER		1|STR|SRET	"uppercase string"
"word"		WORD		2|STR|SRET	"select n'th word of string"
"writable"	WRITABLE	1|BRET		"is a file writeable?"

.table backup
"off"		bak_OFF
".bak"		bak_BAK
"tilde"		bak_TILDE	SYS_UNIX
"tilde_n_existing" bak_TILDE_N0	VILE_SOMEDAY
"tilde_n"	bak_TILDE_N	VILE_SOMEDAY

.table bool
"false"		FALSE
"true"		TRUE
"off"		FALSE
"on"		TRUE

.table byteorder_mark				# see file_encoding
"auto"		ENUM_UNKNOWN
"none"		bom_NONE
"utf-8"		bom_UTF8
"utf-16le"	bom_UTF16LE
"utf-16be"	bom_UTF16BE
"utf-32le"	bom_UTF32LE
"utf-32be"	bom_UTF32BE

# These names are a little cryptic because I'm squeezing them into an 80-column
# display for show-printable -TD
.table charclass		OPT_SHOW_CTYPE
"upr"		vl_UPPER
"lwr"		vl_LOWER
"num"		vl_DIGIT
"sp"		vl_SPACE
"ctl"		vl_CNTRL
"del"		vl_BSPACE
"prn"		vl_PRINT
"pun"		vl_PUNCT
"id"		vl_IDENT
"path"		vl_PATHN
"wld"		vl_WILD
"arg"		vl_LINESPEC
"fn"		vl_FENCE
"nsp"		vl_NONSPACE
"qid"		vl_QIDENT
"tmp"		vl_SCRTCH	OPT_WIDE_CTYPES
"sh"		vl_SHPIPE	OPT_WIDE_CTYPES

.table color
"fcolor"	ENUM_FCOLOR	DISP_X11
"default"	ENUM_UNKNOWN
"black"		0
"red"		1
"green"		2
"yellow"	3		!OPT_16_COLOR
"brown"		3		OPT_16_COLOR
"blue"		4
"magenta"	5
"cyan"		6
"white"		7		!OPT_16_COLOR
"lightgray"	7		OPT_16_COLOR
"gray"		8		OPT_16_COLOR
"brightred"	9		OPT_16_COLOR
"brightgreen"	10		OPT_16_COLOR
"yellow"	11		OPT_16_COLOR
"brightblue"	12		OPT_16_COLOR
"brightmagenta"	13		OPT_16_COLOR
"brightcyan"	14		OPT_16_COLOR
"white"		15		OPT_16_COLOR

.table curtokens		OPT_CURTOKENS
"both"		CT_BOTH
"cclass"	CT_CCLASS
"regex"		CT_REGEX

.table directive		!SMALLER
"if"		D_IF
"elseif"	D_ELSEIF
"else"		D_ELSE
"endif"		D_ENDIF
"goto"		D_GOTO
"return"	D_RETURN
"while"		D_WHILE
"endwhile"	D_ENDWHILE
"break"		D_BREAK
"force"		D_FORCE
"hidden"	D_HIDDEN
"quiet"		D_QUIET
"local"		D_LOCAL
"with"		D_WITH
"elsewith"	D_ELSEWITH
"endwith"	D_ENDWITH
"endm"		D_ENDM
"trace"		D_TRACE

# FIXME: this table should be generated from runtime locale
.table file_encoding				# see byteorder_mark
"locale"	enc_LOCALE
"auto"		ENUM_UNKNOWN
"ascii"		enc_POSIX
"8bit"		enc_8BIT
"utf-8"		enc_UTF8
"utf-16"	enc_UTF16
"utf-32"	enc_UTF32

.table forbuffers
"glob"		FB_GLOB
"mixed"		FB_MIXED
"regex"		FB_REGEX

.table hilite
"bold"		VABOLD
"color"		VACOLOR
"italic"	VAITAL
"none"		0
"reverse"	VAREV
"underline"	VAUL
"black"		VACOL_0		OPT_COLOR
"red"		VACOL_1		OPT_COLOR
"green"		VACOL_2		OPT_COLOR
"yellow"	VACOL_3		OPT_COLOR&&!OPT_16_COLOR
"brown"		VACOL_3		OPT_COLOR&&OPT_16_COLOR
"blue"		VACOL_4		OPT_COLOR
"magenta"	VACOL_5		OPT_COLOR
"cyan"		VACOL_6		OPT_COLOR
"white"		VACOL_7		OPT_COLOR&&!OPT_16_COLOR
"lightgray"	VACOL_7		OPT_COLOR&&OPT_16_COLOR
"gray"		VACOL_8		OPT_COLOR&&OPT_16_COLOR
"brightred"	VACOL_9		OPT_COLOR&&OPT_16_COLOR
"brightgreen"	VACOL_A		OPT_COLOR&&OPT_16_COLOR
"yellow"	VACOL_B		OPT_COLOR&&OPT_16_COLOR
"brightblue"	VACOL_C		OPT_COLOR&&OPT_16_COLOR
"brightmagenta"	VACOL_D		OPT_COLOR&&OPT_16_COLOR
"brightcyan"	VACOL_E		OPT_COLOR&&OPT_16_COLOR
"white"		VACOL_F		OPT_COLOR&&OPT_16_COLOR

.table lookup
"readable"	FL_READABLE
"writable"	FL_WRITEABLE
"execable"	FL_EXECABLE
"current"	FL_CDIR
"home"		FL_HOME
"bin"		FL_EXECDIR
"startup"	FL_STARTPATH
"path"		FL_PATH
"libdir"	FL_LIBDIR

.table mmqualifiers		OPT_MAJORMODE
"any"		MMQ_ANY
"all"		MMQ_ALL

.table paramtypes
"bool"		PT_BOOL
"buffer"	PT_BUFFER
"directory"	PT_DIR
"enum"		PT_ENUM
"file"		PT_FILE
"integer"	PT_INT
"majormode"	PT_MAJORMODE	OPT_MAJORMODE
"mode"		PT_MODE
"string"	PT_STR
"variable"	PT_VAR

.table path
"head"		PATH_HEAD
"tail"		PATH_TAIL
"root"		PATH_ROOT
"end"		PATH_END
"short"		PATH_SHORT
"full"		PATH_FULL

.table popup
"delayed"	POPUP_CHOICES_DELAYED
"immediate"	POPUP_CHOICES_IMMED
"off"		POPUP_CHOICES_OFF

.table readerpolicy
"both"		RP_BOTH
"quick"		RP_QUICK
"slow"		RP_SLOW

.table recordformat		SYS_VMS
"udf"		FAB$C_UDF
"fix"		FAB$C_FIX
"var"		FAB$C_VAR
"vfc"		FAB$C_VFC
"stm"		FAB$C_STM
"stmlf"		FAB$C_STMLF
"stmcr"		FAB$C_STMCR

.table recordattrs		SYS_VMS
"none"		RECORD_ATTRS(0,0,0,0)
"ftn"		RECORD_ATTRS(1,0,0,0)
"cr"		RECORD_ATTRS(0,1,0,0)
"prn"		RECORD_ATTRS(0,0,1,0)
"blk"		RECORD_ATTRS(0,0,0,1)
"ftn,cr"	RECORD_ATTRS(1,1,0,0)
"ftn,prn"	RECORD_ATTRS(1,0,1,0)
"ftn,blk"	RECORD_ATTRS(1,0,0,1)
"cr,prn"	RECORD_ATTRS(0,1,1,0)
"cr,blk"	RECORD_ATTRS(0,1,0,1)
"prn,blk"	RECORD_ATTRS(0,0,1,1)
"ftn,cr,prn"	RECORD_ATTRS(1,1,1,0)
"ftn,cr,blk"	RECORD_ATTRS(1,1,0,1)
"cr,prn,blk"	RECORD_ATTRS(0,1,1,1)
"ftn,prn,blk"	RECORD_ATTRS(1,0,1,1)
"ftn,cr,prn,blk" RECORD_ATTRS(1,1,1,1)

.table recordsep
"default"	RS_AUTO
"cr"		RS_CR
"crlf"		RS_CRLF
"lf"		RS_LF

.table showformat
"always"	SF_ALWAYS
"differs"	SF_DIFFERS
"foreign"	SF_FOREIGN
"local"		SF_LOCAL
"never"		SF_NEVER

.table videoattrs		OPT_COLOR
"bold"		VABOLD
"italic"	VAITAL
"none"		0
"reverse"	VAREV
"underline"	VAUL

.table vtflashseq		OPT_FLASH
"off"		VTFLASH_OFF
"reverse"	VTFLASH_REVERSE
"normal"	VTFLASH_NORMAL