# 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.319 2015/09/07 11:56:28 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?
enum
	"check-access"	CHK_ACCESS	0		!SMALLER # check file-access before source/exec
	"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
	"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
	"reuse-position" REUSE_POS	0		OPT_UPBUFF # reuse position when (re)creating scratch-buffers
	"ShowMatch"	SHOWMAT		0		# show matching braces during insert
	"ShowMoDe"	SHOWMODE	chgd_status	# show insert/replace/command mode
	"Spaces-After-Sentence" SPACESENT	0	# add two spaces after a
	"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"	WRAPSCAN	0		# wrap-around search mode
	"WrapWords"	WRAPWORDS	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-autocolor" PERCENT_AUTOCOLOR 0		OPT_COLOR&&!SMALLER # threshold for converting to DOS-mode
	"percent-crlf"	PERCENT_CRLF	chgd_percent	# threshold for converting to DOS-mode
	"percent-utf8"	PERCENT_UTF8	chgd_percent	OPT_MULTIBYTE # threshold for detecting UTF-16 or UTF-32 converting to UTF-8
	"record-length" RECORD_LENGTH	chgd_percent	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
	"backup-style"  BACKUPSTYLE	0		OPT_FILEBACK # file backup style
	"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
	"LineBreak"	LINEBREAK	chgd_window	OPT_LINEWRAP # when line-wrapping, pad display to avoid splitting words
	"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
bool
	"bchanged"	BCHANGED	1		"true if current buffer is changed"
	"debug"		DEBUG		1		"macro debugging"
	"discmd"	DISCMD		1		"display commands on command line"
	"disinp"	DISINP		1		"display command line input characters"
	"end-of-cmd"	EOC		1		"true if they ended the cmd with <CR>"
	"fchanged"	FCHANGED	!SMALLER	"true if current buffer's file is changed"
	"filename-ic"	FILENAME_IC	1		"true if we set OPT_CASELESS"
	"forward-search" FWD_SEARCH	1		"search-direction (true if forward)"
	"get-at-dot"	GET_AT_DOT	1		"true if token must have DOT when getting $identifier, etc., from screen"
	"get-it-all"	GET_IT_ALL	1		"true if full-token when getting $identifier, etc., from screen"
	"modified"	MODIFIED	1		"is current buffer modified?"
	"pending"	PENDING		1		"type ahead pending flag"
	"system-crlf"	SYSTEM_CRLF	1		"system uses CRLF by default"
	"term-resizes"	TERM_RESIZES	1		"true if terminal can be resized"
enum
	"cmd-encoding"	CMD_ENCODING	OPT_MULTIBYTE	"terminal's encoding support"
	"kbd-encoding"	KBD_ENCODING	OPT_MULTIBYTE	"terminal's keyboard encoding"
	"mode"		MODE		1		"are we inserting/overwriting/command"
	"term-encoding" TERM_ENCODING	OPT_MULTIBYTE	"terminal's encoding support"
	"title-encoding" TITLE_ENCODING	OPT_MULTIBYTE&&OPT_TITLE "xterm title encoding"
int
	"_"		_STATUS		OPT_EVAL	"function's result (external)"
	"bchars"	BCHARS		1		"chars in current buffer"
	"blines"	BLINES		1		"lines in current buffer"
	"bwindows"	BWINDOWS	1		"windows open on current buffer"
	"char"		CHAR		1		"current character under the cursor"
	"cmd-count"	CMD_COUNT	OPT_EVAL	"repeat-counter for macros"
	"curchar"	CURCHAR		!SMALLER	"current character index in buffer"
	"curcol"	CURCOL		1		"current column pos of cursor"
	"curline"	CURLINE		1		"current line in file"
	"cwline"	CWLINE		1		"current screen line in window"
	"empty-lines"	EMPTY_LINES	!SMALLER	"tabstop to use when interpreting %C"
	"error-tabstop"	ERROR_TABSTOP	OPT_FINDERR	"tabstop to use when interpreting %C"
	"get-length"	GET_LENGTH	1		"set as side-effect of getting $identifier, etc., from screen"
	"get-offset"	GET_OFFSET	1		"set as side-effect of getting $identifier, etc., from screen"
	"goal-column"	GOAL_COLUMN	OPT_TRACE	"goal-column (debug-only)"
	"lastkey"	LASTKEY		1		"last keyboard char struck"
	"kill-limit"	KILL_LIMIT	1		"maximum number of bytes to return in $kill"
	"kill-size"	KILL_SIZE	1		"number of bytes in kill buffer (read only)"
	"lcols"		LCOLS		1		"length of current line, in columns"
	"llength"	LLENGTH		1		"length of current line"
	"modeline-limit" MODELINE_LIMIT	OPT_MODELINE	"maximum inline offset to scan for modelines"
	"ncolors"	NCOLORS		1		"number of colors displayed"
	"ntildes"	NTILDES		1		"number of tildes displayed at eob"
	"pagelen"	PAGELEN		1		"number of lines used by editor"
	"pagewid"	CURWIDTH	1		"current screen width"
	"pid"		PROCESSID	1		"vile's process-id"
	"seed"		SEED		1		"current random number seed"
	"status"	STATUS		1		"returns the status of the last command"
	"term-cols"	TERM_COLS	1		"# of columns in terminal window"
	"term-lines"	TERM_LINES	1		"# of lines in terminal window"
	"wlines"	WLINES		1		"# of lines in current window"
regex
	"buf-fname-expr" BUF_FNAME_EXPR	OPT_CURTOKENS	"buffer+fname expression"
	"error-expr"	ERROR_EXPR	OPT_FINDERR	"last matched error pattern"
	"filename-expr"	FILENAME_EXPR	OPT_FINDERR	"regular expression for %F"
	"latin1-expr"	LATIN1_EXPR	OPT_MULTIBYTE	"regular expression matching language codes assumed to be Latin-1"
	"search"	SEARCH		1		"search pattern"
string
	"abufname"	ABUFNAME	1		"alternate buffer name (i.e. '#')"
	"autocolor-hook" AUTOCOLORHOOK	OPT_HOOKS&&OPT_COLOR	"procedure to run for auto-coloring"
	"bflags"	BFLAGS		1		"status flags for 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"
	"buffer-hook"	BUFHOOK		OPT_HOOKS	"procedure to run when entering buf"
	"bufname"	BUFNAME		OPT_CURTOKENS	"buffer name under cursor"
	"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"
	"cmd-motion"	CMD_MOTION	OPT_EVAL&&OPT_PROCEDURES  "motion for operator"
	"cryptkey"	CRYPTKEY	OPT_ENCRYPT	"write-only encryption-key"
	"cwd"		CWD		OPT_SHELL	"current directory"
	"directory"	DIRECTORY	OPT_SHELL	"controls location of temp-files"
	"encoding"	ENCODING	OPT_LOCALE	"8-bit encoding associated with buffer contents"
	"error-buffer"	ERROR_BUFFER	OPT_FINDERR	"buffer to use for find-next-error"
	"error-match"	ERROR_MATCH	OPT_FINDERR	"last matching text for error-pattern"
	"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"
	"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		1		"current font"
	"helpfile"	HELPFILE	1		"helpfile (vile.hlp)"
	"iconname"	ICONNAME	DISP_X11	"current icon-name"
	"identifier"	IDENTIFIER	OPT_CURTOKENS	"identifier under cursor"
	"kbd-macro"	KBDMACRO	1		"keyboard-macro buffer (read only)"
	"kill"		KILL		1		"kill buffer (read only)"
	"libdir-path"	LIBDIR_PATH	1		"library directory(s)"
	"line"		LINE		1		"text 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)"
	"modeline-format" MLFORMAT	OPT_MLFORMAT	"modeline format string"
	"ocwd"		OCWD		OPT_SHELL	"previous directory"
	"os"		OS		1		"what os are we on?"
	"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"
	"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)"
	"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., .)"
	"system-name"	SYSTEM_NAME	1		"operating system name"
	"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"
	"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"
"bchanged"	BCHANGED	1|STR|BRET	"return true if the given buffer has been modified"
"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?"
"fchanged"	FCHANGED	1|STR|BRET	"return true if the given file has been modified"
"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"
"get-key"	GET_KEY		0		"get 1 character"
"get-completion" GET_COMPLETE	2|STR|SRET	"prompt for completion from given category (b/c/d/f/t)"
"get-motion"	GET_MOTION	1|STR|SRET	"get keyboard-sequence (characters), result is motion's name"
"get-sequence"	GET_SEQ		0		"get keyboard-sequence (characters)"
"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'"
"regex-escape"	REGEX_ESCAPE	1|STR|SRET	"escape string as needed to use as regex constant"
"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
"le-assumed"	bom_LE_ASSUMED
"be-assumed"	bom_BE_ASSUMED
"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 cmd_encoding
"auto"		enc_AUTO
"ascii"		enc_POSIX
"8bit"		enc_8BIT
"utf-8"		enc_UTF8

.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

.table file_encoding				# see byteorder_mark
"locale"	enc_LOCALE
"auto"		enc_AUTO
"ascii"		enc_POSIX
"8bit"		enc_8BIT
"utf-8"		enc_UTF8
"utf-16"	enc_UTF16
"utf-32"	enc_UTF32

.table kbd_encoding				# see byteorder_mark
"locale"	enc_LOCALE
"auto"		enc_AUTO
"ascii"		enc_POSIX
"8bit"		enc_8BIT
"utf-8"		enc_UTF8

.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 access
"none"		0
"current"	FL_CDIR
"home"		FL_HOME
"bin"		FL_EXECDIR
"startup"	FL_STARTPATH
"path"		FL_PATH
"libdir"	FL_LIBDIR
"always"	FL_ALWAYS

.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
"register"	PT_REG
"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
"auto"		RS_AUTO
"default"	RS_DEFAULT
"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 title_encoding
"locale"	enc_LOCALE
"8bit"		enc_8BIT
"utf-8"		enc_UTF8

.table xcolors			OPT_EXTRA_COLOR
"enum"		XCOLOR_ENUM
"hypertext"	XCOLOR_HYPERTEXT
"isearch"	XCOLOR_ISEARCH
"linebreak"	XCOLOR_LINEBREAK
"linenumber"	XCOLOR_LINENUMBER
"modeline"	XCOLOR_MODELINE
"number"	XCOLOR_NUMBER
"regex"		XCOLOR_REGEX
"string"	XCOLOR_STRING
"warning"	XCOLOR_WARNING

.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
