diff options
Diffstat (limited to 'modules/lua')
-rw-r--r-- | modules/lua/api | 182 | ||||
-rw-r--r-- | modules/lua/lua.luadoc | 641 | ||||
-rw-r--r-- | modules/lua/tags | 28 |
3 files changed, 616 insertions, 235 deletions
diff --git a/modules/lua/api b/modules/lua/api index 6101bb9f..31eacc01 100644 --- a/modules/lua/api +++ b/modules/lua/api @@ -325,7 +325,7 @@ XPM_IMAGES textadept.editing.XPM_IMAGES (table)\nMap of image names to registere _BUFFERS _G._BUFFERS (table)\nTable of all open buffers in Textadept.\nNumeric keys have buffer values and buffer keys have their associated numeric\nkeys.\n@see _G.buffer _CHARSET _G._CHARSET (string)\nThe filesystem's character encoding.\nThis is used when working with files. _G _G._G (module)\nLua _G module. -_G _G._G (table)\nA global variable (not a function) that holds the global environment\n(see §2.2). Lua itself does not use this variable; changing its value does\nnot affect any environment, nor vice-versa. +_G _G._G (table)\nA global variable (not a function) that holds the global environment\n(see §2.2). Lua itself does not use this variable; changing its value does\nnot affect any environment, nor vice versa. _HOME _G._HOME (string)\nThe path to Textadept's home, or installation, directory. _L _G._L (module)\nMap of all messages used by Textadept to their localized form.\nIf the table does not contain the localized version of a given message, it\nreturns a string that starts with "No Localization:" via a metamethod. _LEXBYLINE lexer.lexer._LEXBYLINE (table)\nIndicates the lexer can only process one whole line of text\n (instead of an arbitrary chunk of text) at a time.\n The default value is `false`. Line lexers cannot look ahead to subsequent\n lines. @@ -335,7 +335,7 @@ _RELEASE _G._RELEASE (string)\nThe Textadept release version string. _RULES lexer.lexer._RULES (table)\nA map of rule name keys with their associated LPeg pattern\n values for the lexer.\n This is constructed from the lexer's `_rules` table and accessible to other\n lexers for embedded lexer applications like modifying parent or child\n rules. _SCINTILLA _G._SCINTILLA (module)\nScintilla constants, functions, and properties.\nDo not modify anything in this module. Doing so will have unpredictable\nconsequences. _USERHOME _G._USERHOME (string)\nThe path to the user's *~/.textadept/* directory, where all preferences and\nuser-data is stored.\nOn Windows machines *~/* is the value of the "USERHOME" environment\nvariable (typically *C:\Users\username\\* or\n*C:\Documents and Settings\username\\*). On Linux, BSD, and Mac OSX\nmachines *~/* is the value of "$HOME" (typically */home/username/* and\n*/Users/username/* respectively). -_VERSION _G._VERSION (string)\nA global variable (not a function) that holds a string containing the\ncurrent interpreter version. The current contents of this variable is\n"`Lua 5.2`". +_VERSION _G._VERSION (string)\nA global variable (not a function) that holds a string containing the\ncurrent interpreter version. The current value of this variable is\n"`Lua 5.3`". _VIEWS _G._VIEWS (table)\nTable of all views in Textadept.\nNumeric keys have view values and view keys have their associated numeric\nkeys.\n@see _G.view _cancel_current textadept.snippets._cancel_current()\nCancels the active snippet, removing all inserted text. _fold lexer.lexer._fold (table)\nIf this function exists in the lexer, it is called for folding\n the document instead of using `_foldsymbols` or indentation. @@ -347,7 +347,7 @@ _print ui._print(buffer_type, ...)\nPrints the given string messages to the buff _rules lexer.lexer._rules (table)\nAn ordered list of rules for a lexer grammar.\n Each rule is a table containing an arbitrary rule name and the LPeg pattern\n associated with the rule. The order of rules is important as rules are\n matched sequentially.\n Child lexers should not use this table to access and/or modify their\n parent's rules and vice-versa. Use the `_RULES` table instead. _select textadept.snippets._select()\nPrompts the user to select a snippet to be inserted from a list of global and\nlanguage-specific snippets. _tokenstyles lexer.lexer._tokenstyles (table)\nA map of non-predefined token names to styles.\n Remember to use token names, not rule names. It is recommended to use\n predefined styles or color-agnostic styles derived from predefined styles\n to ensure compatibility with user color themes. -abs math.abs(x)\nReturns the absolute value of `x`. +abs math.abs(x)\nReturns the absolute value of `x`. (integer/float) abspath lfs.abspath(filename, prefix)\nReturns the absolute path to string *filename*.\n*prefix* or `lfs.currentdir()` is prepended to a relative filename. The\nreturned path is not guaranteed to exist.\n@param filename The relative or absolute path to a file.\n@param prefix Optional prefix path prepended to a relative filename.\n@return string absolute path acos math.acos(x)\nReturns the arc cosine of `x` (in radians). add_selection buffer.add_selection(buffer, end_pos, start_pos)\nSelects the range of text between positions *start_pos* to *end_pos* as the\nmain selection, retaining all other selections as additional selections.\nSince an empty selection still counts as a selection, use\n`buffer.set_selection()` first when setting a list of selections.\n@param buffer A buffer.\n@param end_pos The caret position of the range of text to select in *buffer*.\n@param start_pos The anchor position of the range of text to select in\n *buffer*.\n@see set_selection @@ -376,12 +376,12 @@ api_files textadept.editing.api_files (table)\nMap of lexer names to API documen append_text buffer.append_text(buffer, text)\nAppends string *text* to the end of the buffer without modifying any existing\nselections or scrolling the text into view.\n@param buffer A buffer.\n@param text The text to append. arg _G.arg (table)\nTable of command line parameters passed to Textadept.\n@see args args _G.args (module)\nProcesses command line arguments for Textadept. -arshift bit32.arshift(x, disp)\nReturns the number `x` shifted `disp` bits to the right. The number `disp`\nmay be any representable integer. Negative displacements shift to the left.\n\nThis shift operation is what is called arithmetic shift. Vacant bits on the\nleft are filled with copies of the higher bit of `x`; vacant bits on the\nright are filled with zeros. In particular, displacements with absolute\nvalues higher than 31 result in zero or `0xFFFFFFFF` (all original bits are\nshifted out). +arshift bit32.arshift(x, disp)\nReturns the number `x` shifted `disp` bits to the right. The number `disp`\nmay be any representable integer. Negative displacements shift to the left.\n\nThis shift operation is what is called arithmetic shift. Vacant bits on the\nleft are filled with copies of the higher bit of `x`; vacant bits on the\nright are filled with zeros. In particular, displacements with absolute\nvalues higher than 31 result in zero or `0xFFFFFFFF` (all original bits are\nshifted out).\n\nNew in Lua 5.2.\nDeprecated in Lua 5.3. ascii lexer.ascii (pattern)\nA pattern that matches any ASCII character (codes 0 to 127). asin math.asin(x)\nReturns the arc sine of `x` (in radians). -assert _G.assert(v [, message])\nIssues an error when the value of its argument `v` is false (i.e.,\nnil or false); otherwise, returns all its arguments. `message` is an error\nmessage; when absent, it defaults to "assertion failed!" -atan math.atan(x)\nReturns the arc tangent of `x` (in radians). -atan2 math.atan2(y, x)\nReturns the arc tangent of `y/x` (in radians), but uses the signs\nof both parameters to find the quadrant of the result. (It also handles\ncorrectly the case of `x` being zero.) +assert _G.assert(v [, message])\nCalls `error` if the value of its argument `v` is false (i.e., nil or false);\notherwise, returns all its arguments. In case of error, `message` is the\nerror object; when absent, it defaults to "assertion failed!". +atan math.atan(y [, x])\nReturns the arc tangent of `y/x` (in radians), but uses the signs\nof both parameters to find the quadrant of the result. (It also handles\ncorrectly the case of `x` being zero.)\n\nThe default value for `x` is 1, so that the call `math.atan(y)` returns the\narc tangent of `y`. +atan2 math.atan2(y, x)\nReturns the arc tangent of `y/x` (in radians), but uses the signs\nof both parameters to find the quadrant of the result. (It also handles\ncorrectly the case of `x` being zero.)\n\nDeprecated in Lua 5.3. attributes lfs.attributes(filepath [, aname])\nReturns a table with the file attributes corresponding to filepath (or nil\nfollowed by an error message in case of error). If the second optional\nargument is given, then only the value of the named attribute is returned\n(this use is equivalent to lfs.attributes(filepath).aname, but the table is\nnot created and only one attribute is retrieved from the O.S.). The\nattributes are described as follows; attribute mode is a string, all the\nothers are numbers, and the time related attributes use the same time\nreference of os.time:\n dev: on Unix systems, this represents the device that the inode resides on.\n On Windows systems, represents the drive number of the disk containing\n the file\n ino: on Unix systems, this represents the inode number. On Windows systems\n this has no meaning\n mode: string representing the associated protection mode (the values could\n be file, directory, link, socket, named pipe, char device, block\n device or other)\n nlink: number of hard links to the file\n uid: user-id of owner (Unix only, always 0 on Windows)\n gid: group-id of owner (Unix only, always 0 on Windows)\n rdev: on Unix systems, represents the device type, for special file inodes.\n On Windows systems represents the same as dev\n access: time of last access\n modification: time of last data modification\n change: time of last file status change\n size: file size, in bytes\n blocks: block allocated for file; (Unix only)\n blksize: optimal file system I/O blocksize; (Unix only)\n\nThis function uses stat internally thus if the given filepath is a symbolic\nlink, it is followed (if it points to another link the chain is followed\nrecursively) and the information is about the file it refers to. To obtain\ninformation about the link itself, see function lfs.symlinkattributes. auto_c_active buffer.auto_c_active(buffer)\nReturns whether or not an autocompletion or user list is visible.\n@param buffer A buffer.\n@return bool auto_c_auto_hide buffer.auto_c_auto_hide (bool)\nAutomatically cancel an autocompletion or user list when no entries match\ntyped text.\nThe default value is `true`. @@ -409,20 +409,20 @@ autocomplete textadept.editing.autocomplete(name)\nDisplays an autocompletion li autocompleters textadept.editing.autocompleters (table)\nMap of autocompleter names to autocompletion functions.\nNames are typically lexer names and autocompletion functions typically\nautocomplete symbols.\nAutocompletion functions must return two values: the number of characters\nbehind the caret that are used as the prefix of the entity to autocomplete,\nand a list of completions to show. Autocompletion lists are sorted\nautomatically.\n@see autocomplete back_space_un_indents buffer.back_space_un_indents (bool)\nUn-indent text when backspacing within indentation.\nThe default value is `false`. back_tab buffer.back_tab(buffer)\nUn-indents the text on the selected lines.\n@param buffer A buffer. -band bit32.band(...)\nReturns the bitwise "and" of its operands. +band bit32.band(...)\nReturns the bitwise "and" of its operands.\n\nNew in Lua 5.2.\nDeprecated in Lua 5.3. begin_undo_action buffer.begin_undo_action(buffer)\nStarts a sequence of actions to be undone or redone as a single action.\nMay be nested.\n@param buffer A buffer. bit32 _G.bit32 (module)\nLua bit32 module. block_comment textadept.editing.block_comment()\nComments or uncomments the selected lines based on the current language.\nAs long as any part of a line is selected, the entire line is eligible for\ncommenting/uncommenting.\n@see comment_string -bnot bit32.bnot(x)\nReturns the bitwise negation of `x`. For any integer `x`, the following\nidentity holds:\n\n assert(bit32.bnot(x) == (-1 - x) % 2^32) +bnot bit32.bnot(x)\nReturns the bitwise negation of `x`. For any integer `x`, the following\nidentity holds:\n\n assert(bit32.bnot(x) == (-1 - x) % 2^32)\n\nNew in Lua 5.2.\nDeprecated in Lua 5.3. bookmarks textadept.bookmarks (module)\nBookmarks for Textadept. -bor bit32.bor(...)\nReturns the bitwise "or" of its operands. +bor bit32.bor(...)\nReturns the bitwise "or" of its operands.\n\nNew in Lua 5.2.\nDeprecated in Lua 5.3. brace_bad_light buffer.brace_bad_light(buffer, pos)\nHighlights the character at position *pos* as an unmatched brace character\nusing the `'style.bracebad'` style.\nRemoves highlighting when *pos* is `-1`.\n@param buffer A buffer.\n@param pos The position in *buffer* to highlight, or `-1` to remove the\n highlight. brace_bad_light_indicator buffer.brace_bad_light_indicator(buffer, use_indicator, indicator)\nHighlights unmatched brace characters with indicator number *indicator*, in\nthe range of `0` to `31`, instead of the\n`buffer.STYLE_BRACEBAD` style if *use_indicator* is `true`.\n@param buffer A buffer.\n@param use_indicator Whether or not to use an indicator.\n@param indicator The indicator number to use. brace_highlight buffer.brace_highlight(buffer, pos1, pos2)\nHighlights the characters at positions *pos1* and *pos2* as matching braces\nusing the `'style.bracelight'` style.\nIf indent guides are enabled, locates the column with `buffer.column` and\nsets `buffer.highlight_guide` in order to highlight the indent guide.\n@param buffer A buffer.\n@param pos1 The first position in *buffer* to highlight.\n@param pos2 The second position in *buffer* to highlight. brace_highlight_indicator buffer.brace_highlight_indicator(buffer, use_indicator, indicator)\nHighlights matching brace characters with indicator number *indicator*, in\nthe range of `0` to `31`, instead of the\n`buffer.STYLE_BRACELIGHT` style if *use_indicator* is `true`.\n@param buffer A buffer.\n@param use_indicator Whether or not to use an indicator.\n@param indicator The indicator number to use. brace_match buffer.brace_match(buffer, pos)\nReturns the position of the matching brace for the brace character at\nposition *pos*, taking nested braces into account, or `-1`.\nThe brace characters recognized are '(', ')', '[', ']', '{', '}', '<', and\n'>' and must have the same style.\n@param buffer A buffer.\n@param pos The position of the brace in *buffer* to match.\n@return number braces textadept.editing.braces (table)\nTable of brace characters to highlight, with language-specific brace\ncharacter tables assigned to a lexer name key.\nThe ASCII values of brace characters are keys and are assigned non-`nil`\nvalues. The default brace characters are '(', ')', '[', ']', '{', and '}'. -btest bit32.btest(...)\nReturns a boolean signaling whether the bitwise "and" of its operands is\ndifferent from zero. +btest bit32.btest(...)\nReturns a boolean signaling whether the bitwise "and" of its operands is\ndifferent from zero.\n\nNew in Lua 5.2.\nDeprecated in Lua 5.3. buffer _G.buffer (module)\nA Textadept buffer object.\nConstants are documented in the fields they apply to.\nWhile you can work with individual buffer instances, it is really only useful\nto work with the global one. buffer _G.buffer (table)\nThe current buffer in the current view. buffer view.buffer (table)\nThe buffer the view contains. (Read-only) @@ -430,7 +430,7 @@ buffered_draw buffer.buffered_draw (bool)\nBuffer drawing to avoid flickering.\n bufstatusbar_text ui.bufstatusbar_text (string, Write-only)\nThe text displayed in the buffer statusbar. build textadept.run.build()\nBuilds the current project (based on the buffer's filename or the current\nworking directory) using the shell command from the `build_commands` table.\nIf a "makefile" type of build file is found, prompts the user for the full\nbuild command.\nEmits `BUILD_OUTPUT` events.\n@see build_commands\n@see _G.events build_commands textadept.run.build_commands (table)\nMap of project root paths and "makefiles" to their associated "build" shell\ncommand line strings or functions that return such strings. -byte string.byte(s [, i [, j]])\nReturns the internal numerical codes of the characters `s[i]`, `s[i+1]`,\n..., `s[j]`. The default value for `i` is 1; the default value for `j`\nis `i`. These indices are corrected following the same rules of function\n`string.sub`.\n\nNumerical codes are not necessarily portable across platforms. +byte string.byte(s [, i [, j]])\nReturns the internal numerical codes of the characters `s[i]`, `s[i+1]`,\n···, `s[j]`. The default value for `i` is 1; the default value for `j`\nis `i`. These indices are corrected following the same rules of function\n`string.sub`.\n\nNumerical codes are not necessarily portable across platforms. call_tip_active buffer.call_tip_active(buffer)\nReturns whether or not a call tip is visible.\n@param buffer A buffer.\n@return bool call_tip_cancel buffer.call_tip_cancel(buffer)\nRemoves a call tip from view.\n@param buffer A buffer. call_tip_fore_hlt buffer.call_tip_fore_hlt (number, Write-only)\nA call tip's highlighted text foreground color, in "0xBBGGRR" format. @@ -452,8 +452,9 @@ caret_period buffer.caret_period (number)\nThe time between caret blinks in mill caret_sticky buffer.caret_sticky (number)\nThe caret's preferred horizontal position when moving between lines.\n\n* `buffer.CARETSTICKY_OFF`\n Use the same position the caret had on the previous line.\n* `buffer.CARETSTICKY_ON`\n Use the last position the caret was moved to via the mouse, left/right\n arrow keys, home/end keys, etc. Typing text does not affect the position.\n* `buffer.CARETSTICKY_WHITESPACE`\n Use the position the caret had on the previous line, but prior to any\n inserted indentation.\n\nThe default value is `buffer.CARETSTICKY_OFF`. caret_style buffer.caret_style (number)\nThe caret's visual style.\n\n* `buffer.CARETSTYLE_INVISIBLE`\n No caret.\n* `buffer.CARETSTYLE_LINE`\n A line caret.\n* `buffer.CARETSTYLE_BLOCK`\n A block caret.\n\nThe default value is `buffer.CARETSTYLE_LINE`. caret_width buffer.caret_width (number)\nThe line caret's pixel width in insert mode, either `0`, `1`, `2`, or `3`.\nThe default value is `1`. -ceil math.ceil(x)\nReturns the smallest integer larger than or equal to `x`. +ceil math.ceil(x)\nReturns the smallest integral value larger than or equal to `x`. char string.char(···)\nReceives zero or more integers. Returns a string with length equal to\nthe number of arguments, in which each character has the internal numerical\ncode equal to its corresponding argument.\n\nNumerical codes are not necessarily portable across platforms. +char utf8.char(···)\nReceives zero or more integers, converts each one to its corresponding UTF-8\nbyte sequence and returns a string with the concatenation of all these\nsequences.\n\nNew in Lua 5.3. char_at buffer.char_at (table, Read-only)\nTable of character bytes at positions starting from zero. char_left buffer.char_left(buffer)\nMoves the caret left one character.\n@param buffer A buffer. char_left_extend buffer.char_left_extend(buffer)\nMoves the caret left one character, extending the selected text to the new\nposition.\n@param buffer A buffer. @@ -462,6 +463,7 @@ char_matches textadept.editing.char_matches (table)\nMap of auto-paired characte char_right buffer.char_right(buffer)\nMoves the caret right one character.\n@param buffer A buffer. char_right_extend buffer.char_right_extend(buffer)\nMoves the caret right one character, extending the selected text to the new\nposition.\n@param buffer A buffer. char_right_rect_extend buffer.char_right_rect_extend(buffer)\nMoves the caret right one character, extending the rectangular selection to\nthe new position.\n@param buffer A buffer. +charpattern utf8.charpattern (string)\nThe pattern (a string, not a function) "\0-\x7F\xC2-\xF4*"\n(see §6.4.1), which matches exactly one UTF-8 byte sequence, assuming that\nthe subject is a valid UTF-8 string.\n\nNew in Lua 5.3. chdir lfs.chdir(path)\nChanges the current working directory to the given path.\n\nReturns true in case of success or nil plus an error string. choose_caret_x buffer.choose_caret_x(buffer)\nIdentifies the current horizontal caret position as the caret's preferred\nhorizontal position when moving between lines.\n@param buffer A buffer.\n@see caret_sticky clear buffer.clear(buffer)\nDeletes the selected text or the character at the caret.\n@param buffer A buffer. @@ -479,7 +481,9 @@ close spawn_proc:close()\nCloses standard input for process *spawn_proc*, effect close_all_buffers io.close_all_buffers()\nCloses all open buffers, prompting the user to continue if there are unsaved\nbuffers, and returns `true` if the user did not cancel.\nNo buffers are saved automatically. They must be saved manually.\n@return `true` if user did not cancel.\n@see io.close_buffer close_buffer io.close_buffer()\nCloses the current buffer, prompting the user to continue if there are\nunsaved changes, and returns `true` if the buffer was closed.\n@return `true` if the buffer was closed; `nil` otherwise. cntrl lexer.cntrl (pattern)\nA pattern that matches any control character (ASCII codes 0 to 31). -collectgarbage _G.collectgarbage([opt [, arg]])\nThis function is a generic interface to the garbage collector. It\nperforms different functions according to its first argument, `opt`:\n "collect": performs a full garbage-collection cycle. This is the default\n option.\n "stop": stops automatic execution of the garbage collector.\n "restart": restarts automatic execution of the garbage collector.\n "count": returns the total memory in use by Lua (in Kbytes) and a second\n value with the total memory in bytes modulo 1024. The first value\n has a fractional part, so the following equality is always true:\n\n k, b = collectgarbage("count")\n assert(k*1024 == math.floor(k)*1024 + b)\n\n (The second result is useful when Lua is compiled with a non\n floating-point type for numbers.)\n "step": performs a garbage-collection step. The step "size" is controlled\n by `arg` (larger values mean more steps) in a non-specified way. If\n you want to control the step size you must experimentally tune the\n value of `arg`. Returns true if the step finished a collection\n cycle.\n "setpause": sets `arg` as the new value for the *pause* of the collector\n (see §2.5). Returns the previous value for *pause*.\n "setstepmul": sets `arg` as the new value for the *step multiplier*\n of the collector (see §2.5). Returns the previous value for\n *step*.\n "isrunning": returns a boolean that tells whether the collector is running\n (i.e., not stopped).\n "generational": changes the collector to generational mode. This is an\n experimental feature (see §2.5).\n "incremental": changes the collector to incremental mode. This is the\n default mode. +codepoint utf8.codepoint(s [, i [, j]])\nReturns the codepoints (as integers) from all characters in `s` that start\nbetween byte position `i` and `j` (both included). The default for `i` is 1\nand for `j` is `i`. It raises an error if it meets any invalid byte sequence.\n\nNew in Lua 5.3. +codes utf8.codes(s)\nReturns values so that the construction\n\n for p, c in utf8.codes(s) do *body* end\n\nwill iterate over all characters in string `s`, with `p` being the position\n(in bytes) and `c` the code point of each character. It raises an error if it\nmeets any invalid byte sequence.\n\nNew in Lua 5.3. +collectgarbage _G.collectgarbage([opt [, arg]])\nThis function is a generic interface to the garbage collector. It\nperforms different functions according to its first argument, `opt`:\n "collect": performs a full garbage-collection cycle. This is the default\n option.\n "stop": stops automatic execution of the garbage collector.\n "restart": restarts automatic execution of the garbage collector.\n "count": returns the total memory in use by Lua in Kbytes. The value has a\n fractional part, so that it multiplied by 1024 gives the exact\n number of bytes in use by Lua (except for overflows).\n "step": performs a garbage-collection step. The step "size" is controlled\n by `arg`. With a zero value, the collector will perform one basic\n (indivisible) step. For non-zero values, the collector will perform\n as if that amount of memory (in KBytes) had been allocated by Lua.\n Returns true if the step finished a collection cycle.\n "setpause": sets `arg` as the new value for the *pause* of the collector\n (see §2.5). Returns the previous value for *pause*.\n "setstepmul": sets `arg` as the new value for the *step multiplier*\n of the collector (see §2.5). Returns the previous value for\n *step*.\n "isrunning": returns a boolean that tells whether the collector is running\n (i.e., not stopped). colourise buffer.colourise(buffer, start_pos, end_pos)\nInstructs the lexer to style and mark fold points in the range of text\nbetween *start_pos* and *end_pos*.\nIf *end_pos* is `-1`, styles and marks to the end of the buffer.\n@param buffer A buffer.\n@param start_pos The start position of the range of text in *buffer* to\n process.\n@param end_pos The end position of the range of text in *buffer* to process,\n or `-1` to process from *start_pos* to the end of *buffer*. column buffer.column (table, Read-only)\nTable of column numbers (taking tab widths into account) for positions\nstarting from zero.\nMulti-byte characters count as single characters. command_entry ui.command_entry (module)\nTextadept's Command Entry. @@ -487,7 +491,7 @@ comment_string textadept.editing.comment_string (table)\nMap of lexer names to l compile textadept.run.compile()\nCompiles the current file based on its extension or language using the\nshell command from the `compile_commands` table.\nEmits `COMPILE_OUTPUT` events.\n@see compile_commands\n@see _G.events compile_commands textadept.run.compile_commands (table)\nMap of file extensions or lexer names to their associated "compile" shell\ncommand line strings or functions that return such strings.\nCommand line strings may have the following macros:\n\n + `%f` or `%(filename)`: The file's name, including its extension.\n + `%e` or `%(filename_noext)`: The file's name, excluding its extension.\n + `%d` or `%(filedir)`: The current file's directory path.\n + `%(filepath)`: The current file's full path. concat table.concat(list [, sep [, i [, j]]])\nGiven a list where all elements are strings or numbers, returns the string\n`list[i]..sep..list[i+1] ··· sep..list[j]`. The default value for `sep` is\nthe empty string, the default for `i` is 1, and the default for `j` is\n`#list`. If `i` is greater than `j`, returns the empty string. -config package.config (string)\nA string describing some compile-time configurations for packages. This\nstring is a sequence of lines:\n The first line is the directory separator string. Default is '`\`' for\n Windows and '`/`' for all other systems.\n The second line is the character that separates templates in a path.\n Default is '`;`'.\n The third line is the string that marks the substitution points in a\n template. Default is '`?`'.\n The fourth line is a string that, in a path in Windows, is replaced by\n the executable's directory. Default is '`!`'.\n The fifth line is a mark to ignore all text before it when building the\n `luaopen_` function name. Default is '`-`'. +config package.config (string)\nA string describing some compile-time configurations for packages. This\nstring is a sequence of lines:\n The first line is the directory separator string. Default is '`\`' for\n Windows and '`/`' for all other systems.\n The second line is the character that separates templates in a path.\n Default is '`;`'.\n The third line is the string that marks the substitution points in a\n template. Default is '`?`'.\n The fourth line is a string that, in a path in Windows, is replaced by\n the executable's directory. Default is '`!`'.\n The fifth line is a mark to ignore all text after it when building the\n `luaopen_` function name. Default is '`-`'.\n\nNew in Lua 5.2. connect events.connect(event, f, index)\nAdds function *f* to the set of event handlers for event *event* at position\n*index*.\nIf *index* not given, appends *f* to the set of handlers. *event* may be any\narbitrary string and does not need to have been previously defined.\n@param event The string event name.\n@param f The Lua function to connect to *event*.\n@param index Optional index to insert the handler into.\n@usage events.connect('my_event', function(msg) ui.print(msg) end)\n@see disconnect constants _SCINTILLA.constants (table)\nMap of Scintilla constant names to their numeric values.\n@see _G.buffer context_menu textadept.menu.context_menu (table)\nThe default right-click context menu. @@ -503,9 +507,9 @@ copy_range buffer.copy_range(buffer, start_pos, end_pos)\nCopies the range of te copy_text buffer.copy_text(buffer, text)\nCopies string *text* to the clipboard.\n@param buffer A buffer.\n@param text The text to copy. coroutine _G.coroutine (module)\nLua coroutine module. cos math.cos(x)\nReturns the cosine of `x` (assumed to be in radians). -cosh math.cosh(x)\nReturns the hyperbolic cosine of `x`. +cosh math.cosh(x)\nReturns the hyperbolic cosine of `x`.\n\nDeprecated in Lua 5.3. count_characters buffer.count_characters(buffer, start_pos, end_pos)\nReturns the number of whole characters (taking multi-byte characters into\naccount) between positions *start_pos* and *end_pos*.\n@param buffer A buffer.\n@param start_pos The start position of the range of text in *buffer* to start\n counting at.\n@param end_pos The end position of the range of text in *buffer* to stop\n counting at.\n@return number -cpath package.cpath (string)\nThe path used by `require` to search for a C loader.\nLua initializes the C path `package.cpath` in the same way it initializes\nthe Lua path `package.path`, using the environment variable `LUA_CPATH_5_2`\nor the environment variable `LUA_CPATH` or a default path defined in\n`luaconf.h`. +cpath package.cpath (string)\nThe path used by `require` to search for a C loader.\nLua initializes the C path `package.cpath` in the same way it initializes\nthe Lua path `package.path`, using the environment variable `LUA_CPATH_5_3`\nor the environment variable `LUA_CPATH` or a default path defined in\n`luaconf.h`. create coroutine.create(f)\nCreates a new coroutine, with body `f`. `f` must be a Lua\nfunction. Returns this new coroutine, an object with type `"thread"`. css _G.keys.css (table)\nContainer for CSS-specific key bindings. css _G.snippets.css (table)\nContainer for CSS-specific snippets. @@ -515,11 +519,11 @@ currentdir lfs.currentdir()\nReturns a string with the current working directory cursor buffer.cursor (number)\nThe display cursor type.\n\n* `buffer.CURSORNORMAL`\n The text insert cursor.\n* `buffer.CURSORARROW`\n The arrow cursor.\n* `buffer.CURSORWAIT`\n The wait cursor.\n* `buffer.CURSORREVERSEARROW`\n The reversed arrow cursor.\n\nThe default value is `buffer.CURSORNORMAL`. cut buffer.cut(buffer)\nCuts the selected text to the clipboard.\nMultiple selections are copied in order with no delimiters. Rectangular\nselections are copied from top to bottom with end of line characters. Virtual\nspace is not copied.\n@param buffer A buffer. cwd textadept.run.cwd (string, Read-only)\nThe most recently executed compile or run shell command's working\ndirectory.\nIt is used for going to error messages with relative file paths. -date os.date([format [, time]])\nReturns a string or a table containing date and time, formatted according\nto the given string `format`.\n\nIf the `time` argument is present, this is the time to be formatted\n(see the `os.time` function for a description of this value). Otherwise,\n`date` formats the current time.\n\nIf `format` starts with '`!`', then the date is formatted in Coordinated\nUniversal Time. After this optional character, if `format` is the string\n"`*t`", then `date` returns a table with the following fields: `year` (four\ndigits), `month` (1-12), `day` (1-31), `hour` (0-23), `min` (0-59), `sec`\n(0-61), `wday` (weekday, Sunday is 1), `yday` (day of the year), and `isdst`\n(daylight saving flag, a boolean). This last field may be absent if the\ninformation is not available.\n\nIf `format` is not "`*t`", then `date` returns the date as a string,\nformatted according to the same rules as the ANSI C function `strftime`.\n\nWhen called without arguments, `date` returns a reasonable date and time\nrepresentation that depends on the host system and on the current locale\n(that is, `os.date()` is equivalent to `os.date("%c")`).\n\nOn non-Posix systems, this function may be not thread safe because of its\nreliance on C function `gmtime` and C function `localtime`. +date os.date([format [, time]])\nReturns a string or a table containing date and time, formatted according\nto the given string `format`.\n\nIf the `time` argument is present, this is the time to be formatted\n(see the `os.time` function for a description of this value). Otherwise,\n`date` formats the current time.\n\nIf `format` starts with '`!`', then the date is formatted in Coordinated\nUniversal Time. After this optional character, if `format` is the string\n"`*t`", then `date` returns a table with the following fields: `year` (four\ndigits), `month` (1-12), `day` (1-31), `hour` (0-23), `min` (0-59), `sec`\n(0-61), `wday` (weekday, Sunday is 1), `yday` (day of the year), and `isdst`\n(daylight saving flag, a boolean). This last field may be absent if the\ninformation is not available.\n\nIf `format` is not "`*t`", then `date` returns the date as a string,\nformatted according to the same rules as the ISO C function `strftime`.\n\nWhen called without arguments, `date` returns a reasonable date and time\nrepresentation that depends on the host system and on the current locale\n(that is, `os.date()` is equivalent to `os.date("%c")`).\n\nOn non-POSIX systems, this function may be not thread safe because of its\nreliance on C function `gmtime` and C function `localtime`. debug _G.debug (module)\nLua debug module. debug debug.debug()\nEnters an interactive mode with the user, running each string that\nthe user enters. Using simple commands and other debug facilities,\nthe user can inspect global and local variables, change their values,\nevaluate expressions, and so on. A line containing only the word `cont`\nfinishes this function, so that the caller continues its execution.\n\nNote that commands for `debug.debug` are not lexically nested within any\nfunction and so have no direct access to local variables. dec_num lexer.dec_num (pattern)\nA pattern that matches a decimal number. -deg math.deg(x)\nReturns the angle `x` (given in radians) in degrees. +deg math.deg(x)\nConverts the angle `x` from radians to degrees. del_line_left buffer.del_line_left(buffer)\nDeletes the range of text from the caret to the beginning of the current\nline.\n@param buffer A buffer. del_line_right buffer.del_line_right(buffer)\nDeletes the range of text from the caret to the end of the current line.\n@param buffer A buffer. del_word_left buffer.del_word_left(buffer)\nDeletes the word to the left of the caret, including any leading non-word\ncharacters.\n`buffer.word_chars` contains the set of characters that constitute words.\n@param buffer A buffer. @@ -532,7 +536,7 @@ delete_range buffer.delete_range(buffer, pos, length)\nDeletes the range of text delimited_range lexer.delimited_range(chars, single_line, no_escape, balanced)\nCreates and returns a pattern that matches a range of text bounded by\n*chars* characters.\nThis is a convenience function for matching more complicated delimited ranges\nlike strings with escape characters and balanced parentheses. *single_line*\nindicates whether or not the range must be on a single line, *no_escape*\nindicates whether or not to ignore '\' as an escape character, and *balanced*\nindicates whether or not to handle balanced ranges like parentheses and\nrequires *chars* to be composed of two characters.\n@param chars The character(s) that bound the matched range.\n@param single_line Optional flag indicating whether or not the range must be\n on a single line.\n@param no_escape Optional flag indicating whether or not the range end\n character may be escaped by a '\\' character.\n@param balanced Optional flag indicating whether or not to match a balanced\n range, like the "%b" Lua pattern. This flag only applies if *chars*\n consists of two different characters (e.g. "()").\n@usage local dq_str_escapes = l.delimited_range('"')\n@usage local dq_str_noescapes = l.delimited_range('"', false, true)\n@usage local unbalanced_parens = l.delimited_range('()')\n@usage local balanced_parens = l.delimited_range('()', false, false, true)\n@return pattern\n@see nested_pair dialog ui.dialog(kind, ...)\nLow-level function for prompting the user with a gtdialog of kind *kind*\nwith the given string and table arguments, returning a formatted string of\nthe dialog's output.\nYou probably want to use the higher-level functions in the `ui.dialogs`\nmodule.\nTable arguments containing strings are allowed and expanded in place. This is\nuseful for filtered list dialogs with many items.\n@param kind The kind of gtdialog.\n@param ... Parameters to the gtdialog.\n@return string gtdialog result. dialogs ui.dialogs (module)\nProvides a set of interactive dialog prompts for user input. -difftime os.difftime(t2, t1)\nReturns the number of seconds from time `t1` to time `t2`. In POSIX,\nWindows, and some other systems, this value is exactly `t2`*-*`t1`. +difftime os.difftime(t2, t1)\nReturns the difference, in seconds, from time `t1` to time `t2` (where the\ntimes are values returned by `os.time`). In POSIX, Windows, and some other\nsystems, this value is exactly `t2`*-*`t1`. digit lexer.digit (pattern)\nA pattern that matches any digit ('0'-'9'). dir lfs.dir(path)\nLua iterator over the entries of a given directory. Each time the iterator is\ncalled with dir_obj it returns a directory entry's name as a string, or nil\nif there are no more entries. You can also iterate by calling dir_obj:next(),\nand explicitly close the directory before the iteration finished with\ndir_obj:close(). Raises an error if path is not a directory. dir_foreach lfs.dir_foreach(dir, f, filter, exclude_FILTER, n, include_dirs, level)\nIterates over all files and sub-directories (up to level number *n*) in\ndirectory *dir*, calling function *f* with each file found.\nFiles passed to *f* do not match any pattern in string or table *filter*,\nand, unless *exclude_FILTER* is `true`, `lfs.FILTER` as well. A filter table\ncontains Lua patterns that match filenames to exclude, an optional `folders`\nsub-table that contains patterns matching directories to exclude, and an\noptional `extensions` sub-table that contains raw file extensions to exclude.\nAny patterns starting with '!' exclude files and directories that do not\nmatch the pattern that follows.\n@param dir The directory path to iterate over.\n@param f Function to call with each full file path found. If *f* returns\n `false` explicitly, iteration ceases.\n@param filter Optional filter for files and directories to exclude.\n@param exclude_FILTER Optional flag indicating whether or not to exclude the\n default filter `lfs.FILTER` in the search. If `false`, adds `lfs.FILTER` to\n *filter*.\n The default value is `false` to include the default filter.\n@param n Optional maximum number of directory levels to descend into.\n The default value is `nil`, which indicates no limit.\n@param include_dirs Optional flag indicating whether or not to call *f* with\n directory names too. Directory names are passed with a trailing '/' or '\',\n depending on the current platform.\n The default value is `false`.\n@param level Utility value indicating the directory level this function is\n at. This value is used and set internally, and should not be set otherwise.\n@see FILTER @@ -545,7 +549,7 @@ document_start_extend buffer.document_start_extend(buffer)\nMoves the caret to t dofile _G.dofile([filename])\nOpens the named file and executes its contents as a Lua chunk. When\ncalled without arguments,\n`dofile` executes the contents of the standard input (`stdin`). Returns\nall values returned by the chunk. In case of errors, `dofile` propagates\nthe error to its caller (that is, `dofile` does not run in protected mode). drop_selection_n buffer.drop_selection_n(buffer, n)\nDrops existing selection number *n*.\n@param buffer A buffer.\n@param n The number of the existing selection. dropdown ui.dialogs.dropdown(options)\nPrompts the user with a drop-down item selection dialog defined by dialog\noptions table *options*, returning the selected button's index along with the\nindex of the selected item.\nIf *options*.`string_output` is `true`, returns the selected button's label\nalong with the selected item's text.\nIf the dialog closed due to *options*.`exit_onchange`, returns `4` along with\neither the selected item's index or its text. If the dialog timed out,\nreturns `0` or `"timeout"`. If the user canceled the dialog, returns `-1` or\n`"delete"`.\n@param options Table of key-value option pairs for the drop-down dialog.\n\n * `title`: The dialog's title text.\n * `text`: The dialog's main message text.\n * `items`: The list of string items to show in the drop-down.\n * `button1`: The right-most button's label. The default value is\n `_L['_OK']`.\n * `button2`: The middle button's label.\n * `button3`: The left-most button's label. This option requires `button2`\n to be set.\n * `exit_onchange`: Close the dialog after selecting a new item. The default\n value is `false`.\n * `select`: The index of the initially selected list item. The default\n value is `1`.\n * `string_output`: Return the selected button's label (instead of its\n index) and the selected item's text (instead of its index). If no item\n was selected, returns the dialog's exit status (instead of its exit\n code). The default value is `false`.\n * `width`: The dialog's pixel width.\n * `height`: The dialog's pixel height.\n * `float`: Show the dialog on top of all desktop windows. The default value\n is `false`.\n * `timeout`: the integer number of seconds the dialog waits for the user to\n select a button before timing out. Dialogs do not time out by default.\n@usage ui.dialogs.dropdown{title = 'Select Encoding', width = 200,\n items = io.encodings, string_output = true}\n@return selected button or exit code, selected item -dump string.dump(function)\nReturns a string containing a binary representation of the given\nfunction, so that a later `load` on this string returns a copy of the\nfunction (but with new upvalues). +dump string.dump(function [, strip])\nReturns a string containing a binary representation (a _binary chunk_) of the\ngiven function, so that a later `load` on this string returns a copy of the\nfunction (but with new upvalues). If `strip` is a true value, the binary\nrepresentation is created without debug information about the function (local\nvariable names, lines, etc.).\n\nFunctions with upvalues have only their number of upvalues saved. When\n(re)loaded, those upvalues receive fresh instances containing nil. (You can\nuse the debug library to serialize and reload the upvalues of a function in a\nway adequate to your needs.) edge_colour buffer.edge_colour (number)\nThe color, in "0xBBGGRR" format, of the edge or background for long lines\naccording to `buffer.edge_mode`. edge_column buffer.edge_column (number)\nThe column number to mark long lines at. edge_mode buffer.edge_mode (number)\nThe long line mark mode.\n\n* `buffer.EDGE_NONE`\n Long lines are not marked.\n* `buffer.EDGE_LINE`\n Draw a vertical line whose color is `buffer.edge_colour` at column\n `buffer.edge_column`.\n* `buffer.EDGE_BACKGROUND`\n Change the background color of text after column `buffer.edge_column`\n to `buffer.edge_colour`. @@ -566,11 +570,11 @@ ensure_visible buffer.ensure_visible(buffer, line)\nEnsures line number *line* i ensure_visible_enforce_policy buffer.ensure_visible_enforce_policy(buffer, line)\nEnsures line number *line* is visible by expanding any fold points hiding it\nbased on the vertical caret policy previously defined in\n`buffer.set_visible_policy()`.\n@param buffer A buffer.\n@param line The line number in *buffer* to ensure visible. enter_mode ui.command_entry.enter_mode(mode, lexer, height)\nOpens the command entry in key mode *mode*, highlighting text with lexer name\n*lexer*, and displaying *height* number of lines at a time.\nKey bindings will be looked up in `keys[mode]` instead of `keys`. The `Esc`\nkey exits the current mode, closes the command entry, and restores normal key\nlookup.\nThis function is useful for binding keys to enter a command entry mode.\n@param mode The key mode to enter into, or `nil` to exit the current mode.\n@param lexer Optional string lexer name to use for command entry text. The\n default value is `'text'`.\n@param height Optional number of lines to display in the command entry. The\n default value is `1`.\n@usage keys['ce'] = {ui.command_entry.enter_mode, 'command_entry'}\n@see _G.keys.MODE eol_mode buffer.eol_mode (number)\nThe current end of line mode. Changing the current mode does not convert\nany of the buffer's existing end of line characters.\nUse `buffer.convert_eols()` to do so.\n\n* `buffer.EOL_CRLF`\n Carriage return with line feed ("\r\n").\n* `buffer.EOL_CR`\n Carriage return ("\r").\n* `buffer.EOL_LF`\n Line feed ("\n").\n\nThe default value is `buffer.EOL_CRLF` on Windows platforms,\n`buffer.EOL_LF` otherwise. -error _G.error(message [, level])\nTerminates the last protected function called and returns `message`\nas the error message. Function `error` never returns.\n\nUsually, `error` adds some information about the error position at the\nbeginning of the message, if the message is a string. The `level` argument\nspecifies how to get the error position. With level 1 (the default), the\nerror position is where the `error` function was called. Level 2 points the\nerror to where the function that called `error` was called; and so on.\nPassing a level 0 avoids the addition of error position information to the\nmessage. +error _G.error(message [, level])\nTerminates the last protected function called and returns `message`\nas the error object. Function `error` never returns.\n\nUsually, `error` adds some information about the error position at the\nbeginning of the message, if the message is a string. The `level` argument\nspecifies how to get the error position. With level 1 (the default), the\nerror position is where the `error` function was called. Level 2 points the\nerror to where the function that called `error` was called; and so on.\nPassing a level 0 avoids the addition of error position information to the\nmessage. error_patterns textadept.run.error_patterns (table)\nList of warning and error string patterns that match various compile and run\nwarnings and errors.\nPatterns contain filename, line number, and optional warning or error message\ncaptures for single lines. When a warning or error message is double-clicked,\nthe user is taken to the point of warning/error.\nWhen adding to this list, use `(.-)` to match filenames and `(%d+)` to match\nline numbers. Also keep in mind that patterns are matched in sequential\norder; once a pattern matches, no more are tried. events _G.events (module)\nTextadept's core event structure and handlers. -execute os.execute([command])\nThis function is equivalent to the ANSI C function `system`. It passes\n`command` to be executed by an operating system shell. Its first result is\n`true` if the command terminated successfully, or `nil` otherwise. After this\nfirst result the function returns a string and a number, as follows:\n "exit": the command terminated normally; the following number is the exit\n status of the command.\n "signal": the command was terminated by a signal; the following number is\n the signal that terminated the command.\n\nWhen called without a `command`, `os.execute` returns a boolean that is true\nif a shell is available. -exit os.exit([code [, close]])\nCalls the ANSI C function `exit` to terminate the host program. If `code` is\n`true`, the returned status is `EXIT_SUCCESS`; if `code` is `false`, the\nreturned status is `EXIT_FAILURE`; if `code` is a number, the returned status\nis this number. The default value for `code` is `true`.\n\nIf the optional second argument `close` is true, closes the Lua state before\nexiting. +execute os.execute([command])\nThis function is equivalent to the ISO C function `system`. It passes\n`command` to be executed by an operating system shell. Its first result is\n`true` if the command terminated successfully, or `nil` otherwise. After this\nfirst result the function returns a string plus a number, as follows:\n "exit": the command terminated normally; the following number is the exit\n status of the command.\n "signal": the command was terminated by a signal; the following number is\n the signal that terminated the command.\n\nWhen called without a `command`, `os.execute` returns a boolean that is true\nif a shell is available. +exit os.exit([code [, close]])\nCalls the ISO C function `exit` to terminate the host program. If `code` is\n`true`, the returned status is `EXIT_SUCCESS`; if `code` is `false`, the\nreturned status is `EXIT_FAILURE`; if `code` is a number, the returned status\nis this number. The default value for `code` is `true`.\n\nIf the optional second argument `close` is true, closes the Lua state before\nexiting. exp math.exp(x)\nReturns the value *e^x*. expr_types _M.lua.expr_types (table)\nMap of expression patterns to their types.\nExpressions are expected to match after the '=' sign of a statement. expr_types _M.python.expr_types (table)\nMap of expression patterns to their types.\nExpressions are expected to match after the '=' sign of a statement. @@ -579,14 +583,14 @@ extend lexer.extend (pattern)\nA pattern that matches any ASCII extended charact extensions textadept.file_types.extensions (table)\nMap of file extensions to their associated lexer names.\nIf the file type is not recognized by its first-line, each file extension is \nmatched against the file's extension. extra_ascent buffer.extra_ascent (number)\nThe amount of pixel padding above lines.\nThe default value is `0`. extra_descent buffer.extra_descent (number)\nThe amount of pixel padding below lines.\nThe default is `0`. -extract bit32.extract(n, field [, width])\nReturns the unsigned number formed by the bits `field` to `field + width - 1`\nfrom `n`. Bits are numbered from 0 (least significant) to 31 (most\nsignificant). All accessed bits must be in the range [0, 31].\n\nThe default for `width` is 1. +extract bit32.extract(n, field [, width])\nReturns the unsigned number formed by the bits `field` to `field + width - 1`\nfrom `n`. Bits are numbered from 0 (least significant) to 31 (most\nsignificant). All accessed bits must be in the range [0, 31].\n\nThe default for `width` is 1.\n\nNew in Lua 5.2.\nDeprecated in Lua 5.3. file_types textadept.file_types (module)\nHandles file type detection for Textadept. filename buffer.filename (string)\nThe absolute file path associated with the buffer. filesave ui.dialogs.filesave(options)\nPrompts the user with a file save dialog defined by dialog options table\n*options*, returning the string file chosen.\nIf the user canceled the dialog, returns `nil`.\n@param options Table of key-value option pairs for the dialog.\n\n * `title`: The dialog's title text.\n * `with_directory`: The initial filesystem directory to show.\n * `with_file`: The initially chosen filename. This option requires\n `with_directory` to be set.\n * `with_extension`: The list of extensions selectable files must have.\n * `no_create_directories`: Prevent the user from creating new directories.\n The default value is `false`.\n@return filename or nil fileselect ui.dialogs.fileselect(options)\nPrompts the user with a file selection dialog defined by dialog options\ntable *options*, returning the string file selected.\nIf *options*.`select_multiple` is `true`, returns the list of files selected.\nIf the user canceled the dialog, returns `nil`.\n@param options Table of key-value option pairs for the dialog.\n\n * `title`: The dialog's title text.\n * `with_directory`: The initial filesystem directory to show.\n * `with_file`: The initially selected filename. This option requires\n `with_directory` to be set.\n * `with_extension`: The list of extensions selectable files must have.\n * `select_multiple`: Allow the user to select multiple files. The default\n value is `false`.\n * `select_only_directories`: Only allow the user to select directories. The\n default value is `false`.\n@usage ui.dialogs.fileselect{title = 'Open C File', with_directory = _HOME,\n with_extension = {'c', 'h'}, select_multiple = true}\n@return filename, list of filenames, or nil filter_through textadept.editing.filter_through(command)\nPasses the selected text or all buffer text to string shell command *command*\nas standard input (stdin) and replaces the input text with the command's\nstandard output (stdout).\nStandard input is as follows:\n\n1. If text is selected and spans multiple lines, all text on the lines that\nhave text selected is passed as stdin. However, if the end of the selection\nis at the beginning of a line, only the line ending delimiters from the\nprevious line are included. The rest of the line is excluded.\n2. If text is selected and spans a single line, only the selected text is\nused.\n3. If no text is selected, the entire buffer is used.\n@param command The Linux, BSD, Mac OSX, or Windows shell command to filter\n text through. filteredlist ui.dialogs.filteredlist(options)\nPrompts the user with a filtered list item selection dialog defined by dialog\noptions table *options*, returning the selected button's index along with the\nindex or indices of the selected item or items (depending on whether or not\n*options*.`select_multiple` is `true`).\nIf *options*.`string_output` is `true`, returns the selected button's label\nalong with the text of the selected item or items.\nIf the dialog timed out, returns `0` or `"timeout"`. If the user canceled the\ndialog, returns `-1` or `"delete"`.\nSpaces in the filter text are treated as wildcards.\n@param options Table of key-value option pairs for the filtered list dialog.\n\n * `title`: The dialog's title text.\n * `informative_text`: The dialog's main message text.\n * `text`: The dialog's initial input text.\n * `columns`: The list of string column names for list rows.\n * `items`: The list of string items to show in the filtered list.\n * `button1`: The right-most button's label. The default value is\n `_L['_OK']`.\n * `button2`: The middle button's label.\n * `button3`: The left-most button's label. This option requires `button2`\n to be set.\n * `select_multiple`: Allow the user to select multiple items. The default\n value is `false`.\n * `search_column`: The column number to filter the input text against. The\n default value is `1`. This option requires `columns` to be set and\n contain at least *n* column names.\n * `output_column`: The column number to use for `string_output`. The\n default value is `1`. This option requires `columns` to be set and\n contain at least *n* column names.\n * `string_output`: Return the selected button's label (instead of its\n index) and the selected item's text (instead of its index). If no item\n was selected, returns the dialog's exit status (instead of its exit\n code). The default value is `false`.\n * `width`: The dialog's pixel width.\n * `height`: The dialog's pixel height.\n * `float`: Show the dialog on top of all desktop windows. The default value\n is `false`.\n * `timeout`: the integer number of seconds the dialog waits for the user to\n select a button before timing out. Dialogs do not time out by default.\n@usage ui.dialogs.filteredlist{title = 'Title', columns = {'Foo', 'Bar'},\n items = {'a', 'b', 'c', 'd'}}\n@return selected button or exit code, selected item or list of selected items -find string.find(s, pattern [, init [, plain]])\nLooks for the first match of `pattern` in the string `s`. If it finds a\nmatch, then `find` returns the indices of `s` where this occurrence starts\nand ends; otherwise, it returns nil. A third, optional numerical argument\n`init` specifies where to start the search; its default value is 1 and\ncan be negative. A value of true as a fourth, optional argument `plain`\nturns off the pattern matching facilities, so the function does a plain\n"find substring" operation, with no characters in `pattern` being considered\nmagic. Note that if `plain` is given, then `init` must be given as well.\n\nIf the pattern has captures, then in a successful match the captured values\nare also returned, after the two indices. +find string.find(s, pattern [, init [, plain]])\nLooks for the first match of `pattern` (see §6.4.1) in the string `s`. If it\nfinds a match, then `find` returns the indices of `s` where this occurrence\nstarts and ends; otherwise, it returns nil. A third, optional numerical\nargument `init` specifies where to start the search; its default value is 1\nand can be negative. A value of true as a fourth, optional argument `plain`\nturns off the pattern matching facilities, so the function does a plain\n"find substring" operation, with no characters in `pattern` being considered\nmagic. Note that if `plain` is given, then `init` must be given as well.\n\nIf the pattern has captures, then in a successful match the captured values\nare also returned, after the two indices. find ui.find (module)\nTextadept's Find & Replace pane. find_column buffer.find_column(buffer, line, column)\nReturns the position of column number *column* on line number *line* (taking\ntab and multi-byte characters into account), or the position at the end of\nline *line*.\n@param buffer A buffer.\n@param line The line number in *buffer* to use.\n@param column The column number to use. find_entry_text ui.find.find_entry_text (string)\nThe text in the "Find" entry. @@ -600,10 +604,10 @@ find_prev_button_text ui.find.find_prev_button_text (string, Write-only)\nThe te finish_mode ui.command_entry.finish_mode(f)\nExits the current key mode, closes the command entry, and calls function *f*\n(if given) with the command entry's text as an argument.\nThis is useful for binding keys to exit a command entry mode and perform an\naction with the entered text.\n@param f Optional function to call. It should accept the command entry text\n as an argument.\n@usage keys['\n'] = {ui.command_entry.finish_mode, ui.print} first_visible_line buffer.first_visible_line (number)\nThe line number of the line at the top of the view, starting from zero. float lexer.float (pattern)\nA pattern that matches a floating point number. -floor math.floor(x)\nReturns the largest integer smaller than or equal to `x`. +floor math.floor(x)\nReturns the largest integral value smaller than or equal to `x`. flush file:flush()\nSaves any written data to `file`. flush io.flush()\nEquivalent to `io.output():flush()`. -fmod math.fmod(x, y)\nReturns the remainder of the division of `x` by `y` that rounds the\nquotient towards zero. +fmod math.fmod(x, y)\nReturns the remainder of the division of `x` by `y` that rounds the\nquotient towards zero. (integer/float) focus ui.command_entry.focus()\nOpens the command entry. focus ui.find.focus()\nDisplays and focuses the Find & Replace Pane. fold lexer.fold(lexer, text, start_pos, start_line, start_level)\nFolds a chunk of text *text* with lexer *lexer*.\nFolds *text* starting at position *start_pos* on line number *start_line*\nwith a beginning fold level of *start_level* in the buffer. If *lexer* has a\na `_fold` function or a `_foldsymbols` table, that field is used to perform\nfolding. Otherwise, if a `fold.by.indentation` property is set, folding by\nindentation is done.\n@param lexer The lexer object to fold with.\n@param text The text in the buffer to fold.\n@param start_pos The position in the buffer *text* starts at.\n@param start_line The line number *text* starts on.\n@param start_level The fold level *text* starts on.\n@return table of fold levels. @@ -616,8 +620,8 @@ fold_level lexer.fold_level (table, Read-only)\nTable of fold level bit-masks fo fold_line buffer.fold_line(buffer, line, action)\nContracts, expands, or toggles the fold point on line number *line*,\ndepending on *action*.\n@param buffer A buffer.\n@param line The line number in *buffer* to set the fold state for.\n@param action The fold action to perform. Valid values are:\n * `buffer.FOLDACTION_CONTRACT`\n * `buffer.FOLDACTION_EXPAND`\n * `buffer.FOLDACTION_TOGGLE` fold_line_comments lexer.fold_line_comments(prefix)\nReturns a fold function (to be used within the lexer's `_foldsymbols` table)\nthat folds consecutive line comments that start with string *prefix*.\n@param prefix The prefix string defining a line comment.\n@usage [l.COMMENT] = {['--'] = l.fold_line_comments('--')}\n@usage [l.COMMENT] = {['//'] = l.fold_line_comments('//')} fold_parent buffer.fold_parent (table, Read-only)\nTable of fold point line numbers for child line numbers starting from zero.\nA line number of `-1` means no line was found. -format string.format(formatstring, ···)\nReturns a formatted version of its variable number of arguments following the\ndescription given in its first argument (which must be a string). The format\nstring follows the same rules as the ANSI C function `sprintf`. The only\ndifferences are that the options/modifiers `*`, `h`, `L`, `l`, `n`, and `p`\nare not supported and that there is an extra option, `q`. The `q` option\nformats a string between double quotes, using escape sequences when necessary\nto ensure that it can safely be read back by the Lua interpreter. For\ninstance, the call\n\n string.format('%q', 'a string with "quotes" and \n new line')\n\nmay produce the string:\n\n "a string with \"quotes\" and \\n new line"\n\nOptions `A` and `a` (when available), `E`, `e`, `f`, `G`, and `g` all expect\na number as argument. Options `c`, `d`, `i`, `o`, `u`, `X`, and `x` also\nexpect a number, but the range of that number may be limited by the\nunderlying C implementation. For options `o`, `u`, `X`, and `x`, the number\ncannot be negative. Option `q` expects a string; option `s` expects a string\nwithout embedded zeros. If the argument to option `s` is not a string, it is\nconverted to one following the same rules of `tostring`. -frexp math.frexp(x)\nReturns `m` and `e` such that 'x = m2^e', `e` is an integer and the\nabsolute value of `m` is in the range *[0.5, 1)* (or zero when `x` is zero). +format string.format(formatstring, ···)\nReturns a formatted version of its variable number of arguments following the\ndescription given in its first argument (which must be a string). The format\nstring follows the same rules as the ISO C function `sprintf`. The only\ndifferences are that the options/modifiers `*`, `h`, `L`, `l`, `n`, and `p`\nare not supported and that there is an extra option, `q`. The `q` option\nformats a string between double quotes, using escape sequences when necessary\nto ensure that it can safely be read back by the Lua interpreter. For\ninstance, the call\n\n string.format('%q', 'a string with "quotes" and \n new line')\n\nmay produce the string:\n\n "a string with \"quotes\" and \\n new line"\n\nOptions `A` and `a` (when available), `E`, `e`, `f`, `G`, and `g` all expect\na number as argument. Options `c`, `d`, `i`, `o`, `u`, `X`, and `x` expect an\ninteger. Option `q` expects a string; option `s` expects a string without\nembedded zeros. If the argument to option `s` is not a string, it is\nconverted to one following the same rules of `tostring`. +frexp math.frexp(x)\nReturns `m` and `e` such that 'x = m2^e', `e` is an integer and the\nabsolute value of `m` is in the range *[0.5, 1)* (or zero when `x` is zero).\n\nDeprecated in Lua 5.3. functions _SCINTILLA.functions (table)\nMap of Scintilla function names to tables containing their IDs, return types,\nwParam types, and lParam types. Types are as follows:\n\n + `0`: Void.\n + `1`: Integer.\n + `2`: Length of the given lParam string.\n + `3`: Integer position.\n + `4`: Color, in "0xBBGGRR" format.\n + `5`: Boolean `true` or `false`.\n + `6`: Bitmask of Scintilla key modifiers and a key value.\n + `7`: String parameter.\n + `8`: String return value. get_cur_line buffer.get_cur_line(buffer)\nReturns the current line's text and the caret's position on that line,\nstarting from zero.\n@param buffer A buffer.\n@return string, number get_last_child buffer.get_last_child(buffer, line, level)\nReturns the line number of the last line after line number *line* whose fold\nlevel is greater than *level*.\nIf *level* is `-1`, returns the level of *line*.\n@param buffer A buffer.\n@param line The line number in *buffer* of a header line.\n@param level The fold level, or `-1` for the level of *line*. @@ -630,15 +634,17 @@ get_sel_text buffer.get_sel_text(buffer)\nReturns the selected text.\nMultiple s get_split_table ui.get_split_table()\nReturns a split table that contains Textadept's current split view structure.\nThis is primarily used in session saving.\n@return table of split views. Each split view entry is a table with 4\n fields: `1`, `2`, `vertical`, and `size`. `1` and `2` have values of either\n nested split view entries or the views themselves; `vertical` is a flag\n that indicates if the split is vertical or not; and `size` is the integer\n position of the split resizer. get_text buffer.get_text(buffer)\nReturns the buffer's text.\n@param buffer A buffer. getenv os.getenv(varname)\nReturns the value of the process environment variable `varname`, or\nnil if the variable is not defined. +getfenv _G.getfenv([f])\nReturns the current environment in use by the function. `f` can be a Lua\nfunction or a number that specifies the function at that stack level:\nLevel 1 is the function calling `getfenv`. If the given function is not a\nLua function, or if `f` is 0, `getfenv` returns the global environment. The\ndefault for `f` is 1.\n\nDeprecated in Lua 5.2. +getfenv debug.getfenv(o)\nReturns the environment of object `o`.\n\nDeprecated in Lua 5.2. gethook debug.gethook([thread])\nReturns the current hook settings of the thread, as three values: the\ncurrent hook function, the current hook mask, and the current hook count\n(as set by the `debug.sethook` function). getinfo debug.getinfo([thread, ] f [, what])\nReturns a table with information about a function. You can give the\nfunction directly or you can give a number as the value of `f`, which means\nthe function running at level `f` of the call stack of the given thread:\nlevel 0 is the current function (`getinfo` itself); level 1 is the function\nthat called `getinfo` and so on. If `f` is a number larger than the number of\nactive functions, then `getinfo` returns nil.\n\nThe returned table can contain all the fields returned by `lua_getinfo`,\nwith the string `what` describing which fields to fill in. The default for\n`what` is to get all information available, except the table of valid\nlines. If present, the option '`f`' adds a field named `func` with\nthe function itself. If present, the option '`L`' adds a field named\n`activelines` with the table of valid lines.\n\nFor instance, the expression `debug.getinfo(1,"n").name` returns a table\nwith a name for the current function, if a reasonable name can be found,\nand the expression `debug.getinfo(print)` returns a table with all available\ninformation about the `print` function. -getlocal debug.getlocal([thread, ] f, local)\nThis function returns the name and the value of the local variable with index\n`local` of the function at level `f` of the stack. This function accesses not\nonly explicit local variables, but also parameters, temporaries, etc.\n\nThe first parameter or local variable has index 1, and so on, until the last\nactive variable. Negative indices refer to vararg parameters; -1 is the first\nvararg parameter. The function returns nil if there is no variable with the\ngiven index, and raises an error when called with a level out of range. (You\ncan call `debug.getinfo` to check whether the level is valid.)\n\nVariable names starting with '`(`' (open parenthesis) represent internal\nvariables (loop control variables, temporaries, varargs, and C function\nlocals).\n\nThe parameter `f` may also be a function. In that case, `getlocal` returns\nonly the name of function parameters. +getlocal debug.getlocal([thread, ] f, local)\nThis function returns the name and the value of the local variable with index\n`local` of the function at level `f` of the stack. This function accesses not\nonly explicit local variables, but also parameters, temporaries, etc.\n\nThe first parameter or local variable has index 1, and so on, following the\norder that they are declared in the code, counting only the variables that\nare active in the current scope of the function. Negative indices refer to\nvararg parameters; -1 is the first vararg parameter. The function returns nil\nif there is no variable with the given index, and raises an error when called\nwith a level out of range. (You can call `debug.getinfo` to check whether the\nlevel is valid.)\n\nVariable names starting with '(' (open parenthesis) represent variables with\nno known names (internal variables such as loop control variables, and\nvariables from chunks saved without debug information).\n\nThe parameter `f` may also be a function. In that case, `getlocal` returns\nonly the name of function parameters. getmetatable _G.getmetatable(object)\nIf `object` does not have a metatable, returns nil. Otherwise, if the\nobject's metatable has a `"__metatable"` field, returns the associated\nvalue. Otherwise, returns the metatable of the given object. getmetatable debug.getmetatable(value)\nReturns the metatable of the given `value` or nil if it does not have\na metatable. getregistry debug.getregistry()\nReturns the registry table (see §4.5). -getupvalue debug.getupvalue(f, up)\nThis function returns the name and the value of the upvalue with index\n`up` of the function `f`. The function returns nil if there is no upvalue\nwith the given index. -getuservalue debug.getuservalue(u)\nReturns the Lua value associated to `u`. If `u` is not a userdata, returns\nnil. -gmatch string.gmatch(s, pattern)\nReturns an iterator function that, each time it is called, returns the\nnext captures from `pattern` over the string `s`. If `pattern` specifies no\ncaptures, then the whole match is produced in each call.\n\nAs an example, the following loop will iterate over all the words from string\n`s`, printing one per line:\n\n s = "hello world from Lua"\n for w in string.gmatch(s, "%a+") do\n print(w)\n end\n\nThe next example collects all pairs `key=value` from the given string into a\ntable:\n\n t = {}\n s = "from=world, to=Lua"\n for k, v in string.gmatch(s, "(%w+)=(%w+)") do\n t[k] = v\n end\n\nFor this function, a caret '`^`' at the start of a pattern does not work as\nan anchor, as this would prevent the iteration. +getupvalue debug.getupvalue(f, up)\nThis function returns the name and the value of the upvalue with index\n`up` of the function `f`. The function returns nil if there is no upvalue\nwith the given index.\n\nVariable names starting with '(' (open parenthesis) represent variables with\nno known names (variables from chunks saved without debug information). +getuservalue debug.getuservalue(u)\nReturns the Lua value associated to `u`. If `u` is not a userdata, returns\nnil.\n\nNew in Lua 5.2. +gmatch string.gmatch(s, pattern)\nReturns an iterator function that, each time it is called, returns the\nnext captures from `pattern` (see §6.4.1) over the string `s`. If `pattern`\nspecifies no captures, then the whole match is produced in each call.\n\nAs an example, the following loop will iterate over all the words from string\n`s`, printing one per line:\n\n s = "hello world from Lua"\n for w in string.gmatch(s, "%a+") do\n print(w)\n end\n\nThe next example collects all pairs `key=value` from the given string into a\ntable:\n\n t = {}\n s = "from=world, to=Lua"\n for k, v in string.gmatch(s, "(%w+)=(%w+)") do\n t[k] = v\n end\n\nFor this function, a caret '`^`' at the start of a pattern does not work as\nan anchor, as this would prevent the iteration. goto_anchor _M.yaml.goto_anchor()\nJumps to the anchor for the alias underneath the caret. goto_buffer view.goto_buffer(view, n, relative)\nSwitches to buffer number *n* in the view.\n*relative* indicates whether or not *n* is an index relative to the current\nbuffer's index in `_BUFFERS` instead of an absolute index.\nEmits `BUFFER_BEFORE_SWITCH` and `BUFFER_AFTER_SWITCH` events.\n@param view The view to switch buffers in.\n@param n A relative or absolute buffer index in `_BUFFERS`. An absolute index\n of `-1` goes to the last buffer.\n@param relative Optional flag indicating whether *n* is a relative or\n absolute index. The default value is `false`, for an absolute index.\n@see _G._BUFFERS\n@see events.BUFFER_BEFORE_SWITCH\n@see events.BUFFER_AFTER_SWITCH goto_error textadept.run.goto_error(line, next)\nJumps to the source of the recognized compile/run warning or error on line\nnumber *line* in the message buffer.\nIf *line* is `nil`, jumps to the next or previous warning or error, depending\non boolean *next*. Displays an annotation with the warning or error message\nif possible.\n@param line The line number in the message buffer that contains the\n compile/run warning/error to go to.\n@param next Optional flag indicating whether to go to the next recognized\n warning/error or the previous one. Only applicable when *line* is `nil` or\n `false`.\n@see error_patterns\n@see cwd @@ -651,7 +657,7 @@ goto_pos buffer.goto_pos(buffer, pos)\nMoves the caret to position *pos* and scr goto_section _M.rest.goto_section()\nPrompts the user to select a section title to jump to.\nRequires the entire document to be styled. goto_view ui.goto_view(n, relative)\nShifts to view number *n*.\n*relative* indicates whether or not *n* is an index relative to the current\nview's index in `_VIEWS` instead of an absolute index.\nEmits `VIEW_BEFORE_SWITCH` and `VIEW_AFTER_SWITCH` events.\n@param n A relative or absolute view index in `_VIEWS`.\n@param relative Optional flag that indicates whether *n* is a relative or\n absolute index. The default value is `false`, for an absolute index.\n@see _G._VIEWS\n@see events.VIEW_BEFORE_SWITCH\n@see events.VIEW_AFTER_SWITCH graph lexer.graph (pattern)\nA pattern that matches any graphical character ('!' to '~'). -gsub string.gsub(s, pattern, repl [, n])\nReturns a copy of `s` in which all (or the first `n`, if given)\noccurrences of the `pattern` have been replaced by a replacement string\nspecified by `repl`, which can be a string, a table, or a function. `gsub`\nalso returns, as its second value, the total number of matches that occurred.\nThe name `gsub` comes from "Global SUBstitution".\n\nIf `repl` is a string, then its value is used for replacement. The character\n`%` works as an escape character: any sequence in `repl` of the form `%d`,\nwith `d` between 1 and 9, stands for the value of the `d`-th captured\nsubstring. The sequence `%0` stands for the whole match. The sequence `%%`\nstands for a single `%`.\n\nIf `repl` is a table, then the table is queried for every match, using\nthe first capture as the key.\n\nIf `repl` is a function, then this function is called every time a match\noccurs, with all captured substrings passed as arguments, in order.\n\nIn any case, if the pattern specifies no captures, then it behaves as if the\nwhole pattern was inside a capture.\n\nIf the value returned by the table query or by the function call is a\nstring or a number, then it is used as the replacement string; otherwise,\nif it is false or nil, then there is no replacement (that is, the original\nmatch is kept in the string).\n\nHere are some examples:\n\n x = string.gsub("hello world", "(%w+)", "%1 %1")\n --> x="hello hello world world"\n x = string.gsub("hello world", "%w+", "%0 %0", 1)\n --> x="hello hello world"\n x = string.gsub("hello world from Lua", "(%w+)%s*(%w+)", "%2 %1")\n --> x="world hello Lua from"\n x = string.gsub("home = $HOME, user = $USER", "%$(%w+)", os.getenv)\n --> x="home = /home/roberto, user = roberto"\n x = string.gsub("4+5 = $return 4+5$", "%$(.-)%$", function (s)\n return load(s)()\n end)\n --> x="4+5 = 9"\n local t = {name="lua", version="5.2"}\n x = string.gsub("$name-$version.tar.gz", "%$(%w+)", t)\n --> x="lua-5.2.tar.gz" +gsub string.gsub(s, pattern, repl [, n])\nReturns a copy of `s` in which all (or the first `n`, if given)\noccurrences of the `pattern` (see §6.4.1) have been replaced by a replacement\nstring specified by `repl`, which can be a string, a table, or a function.\n`gsub` also returns, as its second value, the total number of matches that\noccurred. The name `gsub` comes from "Global SUBstitution".\n\nIf `repl` is a string, then its value is used for replacement. The character\n`%` works as an escape character: any sequence in `repl` of the form `%d`,\nwith `d` between 1 and 9, stands for the value of the `d`-th captured\nsubstring. The sequence `%0` stands for the whole match. The sequence `%%`\nstands for a single `%`.\n\nIf `repl` is a table, then the table is queried for every match, using\nthe first capture as the key.\n\nIf `repl` is a function, then this function is called every time a match\noccurs, with all captured substrings passed as arguments, in order.\n\nIn any case, if the pattern specifies no captures, then it behaves as if the\nwhole pattern was inside a capture.\n\nIf the value returned by the table query or by the function call is a\nstring or a number, then it is used as the replacement string; otherwise,\nif it is false or nil, then there is no replacement (that is, the original\nmatch is kept in the string).\n\nHere are some examples:\n\n x = string.gsub("hello world", "(%w+)", "%1 %1")\n --> x="hello hello world world"\n x = string.gsub("hello world", "%w+", "%0 %0", 1)\n --> x="hello hello world"\n x = string.gsub("hello world from Lua", "(%w+)%s*(%w+)", "%2 %1")\n --> x="world hello Lua from"\n x = string.gsub("home = $HOME, user = $USER", "%$(%w+)", os.getenv)\n --> x="home = /home/roberto, user = roberto"\n x = string.gsub("4+5 = $return 4+5$", "%$(.-)%$", function (s)\n return load(s)()\n end)\n --> x="4+5 = 9"\n local t = {name="lua", version="5.3"}\n x = string.gsub("$name-$version.tar.gz", "%$(%w+)", t)\n --> x="lua-5.3.tar.gz" h_scroll_bar buffer.h_scroll_bar (bool)\nDisplay the horizontal scroll bar.\nThe default value is `true`. height ui.command_entry.height (number)\nThe height in pixels of the command entry. hex_num lexer.hex_num (pattern)\nA pattern that matches a hexadecimal number. @@ -668,7 +674,7 @@ home_wrap_extend buffer.home_wrap_extend(buffer)\nLike `buffer.home_wrap()`, but html _G.keys.html (table)\nContainer for HTML-specific key bindings. html _G.snippets.html (table)\nContainer for HTML-specific snippets. html _M.html (module)\nThe html module.\nIt provides utilities for editing HTML code. -huge math.huge (number)\nThe value `HUGE_VAL`, a value larger than or equal to any other numerical\nvalue. +huge math.huge (number)\nThe float value `HUGE_VAL`, a value larger than any other numerical value. iconv string.iconv(text, new, old)\nConverts string *text* from encoding *old* to encoding *new* using iconv,\nreturning the string result.\nValid encodings are GNU iconv's encodings and include:\n\n * European: ASCII, ISO-8859-{1,2,3,4,5,7,9,10,13,14,15,16}, KOI8-R, KOI8-U,\n KOI8-RU, CP{1250,1251,1252,1253,1254,1257}, CP{850,866,1131},\n Mac{Roman,CentralEurope,Iceland,Croatian,Romania},\n Mac{Cyrillic,Ukraine,Greek,Turkish}, Macintosh.\n * Semitic: ISO-8859-{6,8}, CP{1255,1256}, CP862, Mac{Hebrew,Arabic}.\n * Japanese: EUC-JP, SHIFT_JIS, CP932, ISO-2022-JP, ISO-2022-JP-2,\n ISO-2022-JP-1.\n * Chinese: EUC-CN, HZ, GBK, CP936, GB18030, EUC-TW, BIG5, CP950,\n BIG5-HKSCS, BIG5-HKSCS:2004, BIG5-HKSCS:2001, BIG5-HKSCS:1999,\n ISO-2022-CN, ISO-2022-CN-EXT.\n * Korean: EUC-KR, CP949, ISO-2022-KR, JOHAB.\n * Armenian: ARMSCII-8.\n * Georgian: Georgian-Academy, Georgian-PS.\n * Tajik: KOI8-T.\n * Kazakh: PT154, RK1048.\n * Thai: ISO-8859-11, TIS-620, CP874, MacThai.\n * Laotian: MuleLao-1, CP1133.\n * Vietnamese: VISCII, TCVN, CP1258.\n * Unicode: UTF-8, UCS-2, UCS-2BE, UCS-2LE, UCS-4, UCS-4BE, UCS-4LE, UTF-16,\n UTF-16BE, UTF-16LE, UTF-32, UTF-32BE, UTF-32LE, UTF-7, C99, JAVA.\n@param text The text to convert.\n@param new The string encoding to convert to.\n@param old The string encoding to convert from. in_files ui.find.in_files (bool)\nFind search text in a list of files.\nThe default value is `false`. in_files_label_text ui.find.in_files_label_text (string, Write-only)\nThe text of the "In files" label.\nThis is primarily used for localization. @@ -694,16 +700,18 @@ insert table.insert(list, [pos, ] value)\nInserts element `value` at position `p insert_text buffer.insert_text(buffer, pos, text)\nInserts string *text* at position *pos*, removing any selections.\nIf *pos* is `-1`, inserts *text* at the caret position.\nIf the caret is after the *pos*, it is moved appropriately, but not scrolled\ninto view.\n@param buffer A buffer.\n@param pos The position in *buffer* to insert text at, or `-1` for the\n current position.\n@param text The text to insert. integer lexer.integer (pattern)\nA pattern that matches either a decimal, hexadecimal, or octal number. io _G.io (module)\nLua io module. -ipairs _G.ipairs(t)\nIf `t` has a metamethod `__ipairs`, calls it with `t` as argument and returns\nthe first three results from the call.\n\nOtherwise, returns three values: an iterator function, the table `t`, and 0,\nso that the construction\n\n for i,v in ipairs(t) do *body* end\n\nwill iterate over the pairs (`1,t[1]`), (`2,t[2]`), ..., up to the\nfirst integer key absent from the table. +ipairs _G.ipairs(t)\nReturns three values (an iterator function, the table `t`, and 0) so that the\nconstruction\n\n for i,v in ipairs(t) do *body* end\n\nwill iterate over the key-value pairs (`1,t[1]`), (`2,t[2]`), ···, up to the\nfirst nil value. +isyieldable coroutine.isyieldable()\nReturns true when the running coroutine can yield.\n\nA running coroutine is yieldable if it is not the main thread and it is not\ninside a non-yieldable C function.\n\nNew in Lua 5.3. join_lines textadept.editing.join_lines()\nJoins the currently selected lines or the current line with the line below\nit.\nAs long as any part of a line is selected, the entire line is eligible for\njoining. -keychain keys.keychain (table)\nThe current chain of key sequences. (Read-only.)\nUse the '#' operator (instead of `ipairs()`) for iteration. +keychain keys.keychain (table)\nThe current chain of key sequences. (Read-only.) keys _G.keys (module)\nManages key bindings in Textadept. keys _G.keys (table)\nMap of key bindings to commands, with language-specific key tables assigned\nto a lexer name key. keys textadept.keys (module)\nDefines key commands for Textadept.\nThis set of key commands is pretty standard among other text editors. If\napplicable, load this module second to last in your *~/.textadept/init.lua*,\nbefore `textadept.menu`. kill spawn_proc:kill()\nKills running process *spawn_proc*. last_char_includes lexer.last_char_includes(s)\nCreates and returns a pattern that verifies that string set *s* contains the\nfirst non-whitespace character behind the current match position.\n@param s String character set like one passed to `lpeg.S()`.\n@usage local regex = l.last_char_includes('+-*!%^&|=,([{') *\n l.delimited_range('/')\n@return pattern -ldexp math.ldexp(m, e)\nReturns 'm2^e' (`e` should be an integer). +ldexp math.ldexp(m, e)\nReturns 'm2^e' (`e` should be an integer).\n\nDeprecated in Lua 5.3. len string.len(s)\nReceives a string and returns its length. The empty string `""` has\nlength 0. Embedded zeros are counted, so `"a\000bc\000"` has length 5. +len utf8.len(s [, i [, j]])\nReturns the number of UTF-8 characters in string `s` that start between\npositions `i` and `j` (both inclusive). The default for `i` is 1 and for `j`\nis -1. If it finds any invalid byte sequence, returns a false value plus the\nposition of the first invalid byte.\n\nNew in Lua 5.3. length buffer.length (number, Read-only)\nThe number of bytes in the buffer. lex lexer.lex(lexer, text, init_style)\nLexes a chunk of text *text* (that has an initial style number of\n*init_style*) with lexer *lexer*.\nIf *lexer* has a `_LEXBYLINE` flag set, the text is lexed one line at a time.\nOtherwise the text is lexed as a whole.\n@param lexer The lexer object to lex with.\n@param text The text in the buffer to lex.\n@param init_style The current style. Multiple-language lexers use this to\n determine which language to start lexing in.\n@return table of token names and positions. lexer _G.lexer (module)\nLexes Scintilla documents with Lua and LPeg. @@ -738,27 +746,30 @@ line_up buffer.line_up(buffer)\nMoves the caret up one line.\n@param buffer A bu line_up_extend buffer.line_up_extend(buffer)\nMoves the caret up one line, extending the selected text to the new position.\n@param buffer A buffer. line_up_rect_extend buffer.line_up_rect_extend(buffer)\nMoves the caret up one line, extending the rectangular selection to the new\nposition.\n@param buffer A buffer. line_visible buffer.line_visible (table, Read-only)\nTable of flags that indicate whether or not lines are visible for line\nnumbers starting from zero. -lines file:lines(···)\nReturns an iterator function that, each time it is called, reads the file\naccording to the given formats. When no format is given, uses "*l" as a\ndefault. As an example, the construction\n\n for c in file:lines(1) do <em>body</em> end\n\nwill iterate over all characters of the file, starting at the current\nposition. Unlike `io.lines`, this function does not close the file when the\nloop ends.\n\nIn case of errors this function raises the error, instead of returning an\nerror code. -lines io.lines([filename ···])\nOpens the given file name in read mode and returns an iterator function that\nworks like `file:lines(···)` over the opened file. When the iterator function\ndetects -- the end of file, it returns nil (to finish the loop) and\nautomatically closes the file.\n\nThe call `io.lines()` (with no file name) is equivalent to\n`io.input():lines()`; that is, it iterates over the lines of the default\ninput file. In this case it does not close the file when the loop ends.\n\nIn case of errors this function raises the error, instead of returning an\nerror code. +lines file:lines(···)\nReturns an iterator function that, each time it is called, reads the file\naccording to the given formats. When no format is given, uses "l" as a\ndefault. As an example, the construction\n\n for c in file:lines(1) do *body* end\n\nwill iterate over all characters of the file, starting at the current\nposition. Unlike `io.lines`, this function does not close the file when the\nloop ends.\n\nIn case of errors this function raises the error, instead of returning an\nerror code. +lines io.lines([filename ···])\nOpens the given file name in read mode and returns an iterator function that\nworks like `file:lines(···)` over the opened file. When the iterator function\ndetects -- the end of file, it returns no values (to finish the loop) and\nautomatically closes the file.\n\nThe call `io.lines()` (with no file name) is equivalent to\n`io.input():lines("l")`; that is, it iterates over the lines of the default\ninput file. In this case it does not close the file when the loop ends.\n\nIn case of errors this function raises the error, instead of returning an\nerror code. lines_join buffer.lines_join(buffer)\nJoins the lines in the target range, inserting spaces between the words\njoined at line boundaries.\n@param buffer A buffer. lines_on_screen buffer.lines_on_screen (number, Read-only)\nThe number of completely visible lines in the view.\nIt is possible to have a partial line visible at the bottom of the view. lines_split buffer.lines_split(buffer, pixel_width, width)\nSplits the lines in the target range into lines *width* pixels wide.\nIf *width* is `0`, splits the lines in the target range into lines as wide as\nthe view.\n@param buffer A buffer.\n@param width The pixel width to split lines at. When `0`, uses the width of\n the view. -load _G.load(ld [, source [, mode [, env]]])\nLoads a chunk.\n\nIf `ld` is a string, the chunk is this string. If `ld` is a function, `load`\ncalls it repeatedly to get the chunk pieces. Each call to `ld` must return a\nstring that concatenates with previous results. A return of an empty string,\nnil, or no value signals the end of the chunk.\n\nIf there are no syntactic errors, returns the compiled chunk as a function;\notherwise, returns <b>nil</b> plus the error message.\n\nIf the resulting function has upvalues, the first upvalue is set to the value\nof `env`, if that parameter is given, or to the value of the global\nenvironment. (When you load a main chunk, the resulting function will always\nhave exactly one upvalue, the `_ENV` variable (see §2.2). When you load a\nbinary chunk created from a function (see `string.dump`), the resulting\nfunction can have arbitrary upvalues.)\n\n`source` is used as the source of the chunk for error messages and debug\ninformation (see §4.9). When absent, it defaults to `ld`, if `ld` is a\nstring, or to "`=(load)`" otherwise.\n\nThe string `mode` controls whether the chunk can be text or binary (that is,\na precompiled chunk). It may be the string "`b`" (only binary chunks), "`t`"\n(only text chunks), or "`bt`" (both binary and text). The default is "`bt`". +load _G.load(chunk [, chunkname [, mode [, env]]])\nLoads a chunk.\n\nIf `chunk` is a string, the chunk is this string. If `chunk` is a function, `load`\ncalls it repeatedly to get the chunk pieces. Each call to `chunk` must return a\nstring that concatenates with previous results. A return of an empty string,\nnil, or no value signals the end of the chunk.\n\nIf there are no syntactic errors, returns the compiled chunk as a function;\notherwise, returns nil plus the error message.\n\nIf the resulting function has upvalues, the first upvalue is set to the value\nof `env`, if that parameter is given, or to the value of the global\nenvironment. Other upvalues are initialized with nil. (When you load a main\nchunk, the resulting function will always have exactly one upvalue, the\n`_ENV` variable (see §2.2). However, when you load a binary chunk created\nfrom a function (see `string.dump`), the resulting function can have an\narbitrary number of upvalues.) All upvalues are fresh, that is, they are not\nshared with any other function.\n\n`chunkname` is used as the name of the chunk for error messages and debug\ninformation (see §4.9). When absent, it defaults to `chunk`, if `chunk` is a\nstring, or to "`=(load)`" otherwise.\n\nThe string `mode` controls whether the chunk can be text or binary (that is,\na precompiled chunk). It may be the string "`b`" (only binary chunks), "`t`"\n(only text chunks), or "`bt`" (both binary and text). The default is "`bt`".\n\nLua does not check the consistency of binary chunks. Maliciously crafted\nbinary chunks can crash the interpreter. load lexer.load(name, alt_name)\nInitializes or loads and returns the lexer of string name *name*.\nScintilla calls this function to load a lexer. Parent lexers also call this\nfunction to load child lexers and vice-versa. The user calls this function\nto load a lexer when using Scintillua as a Lua library.\n@param name The name of the lexing language.\n@param alt_name The alternate name of the lexing language. This is useful for\n embedding the same child lexer with multiple sets of start and end tokens.\n@return lexer object load textadept.session.load(filename)\nLoads session file *filename* or the user-selected session, returning `true`\nif a session file was opened and read.\nTextadept restores split views, opened buffers, cursor information, and\nrecent files.\n@param filename Optional absolute path to the session file to load. If `nil`,\n the user is prompted for one.\n@usage textadept.session.load(filename)\n@return `true` if the session file was opened and read; `false` otherwise.\n@see DEFAULT_SESSION loaded package.loaded (table)\nA table used by `require` to control which modules are already loaded. When\nyou require a module `modname` and `package.loaded[modname]` is not false,\n`require` simply returns the value stored there.\nThis variable is only a reference to the real table; assignments to this\nvariable do not change the table used by `require`. +loaders package.loaders (table)\nSee `package.searchers`.\n\nDeprecated in Lua 5.2. loadfile _G.loadfile([filename [, mode [, env]]])\nSimilar to `load`, but gets the chunk from file `filename` or from the\nstandard input, if no file name is given. loadlib package.loadlib(libname, funcname)\nDynamically links the host program with the C library `libname`.\n\nIf `funcname` is "`*`", then it only links with the library, making the\nsymbols exported by the library available to other dynamically linked\nlibraries. Otherwise, it looks for a function `funcname` inside the library\nand returns this function as a C function. So, `funcname` must follow the\n`lua_CFunction` prototype (see `lua_CFunction`).\n\nThis is a low-level function. It completely bypasses the package and module\nsystem. Unlike `require`, it does not perform any path searching and does\nnot automatically adds extensions. `libname` must be the complete file name\nof the C library, including if necessary a path and an extension. `funcname`\nmust be the exact name exported by the C library (which may depend on the\nC compiler and linker used).\n\nThis function is not supported by Standard C. As such, it is only available\non some platforms (Windows, Linux, Mac OS X, Solaris, BSD, plus other Unix\nsystems that support the `dlfcn` standard). +loadstring _G.loadstring(string [, chunkname])\nSimilar to `load`, but gets the chunk from the given string. To load and\nrun a given string, use the idiom assert(loadstring(s))() When absent,\n`chunkname` defaults to the given string.\n\nDeprecated in Lua 5.2. locale lpeg.locale([table])\nReturns a table with patterns for matching some character classes according\nto the current locale. The table has fields named `alnum`, `alpha`, `cntrl`,\n`digit`, `graph`, `lower`, `print`, `punct`, `space`, `upper`, and `xdigit`,\neach one containing a correspondent pattern. Each pattern matches any single\ncharacter that belongs to its class.\n\nIf called with an argument `table`, then it creates those fields inside the\ngiven table and returns that table. lock lfs.lock(filehandle, mode[, start[, length]])\nLocks a file or a part of it. This function works on open files; the file\nhandle should be specified as the first argument. The string mode could be\neither r (for a read/shared lock) or w (for a write/exclusive lock). The\noptional arguments start and length can be used to specify a starting point\nand its length; both should be numbers.\n\nReturns true if the operation was successful; in case of error, it returns\nnil plus an error string. lock_dir lfs.lock_dir(path, [seconds_stale])\nCreates a lockfile (called lockfile.lfs) in path if it does not exist and\nreturns the lock. If the lock already exists checks it it's stale, using the\nsecond parameter (default for the second parameter is INT_MAX, which in\npractice means the lock will never be stale. To free the the lock call\nlock:free().\n\nIn case of any errors it returns nil and the error message. In particular,\nif the lock exists and is not stale it returns the "File exists" message. log math.log(x [, base])\nReturns the logarithm of `x` in the given base. The default for `base` is 'e'\n(so that the function returns the natural logarithm of `x`). +log10 math.log10(x)\nReturns the base-10 logarithm of `x`.\n\nDeprecated in Lua 5.2. lower lexer.lower (pattern)\nA pattern that matches any lower case character ('a'-'z'). lower string.lower(s)\nReceives a string and returns a copy of this string with all uppercase\nletters changed to lowercase. All other characters are left unchanged. The\ndefinition of what an uppercase letter is depends on the current locale. lower_case buffer.lower_case(buffer)\nConverts the selected text to lower case letters.\n@param buffer A buffer. lpeg _G.lpeg (module)\nLua lpeg module. -lrotate bit32.lrotate(x, disp)\nReturns the number `x` rotated `disp` bits to the left. The number `disp` may\nbe any representable integer.\n\nFor any valid displacement, the following identity holds:\n\n assert(bit32.lrotate(x, disp) == bit32.lrotate(x, disp % 32))\n\nIn particular, negative displacements rotate to the right. -lshift bit32.lshift(x, disp)\nReturns the number `x` shifted `disp` bits to the left. The number `disp` may\nbe any representable integer. Negative displacements shift to the right. In\nany direction, vacant bits are filled with zeros. In particular,\ndisplacements with absolute values higher than 31 result in zero (all bits\nare shifted out).\n\nFor positive displacements, the following equality holds:\n\n assert(bit32.lshift(b, disp) == (b * 2^disp) % 2^32) +lrotate bit32.lrotate(x, disp)\nReturns the number `x` rotated `disp` bits to the left. The number `disp` may\nbe any representable integer.\n\nFor any valid displacement, the following identity holds:\n\n assert(bit32.lrotate(x, disp) == bit32.lrotate(x, disp % 32))\n\nIn particular, negative displacements rotate to the right.\n\nNew in Lua 5.2.\nDeprecated in Lua 5.3. +lshift bit32.lshift(x, disp)\nReturns the number `x` shifted `disp` bits to the left. The number `disp` may\nbe any representable integer. Negative displacements shift to the right. In\nany direction, vacant bits are filled with zeros. In particular,\ndisplacements with absolute values higher than 31 result in zero (all bits\nare shifted out).\n\nFor positive displacements, the following equality holds:\n\n assert(bit32.lshift(b, disp) == (b * 2^disp) % 2^32)\n\nNew in Lua 5.2.\nDeprecated in Lua 5.3. lua _G.keys.lua (table)\nContainer for Lua-specific key bindings. lua _G.snippets.lua (table)\nContainer for Lua-specific snippets. lua _M.lua (module)\nThe lua module.\nIt provides utilities for editing Lua code. @@ -795,23 +806,28 @@ marker_next buffer.marker_next(buffer, line, marker_mask)\nReturns the first lin marker_previous buffer.marker_previous(buffer, line, marker_mask)\nReturns the last line number, before or on line number *line*, that has had\nall of the markers represented by marker bit-mask *marker_mask* added to it.\nReturns `-1` if no line was found.\nBit 0 is set if marker 0 is set, bit 1 for marker 1, etc., up to marker 31.\n@param buffer A buffer.\n@param line The start line to search from.\n@param marker_mask The mask of markers to find. Set bit 0 to find marker 0,\n bit 1 for marker 1 and so on.\n@return number marker_symbol_defined buffer.marker_symbol_defined(buffer, marker)\nReturns the symbol assigned to marker number *marker*, in the range of `0` to\n`31`, used in `buffer.marker_define()`,\n`buffer.marker_define_pixmap()`, or `buffer.marker_define_rgba_image()`.\n@param buffer A buffer.\n@param marker The marker number in the range of `0` to `31` to get the symbol\n of.\n@return number match lpeg.match(pattern, subject [, init])\nThe matching function. It attempts to match the given pattern against the\nsubject string. If the match succeeds, returns the index in the subject of\nthe first character after the match, or the captured values (if the pattern\ncaptured any value).\n\nAn optional numeric argument `init` makes the match start at that position in\nthe subject string. As usual in Lua libraries, a negative value counts from\nthe end.\n\nUnlike typical pattern-matching functions, match works only in anchored mode;\nthat is, it tries to match the pattern with a prefix of the given subject\nstring (at position `init`), not with an arbitrary substring of the subject.\nSo, if we want to find a pattern anywhere in a string, we must either write a\nloop in Lua or write a pattern that matches anywhere. This second approach is\neasy and quite efficient; see examples. -match string.match(s, pattern [, init])\nLooks for the first *match* of `pattern` in the string `s`. If it\nfinds one, then `match` returns the captures from the pattern; otherwise\nit returns nil. If `pattern` specifies no captures, then the whole match\nis returned. A third, optional numerical argument `init` specifies where\nto start the search; its default value is 1 and can be negative. +match string.match(s, pattern [, init])\nLooks for the first *match* of `pattern` (see §6.4.1) in the string `s`. If\nit finds one, then `match` returns the captures from the pattern; otherwise\nit returns nil. If `pattern` specifies no captures, then the whole match\nis returned. A third, optional numerical argument `init` specifies where\nto start the search; its default value is 1 and can be negative. match_brace textadept.editing.match_brace(select)\nGoes to the current character's matching brace, selecting the text in between\nif *select* is `true`.\n@param select Optional flag indicating whether or not to select the text\n between matching braces. The default value is `false`. match_case ui.find.match_case (bool)\nMatch search text case sensitively.\nThe default value is `false`. match_case_label_text ui.find.match_case_label_text (string, Write-only)\nThe text of the "Match case" label.\nThis is primarily used for localization. math _G.math (module)\nLua math module. -max math.max(x, ···)\nReturns the maximum value among its arguments. +max math.max(x, ···)\nReturns the argument with the maximum value, according to the Lua operator\n`<`. (integer/float) maximized ui.maximized (bool)\nWhether or not Textadept's window is maximized. -menu textadept.menu (module)\nDefines the menus used by Textadept.\nMenus are simply tables and may be edited in place. Submenus have `title`\nkeys with string text. Use the '#' operator (instead of `ipairs()`) for\niteration.\nIf applicable, load this module last in your *~/.textadept/init.lua*, after\n`textadept.keys` since it looks up defined key commands to show them in\nmenus. +maxinteger math.maxinteger (number)\nAn integer with the maximum value for an integer.\n\nNew in Lua 5.3. +maxn table.maxn(table)\nReturns the largest positive numerical index of the given table, or zero if\nthe table has no positive numerical indices. (To do its job this function\ndoes a linear traversal of the whole table.)\n\nDeprecated in Lua 5.2. +menu textadept.menu (module)\nDefines the menus used by Textadept.\nMenus are simply tables and may be edited in place. Submenus have `title`\nkeys with string text.\nIf applicable, load this module last in your *~/.textadept/init.lua*, after\n`textadept.keys` since it looks up defined key commands to show them in\nmenus. menu ui.menu(menu_table)\nLow-level function for creating a menu from table *menu_table* and returning\nthe userdata.\nYou probably want to use the higher-level `textadept.menu.menubar`,\n`textadept.menu.context_menu`, or `textadept.menu.tab_context_menu` tables.\nEmits a `MENU_CLICKED` event when a menu item is selected.\n@param menu_table A table defining the menu. It is an ordered list of tables\n with a string menu item, integer menu ID, and optional GDK keycode and\n modifier mask. The latter two are used to display key shortcuts in the\n menu. '_' characters are treated as a menu mnemonics. If the menu item is\n empty, a menu separator item is created. Submenus are just nested\n menu-structure tables. Their title text is defined with a `title` key.\n@usage ui.menu{{'_New', 1}, {'_Open', 2}, {''}, {'_Quit', 4}}\n@usage ui.menu{{'_New', 1, string.byte('n'), 4}} -- 'Ctrl+N'\n@see events.MENU_CLICKED\n@see textadept.menu.menubar\n@see textadept.menu.context_menu\n@see textadept.menu.tab_context_menu menubar textadept.menu.menubar (table)\nThe default main menubar. menubar ui.menubar (table)\nA table of menus defining a menubar. (Write-only).\nThis is a low-level field. You probably want to use the higher-level\n`textadept.menu.menubar`.\n@see textadept.menu.menubar -min math.min(x, ···)\nReturns the minimum value among its arguments. +min math.min(x, ···)\nReturns the argument with the minimum value, according to the Lua operator\n`<`. (integer/float) +mininteger math.mininteger (number)\nAn integer with the minimum value for an integer.\n\nNew in Lua 5.3. mkdir lfs.mkdir(dirname)\nCreates a new directory. The argument is the name of the new directory.\n\nReturns true if the operation was successful; in case of error, it returns\nnil plus an error string. -modf math.modf(x)\nReturns two numbers, the integral part of `x` and the fractional part of\n`x`. +modf math.modf(x)\nReturns the integral part of `x` and the fractional part of `x`. Its second\nresult is always a float. modify buffer.modify (bool)\nWhether or not the buffer has unsaved changes. +module _G.module(name [, ···])\nCreates a module. If there is a table in `package.loaded[name]`, this table\nis the module. Otherwise, if there is a global table `t` with the given name,\nthis table is the module. Otherwise creates a new table `t` and sets it as\nthe value of the global `name` and the value of `package.loaded[name]`. This\nfunction also initializes `t._NAME` with the given name, `t._M` with the\nmodule (`t` itself), and `t._PACKAGE` with the package name (the full module\nname minus last component; see below). Finally, `module` sets `t` as the new\nenvironment of the current function and the new value of\n`package.loaded[name]`, so that `require` returns `t`. If `name` is a\ncompound name (that is, one with components separated by dots), `module`\ncreates (or reuses, if they already exist) tables for each component. For\ninstance, if `name` is `a.b.c`, then `module` stores the module table in\nfield `c` of field `b` of global `a`. This function can receive optional\n*options* after the module name, where each option is a function to be\napplied over the module.\n\nDeprecated in Lua 5.2. mouse_dwell_time buffer.mouse_dwell_time (number)\nThe number of milliseconds the mouse must idle before generating a\n`DWELL_START` event. A time of `buffer.TIME_FOREVER` will never generate\none. mouse_selection_rectangular_switch buffer.mouse_selection_rectangular_switch (bool)\nWhether or not pressing `buffer.rectangular_selection_modifier` when\nselecting text normally with the mouse turns on rectangular selection.\nThe default value is `false`. +move table.move(a1, f, e, t [, a2])\nMoves elements from table `a1` to table `a2`. This function performs the\nequivalent to the following multiple assignment: `a2[t], ··· = a1[f], ···,\na1[e]`. The default for `a2` is `a1`. The destination range can overlap with\nthe source range. Index `f` must be positive.\n\nNew in Lua 5.3. move_caret_inside_view buffer.move_caret_inside_view(buffer)\nMoves the caret into view if it is not already, removing any selections.\n@param buffer A buffer. move_selected_lines_down buffer.move_selected_lines_down(buffer)\nShifts the selected lines down one line.\n@param buffer A buffer. move_selected_lines_up buffer.move_selected_lines_up(buffer)\nShifts the selected lines up one line.\n@param buffer A buffer. @@ -830,6 +846,7 @@ next_user_list_type _SCINTILLA.next_user_list_type()\nReturns a unique user list nonnewline lexer.nonnewline (pattern)\nA pattern that matches any single, non-newline character. nonnewline_esc lexer.nonnewline_esc (pattern)\nA pattern that matches any single, non-newline character or any set of end\nof line characters escaped with '\'. oct_num lexer.oct_num (pattern)\nA pattern that matches an octal number. +offset utf8.offset(s, n [, i])\nReturns the position (in bytes) where the encoding of the `n`-th character of\n`s` (counting from position `i`) starts. A negative `n` gets characters\nbefore position `i`. The default for `i` is 1 when `n` is non-negative and\n`#s + 1` otherwise, so that `utf8.offset(s, -n)` gets the offset of the\n`n`-th character from the end of the string. If the specified character is\nneither in the subject nor right after its end, the function returns nil.\n\nAs a special case, when `n` is 0 the function returns the start of the\nencoding of the character that contains the `i`-th byte of `s`.\n\nThis function assumes that `s` is a valid UTF-8 string.\n\nNew in Lua 5.3. ok_msgbox ui.dialogs.ok_msgbox(options)\nPrompts the user with a generic message box dialog defined by dialog options\ntable *options* and with localized "Ok" and "Cancel" buttons, returning the\nselected button's index.\nIf *options*.`string_output` is `true`, returns the selected button's label.\nIf the dialog timed out, returns `0` or `"timeout"`. If the user canceled the\ndialog, returns `-1` or `"delete"`.\n@param options Table of key-value option pairs for the message box.\n\n * `title`: The dialog's title text.\n * `text`: The dialog's main message text.\n * `informative_text`: The dialog's extra informative text.\n * `icon`: The dialog's GTK stock icon name. Examples are\n "gtk-dialog-error", "gtk-dialog-info", "gtk-dialog-question", and\n "gtk-dialog-warning". The dialog does not display an icon by default.\n * `icon_file`: The dialog's icon file path. This option has no effect when\n `icon` is set.\n * `no_cancel`: Do not display the "Cancel" button. The default value is\n `false`.\n * `string_output`: Return the selected button's label (instead of its\n index) or the dialog's exit status instead of the button's index (instead\n of its exit code). The default value is `false`.\n * `width`: The dialog's pixel width.\n * `height`: The dialog's pixel height.\n * `float`: Show the dialog on top of all desktop windows. The default value\n is `false`.\n * `timeout`: the integer number of seconds the dialog waits for the user to\n select a button before timing out. Dialogs do not time out by default.\n@return selected button or exit code open io.open(filename [, mode])\nThis function opens a file, in the mode specified in the string `mode`. It\nreturns a new file handle, or, in case of errors, nil plus an error message.\n\nThe `mode` string can be any of the following:\n "r": read mode (the default);\n "w": write mode;\n "a": append mode;\n "r+": update mode, all previous data is preserved;\n "w+": update mode, all previous data is erased;\n "a+": append update mode, previous data is preserved, writing is only\n allowed at the end of file.\n\nThe `mode` string can also have a '`b`' at the end, which is needed in\nsome systems to open the file in binary mode. open_file io.open_file(filenames)\nOpens *filenames*, a string filename or list of filenames, or the\nuser-selected filenames.\nEmits a `FILE_OPENED` event.\n@param filenames Optional string filename or table of filenames to open. If\n `nil`, the user is prompted with a fileselect dialog.\n@see _G.events @@ -839,8 +856,10 @@ optionselect ui.dialogs.optionselect(options)\nPrompts the user with an option s os _G.os (module)\nLua os module. output io.output([file])\nSimilar to `io.input`, but operates over the default output file. overtype buffer.overtype (bool)\nEnable overtype mode, where typed characters overwrite existing ones.\nThe default value is `false`. -pack table.pack(···)\nReturns a new table with all parameters stored into keys 1, 2, etc. and with\na field "`n`" with the total number of parameters. Note that the resulting\ntable may not be a sequence. +pack string.pack(fmt, v1, v2, ···)\nReturns a binary string containing the values `v1`, `v2`, etc. packed (that\nis, serialized in binary form) according to the format string `fmt` (see\n§6.4.2).\n\nNew in Lua 5.3. +pack table.pack(···)\nReturns a new table with all parameters stored into keys 1, 2, etc. and with\na field "`n`" with the total number of parameters. Note that the resulting\ntable may not be a sequence.\n\nNew in Lua 5.2. package _G.package (module)\nLua package module. +packsize string.packsize(fmt)\nReturns the size of a string resulting from `string.pack` with the given\nformat. The format string cannot have the variable-length options 's' or 'z'\n(see §6.4.2).\n\nNew in Lua 5.3. page_down buffer.page_down(buffer)\nMoves the caret down one page.\n@param buffer A buffer. page_down_extend buffer.page_down_extend(buffer)\nMoves the caret down one page, extending the selected text to the new\nposition.\n@param buffer A buffer. page_down_rect_extend buffer.page_down_rect_extend(buffer)\nMoves the caret down one page, extending the rectangular selection to the new\nposition.\n@param buffer A buffer. @@ -853,7 +872,7 @@ para_down_extend buffer.para_down_extend(buffer)\nMoves the caret down one parag para_up buffer.para_up(buffer)\nMoves the caret up one paragraph.\nParagraphs are surrounded by one or more blank lines.\n@param buffer A buffer. para_up_extend buffer.para_up_extend(buffer)\nMoves the caret up one paragraph, extending the selected text to the new\nposition.\nParagraphs are surrounded by one or more blank lines.\n@param buffer A buffer. paste buffer.paste(buffer)\nPastes the clipboard's contents into the buffer, replacing any selected text\naccording to `buffer.multi_paste`.\n@param buffer A buffer. -path package.path (string)\nThe path used by `require` to search for a Lua loader.\nAt start-up, Lua initializes this variable with the value of the\nenvironment variable `LUA_PATH_5_2` or the environment variable `LUA_PATH`\nor with a default path defined in `luaconf.h`, if those environment\nvariables are not defined. Any "`;;`" in the value of the environment\nvariable is replaced by the default path. +path package.path (string)\nThe path used by `require` to search for a Lua loader.\nAt start-up, Lua initializes this variable with the value of the\nenvironment variable `LUA_PATH_5_3` or the environment variable `LUA_PATH`\nor with a default path defined in `luaconf.h`, if those environment\nvariables are not defined. Any "`;;`" in the value of the environment\nvariable is replaced by the default path. patterns textadept.file_types.patterns (table)\nMap of first-line patterns to their associated lexer names.\nEach pattern is matched against the first line in the file. pcall _G.pcall(f [, arg1, ···])\nCalls function `f` with the given arguments in *protected mode*. This\nmeans that any error inside `f` is not propagated; instead, `pcall` catches\nthe error and returns a status code. Its first result is the status code (a\nboolean), which is true if the call succeeds without errors. In such case,\n`pcall` also returns all results from the call, after this first result. In\ncase of any error, `pcall` returns false plus the error message. pi math.pi (number)\nThe value of 'π'. @@ -862,7 +881,7 @@ position_after buffer.position_after(buffer, pos)\nReturns the position of the c position_before buffer.position_before(buffer, pos)\nReturns the position of the character before position *pos* (taking\nmulti-byte characters into account), or `0` if there is no character before\n*pos*.\n@param buffer A buffer.\n@param pos The position in *buffer* to get the position before from.\n@return number position_from_line buffer.position_from_line(buffer, line)\nReturns the position at the beginning of line number *line*.\nReturns `-1` if *line* is greater than `buffer.line_count`.\n@param buffer A buffer.\n@param line The line number in *buffer* to get the beginning position for.\n@return number position_relative buffer.position_relative(buffer, pos, n)\nReturns the position *n* characters before or after position *pos* (taking\nmulti-byte characters into account).\nReturns `0` if the position is less than 0 or `buffer.length` if the position\nis greater than `buffer.length`.\n@param buffer A buffer.\n@param pos The position in *buffer* to get the relative position from.\n@param n The relative number of characters to get the position for. A\n negative number indicates a position before while a positive number\n indicates a position after.\n@return number -pow math.pow(x, y)\nReturns *x^y*. (You can also use the expression `x^y` to compute this\nvalue.) +pow math.pow(x, y)\nReturns *x^y*. (You can also use the expression `x^y` to compute this\nvalue.)\n\nDeprecated in Lua 5.3. preload package.preload (table)\nA table to store loaders for specific modules (see `require`).\nThis variable is only a reference to the real table; assignments to this\nvariable do not change the table used by `require`. print _G.print(···)\nReceives any number of arguments and prints their values to `stdout`, using\nthe `tostring` function to convert each argument to a string. `print` is not\nintended for formatted output, but only as a quick way to show a value,\nfor instance for debugging. For complete control over the output, use\n`string.format` and `io.write`. print lexer.print (pattern)\nA pattern that matches any printable character (' ' to '~'). @@ -881,16 +900,16 @@ python _G.keys.python (table)\nContainer for Python-specific key bindings. python _G.snippets.python (table)\nContainer for Python-specific snippets. python _M.python (module)\nThe python module.\nIt provides utilities for editing Python code. quit _G.quit()\nEmits a `QUIT` event, and unless any handler returns `false`, quits\nTextadept.\n@see events.QUIT -rad math.rad(x)\nReturns the angle `x` (given in degrees) in radians. -random math.random([m [, n]])\nThis function is an interface to the simple pseudo-random generator\nfunction `rand` provided by Standard C. (No guarantees can be given for its\nstatistical properties.)\n\nWhen called without arguments, returns a uniform pseudo-random real\nnumber in the range [0,1). When called with an integer number `m`,\n`math.random` returns a uniform pseudo-random integer in the range [1, m].\nWhen called with two integer numbers `m` and `n`, `math.random` returns a\nuniform pseudo-random integer in the range [m, n]. +rad math.rad(x)\nConverts the angle `x` from degrees to radians. +random math.random([m [, n]])\nWhen called without arguments, returns a pseudo-random float with uniform\ndistribution in the range [0,1). When called with two integers `m` and `n`,\n`math.random` returns a pseudo-random integer with uniform distribution in\nthe range `[m, n]. (The value `m-n` cannot be negative and must fit in a Lua\ninteger.) The call `math.random(n)` is equivalent to `math.random(1, n)`.\n\nThis function is an interface to the underling pseudo-random generator\nfunction provided by C. No guarantees can be given for its statistical\nproperties. randomseed math.randomseed(x)\nSets `x` as the "seed" for the pseudo-random generator: equal seeds\nproduce equal sequences of numbers. rawequal _G.rawequal(v1, v2)\nChecks whether `v1` is equal to `v2`, without invoking any\nmetamethod. Returns a boolean. rawget _G.rawget(table, index)\nGets the real value of `table[index]`, without invoking any\nmetamethod. `table` must be a table; `index` may be any value. -rawlen _G.rawlen(v)\nReturns the length of the object `v`,\nwhich must be a table or a string,\nwithout invoking any metamethod.\nReturns an integer number. +rawlen _G.rawlen(v)\nReturns the length of the object `v`,\nwhich must be a table or a string,\nwithout invoking any metamethod.\nReturns an integer.\n\nNew in Lua 5.2. rawset _G.rawset(table, index, value)\nSets the real value of `table[index]` to `value`, without invoking any\nmetamethod. `table` must be a table, `index` any value different from nil and\nNaN, and `value` any Lua value.\n\nThis function returns `table`. -read file:read(···)\nReads the file `file`, according to the given formats, which specify\nwhat to read. For each format, the function returns a string (or a number)\nwith the characters read, or nil if it cannot read data with the specified\nformat. When called without formats, it uses a default format that reads\nthe next line (see below).\n\nThe available formats are\n "*n": reads a number; this is the only format that returns a number\n instead of a string.\n "*a": reads the whole file, starting at the current position. On end of\n file, it returns the empty string.\n "*l": reads the next line skipping the end of line, returning nil on\n end of file. This is the default format.\n "*L": reads the next line keeping the end of line (if present), returning\n nil on end of file.\n *number*: reads a string with up to this number of bytes, returning nil on\n end of file. If number is zero, it reads nothing and returns an empty\n string, or nil on end of file. +read file:read(···)\nReads the file `file`, according to the given formats, which specify\nwhat to read. For each format, the function returns a string or a number\nwith the characters read, or nil if it cannot read data with the specified\nformat. (In this latter case, the function does not read subsequent formats.)\nWhen called without formats, it uses a default format that reads the next\nline (see below).\n\nThe available formats are\n "n": reads a numeral and returns it as a float or an integer, following the\n lexical conventions of Lua. (The numeral may have leading spaces and a\n sign.) This format always reads the longest input sequence that is a\n valid prefix for a number; if that prefix does not form a valid number\n (e.g., an empty string, "0x", or "3.4e-"), it is discarded and the\n function returns nil.\n "a": reads the whole file, starting at the current position. On end of\n file, it returns the empty string.\n "l": reads the next line skipping the end of line, returning nil on\n end of file. This is the default format.\n "L": reads the next line keeping the end-of-line character (if present),\n returning nil on end of file.\n *number*: reads a string with up to this number of bytes, returning nil on\n end of file. If *number* is zero, it reads nothing and returns an\n empty string, or nil on end of file.\n\nThe formats "l" and "L" should be used only for text files. read io.read(···)\nEquivalent to `io.input():read(···)`. -read spawn_proc:read(arg)\nReads and returns stdout from process *spawn_proc*, according to string\nformat or number *arg*.\nSimilar to Lua's `io.read()` and blocks for input. *spawn_proc* must still be\nrunning. If an error occurs while reading, returns `nil`, an error code, and\nan error message.\nEnsure any read operations read all stdout available. The stdout callback\nfunction passed to `spawn()` will not be called until the stdout buffer is\nclear.\n@param arg Optional argument similar to those in Lua's `io.read()`, but "*n"\n is not supported. The default value is "*l", which reads a line.\n@return string of bytes read +read spawn_proc:read(arg)\nReads and returns stdout from process *spawn_proc*, according to string\nformat or number *arg*.\nSimilar to Lua's `io.read()` and blocks for input. *spawn_proc* must still be\nrunning. If an error occurs while reading, returns `nil`, an error code, and\nan error message.\nEnsure any read operations read all stdout available. The stdout callback\nfunction passed to `spawn()` will not be called until the stdout buffer is\nclear.\n@param arg Optional argument similar to those in Lua's `io.read()`, but "n"\n is not supported. The default value is "l", which reads a line.\n@return string of bytes read read_only buffer.read_only (bool)\nWhether or not the buffer is read-only.\nThe default value is `false`. recent_files io.recent_files (table)\nList of recently opened files, the most recent being towards the top. rectangular_selection_anchor buffer.rectangular_selection_anchor (number)\nThe rectangular selection's anchor position. @@ -904,10 +923,10 @@ register_image buffer.register_image(buffer, type, xpm_data)\nRegisters XPM imag register_rgba_image buffer.register_rgba_image(buffer, type, pixels)\nRegisters RGBA image *pixels* to type number *type* for use in autocompletion\nand user lists.\nThe dimensions for *pixels* (`buffer.rgba_image_width` and\n`buffer.rgba_image_height`) must have already been defined. *pixels* is a\nsequence of 4 byte pixel values (red, blue, green, and alpha) defining the\nimage line by line starting at the top-left pixel.\n@param buffer A buffer.\n@param type Integer type to register the image with.\n@param pixels The RGBA data as described in\n `buffer.marker_define_rgba_image()`. reload_file io.reload_file()\nReloads the current buffer's file contents, discarding any changes. remove os.remove(filename)\nDeletes the file (or empty directory, on POSIX systems) with the given name.\nIf this function fails, it returns nil, plus a string describing the error\nand the error code. -remove table.remove(list [, pos])\nRemoves from `list` the element at position `pos`, returning the value of the\nremoved element. When `pos` is an integer between 1 and `#list`, it shifts\ndown the elements `list[pos+1], list[pos+2], ···, list[#list]` and erases\nelement `list[#list]`; The index `pos` can also be 0 when `#list` is 0, or\n`#list + 1`; in those cases, the function erases the element `list[pos]`.\n\nThe default value for `pos` is `#list`, so that a call `table.remove(t)`\nremoves the last element of list `t`. +remove table.remove(list [, pos])\nRemoves from `list` the element at position `pos`, returning the value of the\nremoved element. When `pos` is an integer between 1 and `#list`, it shifts\ndown the elements `list[pos+1], list[pos+2], ···, list[#list]` and erases\nelement `list[#list]`; The index `pos` can also be 0 when `#list` is 0, or\n`#list + 1`; in those cases, the function erases the element `list[pos]`.\n\nThe default value for `pos` is `#list`, so that a call `table.remove(l)`\nremoves the last element of list `l`. rename os.rename(oldname, newname)\nRenames file or directory named `oldname` to `newname`. If this function\nfails, it returns nil, plus a string describing the error and the error code. -rep string.rep(s, n [, sep])\nReturns a string that is the concatenation of `n` copies of the string `s`\nseparated by the string `sep`. The default value for `sep` is the empty\nstring (that is, no separator). -replace bit32.replace(n, v, field [, width])\nReturns a copy of `n` with the bits `field` to `field + width - 1` replaced\nby the value `v`. See `bit32.extract` for details about `field` and `width`. +rep string.rep(s, n [, sep])\nReturns a string that is the concatenation of `n` copies of the string `s`\nseparated by the string `sep`. The default value for `sep` is the empty\nstring (that is, no separator). Returns the empty string if `n` is not\npositive. +replace bit32.replace(n, v, field [, width])\nReturns a copy of `n` with the bits `field` to `field + width - 1` replaced\nby the value `v`. See `bit32.extract` for details about `field` and `width`.\n\nNew in Lua 5.2.\nDeprecated in Lua 5.3. replace ui.find.replace()\nMimics pressing the "Replace" button. replace_all ui.find.replace_all()\nMimics pressing the "Replace All" button. replace_all_button_text ui.find.replace_all_button_text (string, Write-only)\nThe text of the "Replace All" button.\nThis is primarily used for localization. @@ -918,20 +937,20 @@ replace_sel buffer.replace_sel(buffer, text)\nReplaces the selected text with st replace_target buffer.replace_target(buffer, text)\nReplaces the text in the target range with string *text* sans modifying any\nselections or scrolling the view.\nSetting the target and calling this function with an empty string is another\nway to delete text.\n@param buffer A buffer.\n@param text The text to replace the target range with.\n@return number replace_target_re buffer.replace_target_re(buffer, text)\nReplaces the text in the target range with string *text* but first replaces\nany "\d" sequences with the text of capture number *d* from the regular\nexpression (or the entire match for *d* = 0), and then returns the\nreplacement text's length.\n@param buffer A buffer.\n@param text The text to replace the target range with.\n@return number representation buffer.representation (table)\nThe alternative string representations of characters.\nRepresentations are displayed in the same way control characters are. Use\nthe empty string for the '\0' character when assigning its representation.\nCall `buffer.clear_representation()` to remove a representation. -require _G.require(modname)\nLoads the given module. The function starts by looking into the\n`package.loaded` table to determine whether `modname` is already\nloaded. If it is, then `require` returns the value stored at\n`package.loaded[modname]`. Otherwise, it tries to find a *loader* for\nthe module.\n\nTo find a loader, `require` is guided by the `package.searchers` sequence. By\nchanging this sequence, we can change how `require` looks for a module. The\nfollowing explanation is based on the default configuration for\n`package.searchers`.\n\nFirst `require` queries `package.preload[modname]`. If it has a value,\nthis value (which should be a function) is the loader. Otherwise `require`\nsearches for a Lua loader using the path stored in `package.path`. If\nthat also fails, it searches for a C loader using the path stored in\n`package.cpath`. If that also fails, it tries an *all-in-one* loader (see\n`package.searchers`).\n\nOnce a loader is found, `require` calls the loader with two arguments:\n`modname` and an extra value dependent on how it got the loader. (If the\nloader came from a file, this extra value is the file name.) If the loader\nreturns any non-nil value, `require` assigns the returned value to\n`package.loaded[modname]`. If the loader does not return a non-nil value and\nhas not assigned any value to `package.loaded[modname]`, then `require`\nassigns <b>true</b> to this entry. In any case, `require` returns the final\nvalue of `package.loaded[modname]`.\n\nIf there is any error loading or running the module, or if it cannot find\nany loader for the module, then `require` raises an error. +require _G.require(modname)\nLoads the given module. The function starts by looking into the\n`package.loaded` table to determine whether `modname` is already\nloaded. If it is, then `require` returns the value stored at\n`package.loaded[modname]`. Otherwise, it tries to find a *loader* for\nthe module.\n\nTo find a loader, `require` is guided by the `package.searchers` sequence. By\nchanging this sequence, we can change how `require` looks for a module. The\nfollowing explanation is based on the default configuration for\n`package.searchers`.\n\nFirst `require` queries `package.preload[modname]`. If it has a value,\nthis value (which must be a function) is the loader. Otherwise `require`\nsearches for a Lua loader using the path stored in `package.path`. If\nthat also fails, it searches for a C loader using the path stored in\n`package.cpath`. If that also fails, it tries an *all-in-one* loader (see\n`package.searchers`).\n\nOnce a loader is found, `require` calls the loader with two arguments:\n`modname` and an extra value dependent on how it got the loader. (If the\nloader came from a file, this extra value is the file name.) If the loader\nreturns any non-nil value, `require` assigns the returned value to\n`package.loaded[modname]`. If the loader does not return a non-nil value and\nhas not assigned any value to `package.loaded[modname]`, then `require`\nassigns true to this entry. In any case, `require` returns the final value of\n`package.loaded[modname]`.\n\nIf there is any error loading or running the module, or if it cannot find\nany loader for the module, then `require` raises an error. reset _G.reset()\nResets the Lua state by reloading all initialization scripts.\nLanguage modules for opened files are NOT reloaded. Re-opening the files that\nuse them will reload those modules instead.\nThis function is useful for modifying user scripts (such as\n*~/.textadept/init.lua* and *~/.textadept/modules/textadept/keys.lua*) on\nthe fly without having to restart Textadept. `arg` is set to `nil` when\nreinitializing the Lua State. Any scripts that need to differentiate between\nstartup and reset can test `arg`. rest _G.keys.rest (table)\nContainer for reST-specific key bindings. rest _G.snippets.rest (table)\nContainer for reST-specific snippets. rest _M.rest (module)\nThe reST module.\nIt provides utilities for editing reST and Sphinx documents. -resume coroutine.resume(co [, val1, ···])\nStarts or continues the execution of coroutine `co`. The first time\nyou resume a coroutine, it starts running its body. The values `val1`,\n... are passed as the arguments to the body function. If the coroutine\nhas yielded, `resume` restarts it; the values `val1`, ... are passed\nas the results from the yield.\n\nIf the coroutine runs without any errors, `resume` returns true plus any\nvalues passed to `yield` (if the coroutine yields) or any values returned\nby the body function (if the coroutine terminates). If there is any error,\n`resume` returns false plus the error message. +resume coroutine.resume(co [, val1, ···])\nStarts or continues the execution of coroutine `co`. The first time\nyou resume a coroutine, it starts running its body. The values `val1`,\n··· are passed as the arguments to the body function. If the coroutine\nhas yielded, `resume` restarts it; the values `val1`, ··· are passed\nas the results from the yield.\n\nIf the coroutine runs without any errors, `resume` returns true plus any\nvalues passed to `yield` (when the coroutine yields) or any values returned\nby the body function (when the coroutine terminates). If there is any error,\n`resume` returns false plus the error message. reverse string.reverse(s)\nReturns a string that is the string `s` reversed. rgba_image_height buffer.rgba_image_height (number)\nThe height of the RGBA image to be defined using\n`buffer.marker_define_rgba_image()`. rgba_image_scale buffer.rgba_image_scale (number)\nThe scale factor in percent of the RGBA image to be defined using\n`buffer.marker_define_rgba_image()`.\nThis is useful on OSX with a retina display where each display unit is 2\npixels: use a factor of `200` so that each image pixel is displayed using a\nscreen pixel. The default scale, `100`, will stretch each image pixel to\ncover 4 screen pixels on a retina display. rgba_image_width buffer.rgba_image_width (number)\nThe width of the RGBA image to be defined using\n`buffer.marker_define_rgba_image()` and\n`buffer.register_rgba_image()`. rmdir lfs.rmdir(dirname)\nRemoves an existing directory. The argument is the name of the directory.\n\nReturns true if the operation was successful; in case of error, it returns\nnil plus an error string. rotate_selection buffer.rotate_selection(buffer)\nDesignates the next additional selection to be the main selection.\n@param buffer A buffer. -rrotate bit32.rrotate(x, disp)\nReturns the number `x` rotated `disp` bits to the right. The number `disp`\nmay be any representable integer.\n\nFor any valid displacement, the following identity holds:\n\n assert(bit32.rrotate(x, disp) == bit32.rrotate(x, disp % 32))\n\nIn particular, negative displacements rotate to the left. -rshift bit32.rshift(x, disp)\nReturns the number `x` shifted `disp` bits to the right. The number `disp`\nmay be any representable integer. Negative displacements shift to the left.\nIn any direction, vacant bits are filled with zeros. In particular,\ndisplacements with absolute values higher than 31 result in zero (all bits\nare shifted out).\n\nFor positive displacements, the following equality holds:\n\n assert(bit32.rshift(b, disp) == math.floor(b % 2^32 / 2^disp))\n\nThis shift operation is what is called logical shift. +rrotate bit32.rrotate(x, disp)\nReturns the number `x` rotated `disp` bits to the right. The number `disp`\nmay be any representable integer.\n\nFor any valid displacement, the following identity holds:\n\n assert(bit32.rrotate(x, disp) == bit32.rrotate(x, disp % 32))\n\nIn particular, negative displacements rotate to the left.\n\nNew in Lua 5.2.\nDeprecated in Lua 5.3. +rshift bit32.rshift(x, disp)\nReturns the number `x` shifted `disp` bits to the right. The number `disp`\nmay be any representable integer. Negative displacements shift to the left.\nIn any direction, vacant bits are filled with zeros. In particular,\ndisplacements with absolute values higher than 31 result in zero (all bits\nare shifted out).\n\nFor positive displacements, the following equality holds:\n\n assert(bit32.rshift(b, disp) == math.floor(b % 2^32 / 2^disp))\n\nThis shift operation is what is called logical shift.\n\nNew in Lua 5.2.\nDeprecated in Lua 5.3. ruby _G.keys.ruby (table)\nContainer for Ruby-specific key bindings. ruby _G.snippets.ruby (table)\nContainer for Ruby-specific snippets. ruby _M.ruby (module)\nThe ruby module.\nIt provides utilities for editing Ruby code. @@ -954,10 +973,11 @@ search_flags buffer.search_flags (number)\nThe bit-mask of search flags used by search_in_target buffer.search_in_target(buffer, text)\nSearches for the first occurrence of string *text* in the target range\nbounded by `buffer.target_start` and `buffer.target_end` using search flags\n`buffer.search_flags` and, if found, sets the new target range to that\noccurrence, returning its position or `-1` if *text* was not found.\n@param buffer A buffer.\n@param text The text to search the target range for.\n@return number\n@see search_flags search_next buffer.search_next(buffer, flags, text)\nSearches for and selects the first occurrence of string *text* starting at\nthe search anchor using search flags *flags*, returning that occurrence's\nposition or `-1` if *text* was not found.\nSelected text is not scrolled into view.\n@param buffer A buffer.\n@param flags The search flags to use. See `buffer.search_flags`.\n@param text The text to search for.\n@return number\n@see search_flags search_prev buffer.search_prev(buffer, flags, text)\nSearches for and selects the last occurrence of string *text* before the\nsearch anchor using search flags *flags*, returning that occurrence's\nposition or `-1` if *text* was not found.\n@param buffer A buffer.\n@param flags The search flags to use. See `buffer.search_flags`.\n@param text The text to search for.\n@return number\n@see search_flags -searchers package.searchers (table)\nA table used by `require` to control how to load modules.\nEach entry in this table is a *searcher function*. When looking for a\nmodule, `require` calls each of these searchers in ascending order, with\nthe module name (the argument given to `require`) as its sole parameter.\nThe function can return another function (the module *loader*) plus an\nextra value that will be passed to that loader, or a string explaining why\nit did not find that module (or nil if it has nothing to say).\nLua initializes this table with four functions.\nThe first searcher simply looks for a loader in the `package.preload`\ntable.\nThe second searcher looks for a loader as a Lua library, using the path\nstored at `package.path`. The search is done as described in function\n`package.searchpath`.\nThe third searcher looks for a loader as a C library, using the path given\nby the variable `package.cpath`. Again, the search is done as described in\nfunction `package.searchpath`. For instance, if the C path is the string\n "./?.so;./?.dll;/usr/local/?/init.so"\nthe searcher for module `foo` will try to open the files `./foo.so`,\n`./foo.dll`, and `/usr/local/foo/init.so`, in that order. Once it finds\na C library, this searcher first uses a dynamic link facility to link the\napplication with the library. Then it tries to find a C function inside the\nlibrary to be used as the loader. The name of this C function is the string\n"`luaopen_`" concatenated with a copy of the module name where each dot\nis replaced by an underscore. Moreover, if the module name has a hyphen,\nits prefix up to (and including) the first hyphen is removed. For instance,\nif the module name is `a.v1-b.c`, the function name will be `luaopen_b_c`.\nThe fourth searcher tries an *all-in-one loader*. It searches the C\npath for a library for the root name of the given module. For instance,\nwhen requiring `a.b.c`, it will search for a C library for `a`. If found,\nit looks into it for an open function for the submodule; in our example,\nthat would be `luaopen_a_b_c`. With this facility, a package can pack\nseveral C submodules into one single library, with each submodule keeping\nits original open function.\nAll searchers except the first one (preload) return as the extra value the\nfile name where the module was found, as returned by `package.searchpath`.\nThe first searcher returns no extra value. -searchpath package.searchpath(name, path [, sep [, rep]])\nSearches for the given `name` in the given `path`.\n\nA path is a string containing a sequence of _templates_ separated by\nsemicolons. For each template, the function replaces each interrogation mark\n(if any) in the template with a copy of `name` wherein all occurrences of\n`sep` (a dot, by default) were replaced by `rep` (the system's directory\nseparator, by default), and then tries to open the resulting file name.\nFor instance, if the path is the string\n "./?.lua;./?.lc;/usr/local/?/init.lua"\nthe search for the name `foo.a` will try to open the files `./foo/a.lua`,\n`./foo/a.lc`, and `/usr/local/foo/a/init.lua`, in that order.\nReturns the resulting name of the first file that it can open in read mode\n(after closing the file), or nil plus an error message if none succeeds.\n(This error message lists all file names it tried to open.) +searchers package.searchers (table)\nA table used by `require` to control how to load modules.\nEach entry in this table is a *searcher function*. When looking for a\nmodule, `require` calls each of these searchers in ascending order, with\nthe module name (the argument given to `require`) as its sole parameter.\nThe function can return another function (the module *loader*) plus an\nextra value that will be passed to that loader, or a string explaining why\nit did not find that module (or nil if it has nothing to say).\nLua initializes this table with four functions.\nThe first searcher simply looks for a loader in the `package.preload`\ntable.\nThe second searcher looks for a loader as a Lua library, using the path\nstored at `package.path`. The search is done as described in function\n`package.searchpath`.\nThe third searcher looks for a loader as a C library, using the path given\nby the variable `package.cpath`. Again, the search is done as described in\nfunction `package.searchpath`. For instance, if the C path is the string\n "./?.so;./?.dll;/usr/local/?/init.so"\nthe searcher for module `foo` will try to open the files `./foo.so`,\n`./foo.dll`, and `/usr/local/foo/init.so`, in that order. Once it finds\na C library, this searcher first uses a dynamic link facility to link the\napplication with the library. Then it tries to find a C function inside the\nlibrary to be used as the loader. The name of this C function is the string\n"`luaopen_`" concatenated with a copy of the module name where each dot\nis replaced by an underscore. Moreover, if the module name has a hyphen,\nits suffix after (and including) the first hyphen is removed. For instance,\nif the module name is `a.b.c-v2.1 `, the function name will be\n`luaopen_a_b_c`. The fourth searcher tries an *all-in-one loader*. It\nsearches the C path for a library for the root name of the given module.\nFor instance, when requiring `a.b.c`, it will search for a C library for\n`a`. If found, it looks into it for an open function for the submodule; in\nour example, that would be `luaopen_a_b_c`. With this facility, a package\ncan pack several C submodules into one single library, with each submodule\nkeeping its original open function.\nAll searchers except the first one (preload) return as the extra value the\nfile name where the module was found, as returned by `package.searchpath`.\nThe first searcher returns no extra value.\n\nNew in Lua 5.2. +searchpath package.searchpath(name, path [, sep [, rep]])\nSearches for the given `name` in the given `path`.\n\nA path is a string containing a sequence of _templates_ separated by\nsemicolons. For each template, the function replaces each interrogation mark\n(if any) in the template with a copy of `name` wherein all occurrences of\n`sep` (a dot, by default) were replaced by `rep` (the system's directory\nseparator, by default), and then tries to open the resulting file name.\nFor instance, if the path is the string\n "./?.lua;./?.lc;/usr/local/?/init.lua"\nthe search for the name `foo.a` will try to open the files `./foo/a.lua`,\n`./foo/a.lc`, and `/usr/local/foo/a/init.lua`, in that order.\nReturns the resulting name of the first file that it can open in read mode\n(after closing the file), or nil plus an error message if none succeeds.\n(This error message lists all file names it tried to open.)\n\nNew in Lua 5.2. secure_inputbox ui.dialogs.secure_inputbox(options)\nPrompts the user with a masked inputbox dialog defined by dialog options\ntable *options*, returning the selected button's index along with the user's\ninput text (the latter as a string or table, depending on the type of\n*options*.`informative_text`).\nIf *options*.`string_output` is `true`, returns the selected button's label\nalong with the user's input text.\nIf the dialog timed out, returns `0` or `"timeout"`. If the user canceled the\ndialog, returns `-1` or `"delete"`.\n@param options Table of key-value option pairs for the inputbox.\n\n * `title`: The dialog's title text.\n * `informative_text`: The dialog's main message text. If the value is a\n table, the first table value is the main message text and any subsequent\n values are used as the labels for multiple entry boxes. Providing a\n single label has no effect.\n * `text`: The dialog's initial input text. If the value is a table, the\n table values are used to populate the multiple entry boxes defined by\n `informative_text`.\n * `button1`: The right-most button's label. The default value is\n `_L['_OK']`.\n * `button2`: The middle button's label.\n * `button3`: The left-most button's label. This option requires `button2`\n to be set.\n * `string_output`: Return the selected button's label (instead of its\n index) or the dialog's exit status instead of the button's index (instead\n of its exit code). The default value is `false`.\n * `width`: The dialog's pixel width.\n * `height`: The dialog's pixel height.\n * `float`: Show the dialog on top of all desktop windows. The default value\n is `false`.\n * `timeout`: the integer number of seconds the dialog waits for the user to\n select a button before timing out. Dialogs do not time out by default.\n@return selected button or exit code, input text secure_standard_inputbox ui.dialogs.secure_standard_inputbox(options)\nPrompts the user with a masked inputbox dialog defined by dialog options\ntable *options* and with localized "Ok" and "Cancel" buttons, returning the\nselected button's index along with the user's input text (the latter as a\nstring or table, depending on the type of *options*.`informative_text`).\nIf *options*.`string_output` is `true`, returns the selected button's label\nalong with the user's input text.\nIf the dialog timed out, returns `0` or `"timeout"`. If the user canceled the\ndialog, returns `-1` or `"delete"`.\n@param options Table of key-value option pairs for the inputbox.\n\n * `title`: The dialog's title text.\n * `informative_text`: The dialog's main message text. If the value is a\n table, the first table value is the main message text and any subsequent\n values are used as the labels for multiple entry boxes. Providing a\n single label has no effect.\n * `text`: The dialog's initial input text. If the value is a table, the\n table values are used to populate the multiple entry boxes defined by\n `informative_text`.\n * `no_cancel`: Do not display the "Cancel" button. The default value is\n `false`.\n * `string_output`: Return the selected button's label (instead of its\n index) or the dialog's exit status instead of the button's index (instead\n of its exit code). The default value is `false`.\n * `width`: The dialog's pixel width.\n * `height`: The dialog's pixel height.\n * `float`: Show the dialog on top of all desktop windows. The default value\n is `false`.\n * `timeout`: the integer number of seconds the dialog waits for the user to\n select a button before timing out. Dialogs do not time out by default.\n@return selected button or exit code, input text +seeall package.seeall(module)\nSets a metatable for `module` with its `__index` field referring to the\nglobal environment, so that this module inherits values from the global\nenvironment. To be used as an option to function `module`.\n\nDeprecated in Lua 5.2. seek file:seek([whence [, offset]])\nSets and gets the file position, measured from the beginning of the\nfile, to the position given by `offset` plus a base specified by the string\n`whence`, as follows:\n "set": base is position 0 (beginning of the file);\n "cur": base is current position;\n "end": base is end of file;\n\nIn case of success, function `seek` returns the final file position,\nmeasured in bytes from the beginning of the file. If `seek` fails, it returns\nnil, plus a string describing the error.\n\nThe default value for `whence` is `"cur"`, and for `offset` is 0. Therefore,\nthe call `file:seek()` returns the current file position, without changing\nit; the call `file:seek("set")` sets the position to the beginning of the\nfile (and returns 0); and the call `file:seek("end")` sets the position\nto the end of the file, and returns its size. sel_alpha buffer.sel_alpha (number)\nThe selection's alpha value, ranging from `0` (transparent) to `255`\n(opaque).\nThe default value is `buffer.ALPHA_NOALPHA`, for no alpha. sel_eol_filled buffer.sel_eol_filled (bool)\nExtend the selection to the view's right margin.\nThe default value is `false`. @@ -1003,7 +1023,9 @@ set_whitespace_back buffer.set_whitespace_back(buffer, use_setting, color)\nOver set_whitespace_fore buffer.set_whitespace_fore(buffer, use_setting, color)\nOverrides the foreground color of whitespace with color *color*, in\n"0xBBGGRR" format, if *use_setting* is `true`.\n@param use_setting Whether or not to use *color*.\n@param color The color in "0xBBGGRR" format. set_x_caret_policy buffer.set_x_caret_policy(buffer, policy, x)\nDefines scrolling policy bit-mask *policy* as the policy for keeping the\ncaret *x* number of pixels away from the horizontal margins.\n@param buffer A buffer.\n@param policy The combination of `buffer.CARET_SLOP`, `buffer.CARET_STRICT`,\n `buffer.CARET_EVEN`, and `buffer.CARET_JUMPS` policy flags to set.\n@param x The number of pixels from the horizontal margins to keep the caret. set_y_caret_policy buffer.set_y_caret_policy(buffer, policy, y)\nDefines scrolling policy bit-mask *policy* as the policy for keeping the\ncaret *y* number of lines away from the vertical margins.\n@param buffer A buffer.\n@param policy The combination of `buffer.CARET_SLOP`, `buffer.CARET_STRICT`,\n `buffer.CARET_EVEN`, and `buffer.CARET_JUMPS` policy flags to set.\n@param y The number of lines from the vertical margins to keep the caret. -sethook debug.sethook([thread, ] hook, mask [, count])\nSets the given function as a hook. The string `mask` and the number\n`count` describe when the hook will be called. The string mask may have\nthe following characters, with the given meaning:\n "c": the hook is called every time Lua calls a function;\n "r": the hook is called every time Lua returns from a function;\n "l": the hook is called every time Lua enters a new line of code.\n\nWith a `count` different from zero, the hook is called after every `count`\ninstructions.\n\nWhen called without arguments, `debug.sethook` turns off the hook.\n\nWhen the hook is called, its first parameter is a string describing\nthe event that has triggered its call: `"call"` (or `"tail call"`),\n`"return"`, `"line"`, and `"count"`. For line events, the hook also gets the\nnew line number as its second parameter. Inside a hook, you can call\n`getinfo` with level 2 to get more information about the running function\n(level 0 is the `getinfo` function, and level 1 is the hook function). +setfenv _G.setfenv(f, table)\nSets the environment to be used by the given function. `f` can be a Lua\nfunction or a number that specifies the function at that stack level: Level 1\nis the function calling `setfenv`. `setfenv` returns the given function. As a\nspecial case, when `f` is 0 `setfenv` changes the environment of the running\nthread. In this case, `setfenv` returns no values.\n\nDeprecated in Lua 5.2. +setfenv debug.setfenv(object, table)\nSets the environment of the given `object` to the given `table`. Returns\n`object`.\n\nDeprecated in Lua 5.2. +sethook debug.sethook([thread, ] hook, mask [, count])\nSets the given function as a hook. The string `mask` and the number\n`count` describe when the hook will be called. The string mask may have any\ncombination of the following characters, with the given meaning:\n "c": the hook is called every time Lua calls a function;\n "r": the hook is called every time Lua returns from a function;\n "l": the hook is called every time Lua enters a new line of code.\n\nMoreover, with a `count` different from zero, the hook is called also after\nevery `count` instructions.\n\nWhen called without arguments, `debug.sethook` turns off the hook.\n\nWhen the hook is called, its first parameter is a string describing\nthe event that has triggered its call: `"call"` (or `"tail call"`),\n`"return"`, `"line"`, and `"count"`. For line events, the hook also gets the\nnew line number as its second parameter. Inside a hook, you can call\n`getinfo` with level 2 to get more information about the running function\n(level 0 is the `getinfo` function, and level 1 is the hook function). setlocal debug.setlocal([thread, ] level, local, value)\nThis function assigns the value `value` to the local variable with\nindex `local` of the function at level `level` of the stack. The function\nreturns nil if there is no local variable with the given index, and raises\nan error when called with a `level` out of range. (You can call `getinfo`\nto check whether the level is valid.) Otherwise, it returns the name of\nthe local variable.\n\nSee `debug.getlocal` for more information about variable indices and names. setlocale os.setlocale(locale [, category])\nSets the current locale of the program. `locale` is a system-dependent string\nspecifying a locale; `category` is an optional string describing which\ncategory to change: `"all"`, `"collate"`, `"ctype"`, `"monetary"`,\n`"numeric"`, or `"time"`; the default category is `"all"`. The function\nreturns the name of the new locale, or nil if the request cannot be honored.\n\nIf `locale` is the empty string, the current locale is set to an\nimplementation-defined native locale. If `locale` is the string "`C`",\nthe current locale is set to the standard C locale.\n\nWhen called with nil as the first argument, this function only returns\nthe name of the current locale for the given category.\n\nThis function may not be thread safe because of its reliance on C function\n`setlocale`. setmaxstack lpeg.setmaxstack(max)\nSets the maximum size for the backtrack stack used by LPeg to track calls and\nchoices. Most well-written patterns need little backtrack levels and\ntherefore you seldom need to change this maximum; but a few useful patterns\nmay need more space. Before changing this maximum you should try to rewrite\nyour pattern to avoid the need for extra space. @@ -1011,12 +1033,12 @@ setmetatable _G.setmetatable(table, metatable)\nSets the metatable for the given setmetatable debug.setmetatable(value, table)\nSets the metatable for the given `value` to the given `table` (which\ncan be nil). setmode lfs.setmode(file, mode)\nSets the writing mode for a file. The mode string can be either binary or\ntext. Returns the previous mode string for the file. This function is only\navailable in Windows, so you may want to make sure that lfs.setmode exists\nbefore using it. setupvalue debug.setupvalue(f, up, value)\nThis function assigns the value `value` to the upvalue with index `up`\nof the function `f`. The function returns nil if there is no upvalue with the\ngiven index. Otherwise, it returns the name of the upvalue. -setuservalue debug.setuservalue(udata, value)\nSets the given `value` as the Lua value associated to the given `udata`.\n`value` must be a table or nil; `udata` must be a full userdata.\n\nReturns `udata`. +setuservalue debug.setuservalue(udata, value)\nSets the given `value` as the Lua value associated to the given `udata`.\n`udata` must be a full userdata.\n\nReturns `udata`.\n\nNew in Lua 5.2. setvbuf file:setvbuf(mode [, size])\nSets the buffering mode for an output file. There are three available\nmodes:\n "no": no buffering; the result of any output operation appears immediately.\n "full": full buffering; output operation is performed only when the\n buffer is full or when you explicitly `flush` the file (see\n `io.flush`).\n "line": line buffering; output is buffered until a newline is output or\n there is any input from some special files (such as a terminal\n device).\n\nFor the last two cases, `size` specifies the size of the buffer, in\nbytes. The default is an appropriate size. show_documentation textadept.editing.show_documentation()\nDisplays a call tip with documentation for the symbol under or directly\nbehind the caret.\nIf a call tip is already shown, cycles to the next one if it exists.\nDocumentation is stored in API files in the `api_files` table.\nSymbols are determined by using `buffer.word_chars`.\n@see api_files\n@see buffer.word_chars show_lines buffer.show_lines(buffer, start_line, end_line)\nShows the range of lines between line numbers *start_line* to *end_line*.\nThis has no effect on fold levels or fold flags and the first line cannot be\nhidden.\n@param buffer A buffer.\n@param start_line The start line of the range of lines in *buffer* to show.\n@param end_line The end line of the range of lines in *buffer* to show. sin math.sin(x)\nReturns the sine of `x` (assumed to be in radians). -sinh math.sinh(x)\nReturns the hyperbolic sine of `x`. +sinh math.sinh(x)\nReturns the hyperbolic sine of `x`.\n\nDeprecated in Lua 5.3. size ui.size (table)\nA table containing the width and height pixel values of Textadept's window. size view.size (number)\nThe split resizer's pixel position if the view is a split one. snapopen io.snapopen(paths, filter, exclude_FILTER, opts)\nPrompts the user to select files to be opened from *paths*, a string\ndirectory path or list of directory paths, using a filtered list dialog.\nIf *paths* is `nil`, uses the current project's root directory, which is\nobtained from `io.get_project_root()`.\nFiles shown in the dialog do not match any pattern in either string or table\n*filter* or, unless *exclude_FILTER* is `true`, in `lfs.FILTER`. A filter\ntable contains Lua patterns that match filenames to exclude, an optional\n`folders` sub-table that contains patterns matching directories to exclude,\nand an optional `extensions` sub-table that contains raw file extensions to\nexclude. Any patterns starting with '!' exclude files and directories that do\nnot match the pattern that follows. The number of files in the list is capped\nat `SNAPOPEN_MAX`. If *filter* is `nil` and *paths* is ultimately a string,\nthe filter from the `io.snapopen_filters` table is used. In that case, unless\nexplicitly specified, *exclude_FILTER* becomes `true`.\n*opts* is an optional table of additional options for\n`ui.dialogs.filteredlist()`.\n@param paths Optional string directory path or table of directory paths to\n search. The default value is the current project's root directory, if\n available.\n@param filter Optional filter for files and directories to exclude. The\n default value comes from `io.snapopen_filters` if *paths* is a string.\n@param exclude_FILTER Optional flag indicating whether or not to exclude the\n default filter `lfs.FILTER` in the search. If `false`, adds `lfs.FILTER` to\n *filter*.\n Normally, the default value is `false` to include the default filter.\n However, in the instances where *filter* comes from `io.snapopen_filters`,\n the default value is `true`.\n@param opts Optional table of additional options for\n `ui.dialogs.filteredlist()`.\n@usage io.snapopen(buffer.filename:match('^.+/')) -- list all files in the\n current file's directory, subject to the default filter\n@usage io.snapopen('/project', '!%.lua$') -- list all Lua files in a project\n directory\n@usage io.snapopen('/project', {folders = {'build'}}) -- list all source\n files in a project directory\n@see io.snapopen_filters\n@see lfs.FILTER\n@see SNAPOPEN_MAX\n@see ui.dialogs.filteredlist @@ -1079,7 +1101,7 @@ tags _M.lua.tags (table)\nList of "fake" ctags files to use for autocompletion.\ tags _M.python.tags (table)\nList of ctags files to use for autocompletion. tags _M.ruby.tags (table)\nList of "fake" ctags files to use for autocompletion.\nIn addition to the normal ctags kinds for Ruby, the kind 'C' is recognized as\na constant and 'a' as an attribute. tan math.tan(x)\nReturns the tangent of `x` (assumed to be in radians). -tanh math.tanh(x)\nReturns the hyperbolic tangent of `x`. +tanh math.tanh(x)\nReturns the hyperbolic tangent of `x`.\n\nDeprecated in Lua 5.3. target_end buffer.target_end (number)\nThe position of the end of the target range.\nThis is also set by a successful `buffer.search_in_target()`. target_from_selection buffer.target_from_selection(buffer)\nDefines the target range's beginning and end positions as the beginning and\nend positions of the main selection, respectively.\n@param buffer A buffer. target_start buffer.target_start (number)\nThe position of the beginning of the target range.\nThis is also set by a successful `buffer.search_in_target()`. @@ -1099,30 +1121,36 @@ toggle textadept.bookmarks.toggle(on)\nToggles the bookmark on the current line toggle_block _M.ruby.toggle_block()\nToggles between `{ ... }` and `do ... end` Ruby blocks.\nIf the caret is inside a `{ ... }` single-line block, that block is converted\nto a multiple-line `do .. end` block. If the caret is on a line that contains\nsingle-line `do ... end` block, that block is converted to a single-line\n`{ ... }` block. If the caret is inside a multiple-line `do ... end` block,\nthat block is converted to a single-line `{ ... }` block with all newlines\nreplaced by a space. Indentation is important. The `do` and `end` keywords\nmust be on lines with the same level of indentation to toggle correctly. toggle_caret_sticky buffer.toggle_caret_sticky(buffer)\nCycles between `buffer.caret_sticky` option settings `buffer.CARETSTICKY_ON`\nand `buffer.CARETSTICKY_OFF`.\n@param buffer A buffer.\n@see caret_sticky toggle_fold buffer.toggle_fold(buffer, line)\nToggles the fold point on line number *line* between expanded (where all of\nits child lines are displayed) and contracted (where all of its child lines\nare hidden).\n@param buffer A buffer.\n@param line The line number in *buffer* to toggle the fold on. +tointeger math.tointeger(x)\nIf the value `x` is convertible to an integer, returns that integer.\nOtherwise, returns nil.\n\nNew in Lua 5.3. token lexer.token(name, patt)\nCreates and returns a token pattern with token name *name* and pattern\n*patt*.\nIf *name* is not a predefined token name, its style must be defined in the\nlexer's `_tokenstyles` table.\n@param name The name of token. If this name is not a predefined token name,\n then a style needs to be assiciated with it in the lexer's `_tokenstyles`\n table.\n@param patt The LPeg pattern associated with the token.\n@usage local ws = token(l.WHITESPACE, l.space^1)\n@usage local annotation = token('annotation', '@' * l.word)\n@return pattern -tonumber _G.tonumber(e [, base])\nWhen called with no `base`, `tonumber` tries to convert its argument to a\nnumber. If the argument is already a number or a string convertible to a\nnumber (see §3.4.2), then `tonumber` returns this number; otherwise, it\nreturns nil.\n\nWhen called with `base`, then `e` should be a string to be interpreted as an\ninteger numeral in that base. The base may be any integer between 2 and 36,\ninclusive. In bases above 10, the letter '`A`' (in either upper or lower\ncase) represents 10, '`B`' represents 11, and so forth, with '`Z`'\nrepresenting 35. If the string `e` is not a valid numeral in the given base,\nthe function returns nil -tostring _G.tostring(v)\nReceives a value of any type and converts it to a string in a reasonable\nformat. (For complete control of how numbers are converted, use\n`string.format`.)\n\nIf the metatable of `v` has a `"__tostring"` field, then `tostring` calls the\ncorresponding value with `v` as argument, and uses the result of the call as\nits result. +tonumber _G.tonumber(e [, base])\nWhen called with no `base`, `tonumber` tries to convert its argument to a\nnumber. If the argument is already a number or a string convertible to a\nnumber, then `tonumber` returns this number; otherwise, it\nreturns nil.\n\nThe conversion of strings can result in integers or floats, according to the\nlexical conventions of Lua (see §3.1). (The string may have leading and\ntrailing spaces and a sign.)\n\nWhen called with `base`, then `e` must be a string to be interpreted as an\ninteger numeral in that base. The base may be any integer between 2 and 36,\ninclusive. In bases above 10, the letter '`A`' (in either upper or lower\ncase) represents 10, '`B`' represents 11, and so forth, with '`Z`'\nrepresenting 35. If the string `e` is not a valid numeral in the given base,\nthe function returns nil +tostring _G.tostring(v)\nReceives a value of any type and converts it to a string in a human-readable\nformat. Floats always produce strings with some floating-point indication\n(either a decimal dot or an exponent). (For complete control of how numbers\nare converted, use `string.format`.)\n\nIf the metatable of `v` has a `"__tostring"` field, then `tostring` calls the\ncorresponding value with `v` as argument, and uses the result of the call as\nits result. touch lfs.touch(filepath [, atime [, mtime]])\nSet access and modification times of a file. This function is a bind to utime\nfunction. The first argument is the filename, the second argument (atime) is\nthe access time, and the third argument (mtime) is the modification time.\nBoth times are provided in seconds (which should be generated with Lua\nstandard function os.time). If the modification time is omitted, the access\ntime provided is used; if both times are omitted, the current time is used.\n\nReturns true if the operation was successful; in case of error, it returns\nnil plus an error string. -traceback debug.traceback([thread, ] [message] [, level])\nIf `message` is present but is neither a string nor nil, this function\nreturns `message` without further processing. Otherwise, it returns a string\nwith a traceback of the call stack. An optional `message` string is appended\nat the beginning of the traceback. An optional `level` number tells at which\nlevel to start the traceback (default is 1, the function calling\n`traceback`). +traceback debug.traceback([thread, ] [message] [, level])\nIf `message` is present but is neither a string nor nil, this function\nreturns `message` without further processing. Otherwise, it returns a string\nwith a traceback of the call stack. The optional `message` string is appended\nat the beginning of the traceback. An optional `level` number tells at which\nlevel to start the traceback (default is 1, the function calling\n`traceback`). transpose_chars textadept.editing.transpose_chars()\nTransposes characters intelligently.\nIf the caret is at the end of a line, transposes the two characters before\nthe caret. Otherwise, the characters to the left and right are. try_to_autocomplete_end _M.lua.try_to_autocomplete_end()\nTries to autocomplete control structures like `if`, `while`, `for`, etc. with\nthe `end` keyword.\n@see control_structure_patterns try_to_autocomplete_end _M.ruby.try_to_autocomplete_end()\nTries to autocomplete Ruby's `end` keyword for control structures like `if`,\n`while`, `for`, etc.\n@see control_structure_patterns type _G.type(v)\nReturns the type of its only argument, coded as a string. The possible\nresults of this function are "\n`nil`" (a string, not the value nil), "`number`", "`string`", "`boolean`",\n"`table`", "`function`", "`thread`", and "`userdata`". type io.type(obj)\nChecks whether `obj` is a valid file handle. Returns the string `"file"`\nif `obj` is an open file handle, `"closed file"` if `obj` is a closed file\nhandle, or nil if `obj` is not a file handle. type lpeg.type(value)\nIf the given value is a pattern, returns the string "pattern". Otherwise\nreturns nil. +type math.type(x)\nReturns "integer" if `x` is an integer, "float" if it is a float, or nil if\nx is not a number.\n\nNew in Lua 5.3. typeover_chars textadept.editing.typeover_chars (table)\nTable of characters to move over when typed, with language-specific typeover\ncharacter tables assigned to a lexer name key.\nThe ASCII values of characters are keys and are assigned non-`nil` values.\nThe default characters are ')', ']', '}', ''', and '"'.\n@see TYPEOVER_CHARS ui _G.ui (module)\nUtilities for interacting with Textadept's user interface. +ult math.ult(m, n)\nReturns a boolean, true if integer `m` is below integer `n` when they are\ncompared as unsigned integers.\n\nNew in Lua 5.3. undo buffer.undo(buffer)\nUndoes the most recent action.\n@param buffer A buffer. unlock lfs.unlock(filehandle[, start[, length]])\nUnlocks a file or a part of it. This function works on open files; the file\nhandle should be specified as the first argument. The optional arguments\nstart and length can be used to specify a starting point and its length; both\nshould be numbers.\n\nReturns true if the operation was successful; in case of error, it returns\nnil plus an error string. -unpack table.unpack(list [, i [, j]])\nReturns the elements from the given table. This function is equivalent to\n\n return list[i], list[i+1], ···, list[j]\n\nBy default, `i` is 1 and `j` is `#list`. +unpack _G.unpack(list [, i [, j]])\nReturns the elements from the given table. This function is equivalent to\nreturn list[i], list[i+1], ···, list[j] except that the above code can\nbe written only for a fixed number of elements. By default, `i` is 1 and\n`j` is the length of the list, as defined by the length operator\n(see §2.5.5).\n\nDeprecated in Lua 5.2. +unpack string.unpack(fmt, s [, pos])\nReturns the values packed in string `s` (see `string.pack`) according to the\nformat string `fmt` (see §6.4.2). An optional `pos` marks where to start\nreading in `s` (default is 1). After the read values, this function also\nreturns the index of the first unread byte in `s`.\n\nNew in Lua 5.3. +unpack table.unpack(list [, i [, j]])\nReturns the elements from the given list. This function is equivalent to\n\n return list[i], list[i+1], ···, list[j]\n\nBy default, `i` is 1 and `j` is `#list`.\n\nNew in Lua 5.2. unsplit view.unsplit(view)\nUnsplits the view if possible, returning `true` on success.\n@param view The view to unsplit.\n@return boolean if the view was unsplit or not. upper lexer.upper (pattern)\nA pattern that matches any upper case character ('A'-'Z'). upper string.upper(s)\nReceives a string and returns a copy of this string with all lowercase\nletters changed to uppercase. All other characters are left unchanged. The\ndefinition of what a lowercase letter is depends on the current locale. upper_case buffer.upper_case(buffer)\nConverts the selected text to upper case letters.\n@param buffer A buffer. -upvalueid debug.upvalueid(f, n)\nReturns an unique identifier (as a light userdata) for the upvalue numbered\n`n` from the given function.\n\nThese unique identifiers allow a program to check whether different closures\nshare upvalues. Lua closures that share an upvalue (that is, that access a\nsame external local variable) will return identical ids for those upvalue\nindices. -upvaluejoin debug.upvaluejoin(f1, n1, f2, n2)\nMake the `n1`-th upvalue of the Lua closure `f1` refer to the `n2`-th upvalue\nof the Lua closure `f2`. +upvalueid debug.upvalueid(f, n)\nReturns a unique identifier (as a light userdata) for the upvalue numbered\n`n` from the given function.\n\nThese unique identifiers allow a program to check whether different closures\nshare upvalues. Lua closures that share an upvalue (that is, that access a\nsame external local variable) will return identical ids for those upvalue\nindices.\n\nNew in Lua 5.2. +upvaluejoin debug.upvaluejoin(f1, n1, f2, n2)\nMake the `n1`-th upvalue of the Lua closure `f1` refer to the `n2`-th upvalue\nof the Lua closure `f2`.\n\nNew in Lua 5.2. use_tabs buffer.use_tabs (bool)\nUse tabs instead of spaces in indentation. Changing the current setting\ndoes not convert any of the buffer's existing indentation. Use\n`textadept.editing.convert_indentation()` to do so.\nThe default value is `true`. user_list_show buffer.user_list_show(buffer, id, items)\nDisplays a user list identified by list identifier number *id* and\nconstructed from string *items* (whose items are delimited by\n`buffer.auto_c_separator` characters).\nThe sorted order of *items* (`buffer.auto_c_order`) must have already been\ndefined. When the user selects an item, *id* is sent in a\n`USER_LIST_SELECTION` event along with the selection.\n@param buffer A buffer.\n@param id The list identifier number greater than zero to use.\n@param items The sorted string of words to show, separated by\n `buffer.auto_c_separator` characters (initially spaces).\n@see _SCINTILLA.next_user_list_type +utf8 _G.utf8 (module)\nLua utf8 module. v_scroll_bar buffer.v_scroll_bar (bool)\nDisplay the vertical scroll bar.\nThe default value is `true`. vc_home buffer.vc_home(buffer)\nMoves the caret to the first visible character on the current line or, if\nalready there, to the beginning of the current line.\n@param buffer A buffer. vc_home_display buffer.vc_home_display(buffer)\nMoves the caret to the first visible character on the current wrapped line,\nor if already there, to the beginning of the current wrapped line.\n@param buffer A buffer. @@ -1173,7 +1201,7 @@ write io.write(···)\nEquivalent to `io.output():write(···)`. write spawn_proc:write(...)\nWrites string input to the stdin of process *spawn_proc*.\n@param ... Standard input for *spawn_proc*. x_offset buffer.x_offset (number)\nThe horizontal scroll pixel position.\nA value of `0` is the normal position with the first text column visible at\nthe left of the view. xdigit lexer.xdigit (pattern)\nA pattern that matches any hexadecimal digit ('0'-'9', 'A'-'F', 'a'-'f'). -xor bit32.xor(...)\nReturns the bitwise "exclusive or" of its operands. +xor bit32.xor(...)\nReturns the bitwise "exclusive or" of its operands.\n\nNew in Lua 5.2.\nDeprecated in Lua 5.3. xpcall _G.xpcall(f, msgh [, arg1, ···])\nThis function is similar to `pcall`, except that it sets a new message\nhandler `msgh`. yaml _G.keys.yaml (table)\nContainer for YAML-specific key bindings. yaml _G.snippets.yaml (table)\nContainer for YAML-specific snippets. diff --git a/modules/lua/lua.luadoc b/modules/lua/lua.luadoc index 46ce6035..b29bc47b 100644 --- a/modules/lua/lua.luadoc +++ b/modules/lua/lua.luadoc @@ -5,17 +5,17 @@ -- @field _G (table) -- A global variable (not a function) that holds the global environment -- (see §2.2). Lua itself does not use this variable; changing its value does --- not affect any environment, nor vice-versa. +-- not affect any environment, nor vice versa. -- @field _VERSION (string) -- A global variable (not a function) that holds a string containing the --- current interpreter version. The current contents of this variable is --- "`Lua 5.2`". +-- current interpreter version. The current value of this variable is +-- "`Lua 5.3`". local _G --- --- Issues an error when the value of its argument `v` is false (i.e., --- nil or false); otherwise, returns all its arguments. `message` is an error --- message; when absent, it defaults to "assertion failed!" +-- Calls `error` if the value of its argument `v` is false (i.e., nil or false); +-- otherwise, returns all its arguments. In case of error, `message` is the +-- error object; when absent, it defaults to "assertion failed!". function assert(v [, message]) end --- @@ -25,20 +25,14 @@ function assert(v [, message]) end -- option. -- "stop": stops automatic execution of the garbage collector. -- "restart": restarts automatic execution of the garbage collector. --- "count": returns the total memory in use by Lua (in Kbytes) and a second --- value with the total memory in bytes modulo 1024. The first value --- has a fractional part, so the following equality is always true: --- --- k, b = collectgarbage("count") --- assert(k*1024 == math.floor(k)*1024 + b) --- --- (The second result is useful when Lua is compiled with a non --- floating-point type for numbers.) +-- "count": returns the total memory in use by Lua in Kbytes. The value has a +-- fractional part, so that it multiplied by 1024 gives the exact +-- number of bytes in use by Lua (except for overflows). -- "step": performs a garbage-collection step. The step "size" is controlled --- by `arg` (larger values mean more steps) in a non-specified way. If --- you want to control the step size you must experimentally tune the --- value of `arg`. Returns true if the step finished a collection --- cycle. +-- by `arg`. With a zero value, the collector will perform one basic +-- (indivisible) step. For non-zero values, the collector will perform +-- as if that amount of memory (in KBytes) had been allocated by Lua. +-- Returns true if the step finished a collection cycle. -- "setpause": sets `arg` as the new value for the *pause* of the collector -- (see §2.5). Returns the previous value for *pause*. -- "setstepmul": sets `arg` as the new value for the *step multiplier* @@ -46,10 +40,6 @@ function assert(v [, message]) end -- *step*. -- "isrunning": returns a boolean that tells whether the collector is running -- (i.e., not stopped). --- "generational": changes the collector to generational mode. This is an --- experimental feature (see §2.5). --- "incremental": changes the collector to incremental mode. This is the --- default mode. function collectgarbage([opt [, arg]]) end --- @@ -62,7 +52,7 @@ function dofile([filename]) end --- -- Terminates the last protected function called and returns `message` --- as the error message. Function `error` never returns. +-- as the error object. Function `error` never returns. -- -- Usually, `error` adds some information about the error position at the -- beginning of the message, if the message is a string. The `level` argument @@ -74,50 +64,62 @@ function dofile([filename]) end function error(message [, level]) end --- +-- Returns the current environment in use by the function. `f` can be a Lua +-- function or a number that specifies the function at that stack level: +-- Level 1 is the function calling `getfenv`. If the given function is not a +-- Lua function, or if `f` is 0, `getfenv` returns the global environment. The +-- default for `f` is 1. +-- +-- Deprecated in Lua 5.2. +function getfenv([f]) end + +--- -- If `object` does not have a metatable, returns nil. Otherwise, if the -- object's metatable has a `"__metatable"` field, returns the associated -- value. Otherwise, returns the metatable of the given object. function getmetatable(object) end --- --- If `t` has a metamethod `__ipairs`, calls it with `t` as argument and returns --- the first three results from the call. --- --- Otherwise, returns three values: an iterator function, the table `t`, and 0, --- so that the construction +-- Returns three values (an iterator function, the table `t`, and 0) so that the +-- construction -- -- for i,v in ipairs(t) do *body* end -- --- will iterate over the pairs (`1,t[1]`), (`2,t[2]`), ..., up to the --- first integer key absent from the table. +-- will iterate over the key-value pairs (`1,t[1]`), (`2,t[2]`), ···, up to the +-- first nil value. function ipairs(t) end --- -- Loads a chunk. -- --- If `ld` is a string, the chunk is this string. If `ld` is a function, `load` --- calls it repeatedly to get the chunk pieces. Each call to `ld` must return a +-- If `chunk` is a string, the chunk is this string. If `chunk` is a function, `load` +-- calls it repeatedly to get the chunk pieces. Each call to `chunk` must return a -- string that concatenates with previous results. A return of an empty string, -- nil, or no value signals the end of the chunk. -- -- If there are no syntactic errors, returns the compiled chunk as a function; --- otherwise, returns <b>nil</b> plus the error message. +-- otherwise, returns nil plus the error message. -- -- If the resulting function has upvalues, the first upvalue is set to the value -- of `env`, if that parameter is given, or to the value of the global --- environment. (When you load a main chunk, the resulting function will always --- have exactly one upvalue, the `_ENV` variable (see §2.2). When you load a --- binary chunk created from a function (see `string.dump`), the resulting --- function can have arbitrary upvalues.) --- --- `source` is used as the source of the chunk for error messages and debug --- information (see §4.9). When absent, it defaults to `ld`, if `ld` is a +-- environment. Other upvalues are initialized with nil. (When you load a main +-- chunk, the resulting function will always have exactly one upvalue, the +-- `_ENV` variable (see §2.2). However, when you load a binary chunk created +-- from a function (see `string.dump`), the resulting function can have an +-- arbitrary number of upvalues.) All upvalues are fresh, that is, they are not +-- shared with any other function. +-- +-- `chunkname` is used as the name of the chunk for error messages and debug +-- information (see §4.9). When absent, it defaults to `chunk`, if `chunk` is a -- string, or to "`=(load)`" otherwise. -- -- The string `mode` controls whether the chunk can be text or binary (that is, -- a precompiled chunk). It may be the string "`b`" (only binary chunks), "`t`" -- (only text chunks), or "`bt`" (both binary and text). The default is "`bt`". -function load(ld [, source [, mode [, env]]]) end +-- +-- Lua does not check the consistency of binary chunks. Maliciously crafted +-- binary chunks can crash the interpreter. +function load(chunk [, chunkname [, mode [, env]]]) end --- -- Similar to `load`, but gets the chunk from file `filename` or from the @@ -125,6 +127,34 @@ function load(ld [, source [, mode [, env]]]) end function loadfile([filename [, mode [, env]]]) end --- +-- Similar to `load`, but gets the chunk from the given string. To load and +-- run a given string, use the idiom assert(loadstring(s))() When absent, +-- `chunkname` defaults to the given string. +-- +-- Deprecated in Lua 5.2. +function loadstring(string [, chunkname]) + +--- +-- Creates a module. If there is a table in `package.loaded[name]`, this table +-- is the module. Otherwise, if there is a global table `t` with the given name, +-- this table is the module. Otherwise creates a new table `t` and sets it as +-- the value of the global `name` and the value of `package.loaded[name]`. This +-- function also initializes `t._NAME` with the given name, `t._M` with the +-- module (`t` itself), and `t._PACKAGE` with the package name (the full module +-- name minus last component; see below). Finally, `module` sets `t` as the new +-- environment of the current function and the new value of +-- `package.loaded[name]`, so that `require` returns `t`. If `name` is a +-- compound name (that is, one with components separated by dots), `module` +-- creates (or reuses, if they already exist) tables for each component. For +-- instance, if `name` is `a.b.c`, then `module` stores the module table in +-- field `c` of field `b` of global `a`. This function can receive optional +-- *options* after the module name, where each option is a function to be +-- applied over the module. +-- +-- Deprecated in Lua 5.2. +function module(name [, ···]) end + +--- -- Allows a program to traverse all fields of a table. Its first argument is -- a table and its second argument is an index in this table. `next` returns -- the next index of the table and its associated value. When called with nil @@ -188,7 +218,9 @@ function rawget(table, index) end -- Returns the length of the object `v`, -- which must be a table or a string, -- without invoking any metamethod. --- Returns an integer number. +-- Returns an integer. +-- +-- New in Lua 5.2. function rawlen(v) end --- @@ -200,6 +232,16 @@ function rawlen(v) end function rawset(table, index, value) end --- +-- Sets the environment to be used by the given function. `f` can be a Lua +-- function or a number that specifies the function at that stack level: Level 1 +-- is the function calling `setfenv`. `setfenv` returns the given function. As a +-- special case, when `f` is 0 `setfenv` changes the environment of the running +-- thread. In this case, `setfenv` returns no values. +-- +-- Deprecated in Lua 5.2. +function setfenv(f, table) end + +--- -- If `index` is a number, returns all arguments after argument number -- `index`; a negative number indexes from the end (-1 is the last argument). -- Otherwise, `index` must be the string `"#"`, and `select` returns the total @@ -218,10 +260,14 @@ function setmetatable(table, metatable) end --- -- When called with no `base`, `tonumber` tries to convert its argument to a -- number. If the argument is already a number or a string convertible to a --- number (see §3.4.2), then `tonumber` returns this number; otherwise, it +-- number, then `tonumber` returns this number; otherwise, it -- returns nil. -- --- When called with `base`, then `e` should be a string to be interpreted as an +-- The conversion of strings can result in integers or floats, according to the +-- lexical conventions of Lua (see §3.1). (The string may have leading and +-- trailing spaces and a sign.) +-- +-- When called with `base`, then `e` must be a string to be interpreted as an -- integer numeral in that base. The base may be any integer between 2 and 36, -- inclusive. In bases above 10, the letter '`A`' (in either upper or lower -- case) represents 10, '`B`' represents 11, and so forth, with '`Z`' @@ -230,9 +276,10 @@ function setmetatable(table, metatable) end function tonumber(e [, base]) end --- --- Receives a value of any type and converts it to a string in a reasonable --- format. (For complete control of how numbers are converted, use --- `string.format`.) +-- Receives a value of any type and converts it to a string in a human-readable +-- format. Floats always produce strings with some floating-point indication +-- (either a decimal dot or an exponent). (For complete control of how numbers +-- are converted, use `string.format`.) -- -- If the metatable of `v` has a `"__tostring"` field, then `tostring` calls the -- corresponding value with `v` as argument, and uses the result of the call as @@ -247,6 +294,16 @@ function tostring(v) end function type(v) end --- +-- Returns the elements from the given table. This function is equivalent to +-- return list[i], list[i+1], ···, list[j] except that the above code can +-- be written only for a fixed number of elements. By default, `i` is 1 and +-- `j` is the length of the list, as defined by the length operator +-- (see §2.5.5). +-- +-- Deprecated in Lua 5.2. +function unpack(list [, i [, j]]) end + +--- -- This function is similar to `pcall`, except that it sets a new message -- handler `msgh`. function xpcall(f, msgh [, arg1, ···]) end @@ -257,15 +314,24 @@ function xpcall(f, msgh [, arg1, ···]) end function coroutine.create(f) end --- +-- Returns true when the running coroutine can yield. +-- +-- A running coroutine is yieldable if it is not the main thread and it is not +-- inside a non-yieldable C function. +-- +-- New in Lua 5.3. +function coroutine.isyieldable() end + +--- -- Starts or continues the execution of coroutine `co`. The first time -- you resume a coroutine, it starts running its body. The values `val1`, --- ... are passed as the arguments to the body function. If the coroutine --- has yielded, `resume` restarts it; the values `val1`, ... are passed +-- ··· are passed as the arguments to the body function. If the coroutine +-- has yielded, `resume` restarts it; the values `val1`, ··· are passed -- as the results from the yield. -- -- If the coroutine runs without any errors, `resume` returns true plus any --- values passed to `yield` (if the coroutine yields) or any values returned --- by the body function (if the coroutine terminates). If there is any error, +-- values passed to `yield` (when the coroutine yields) or any values returned +-- by the body function (when the coroutine terminates). If there is any error, -- `resume` returns false plus the error message. function coroutine.resume(co [, val1, ···]) end @@ -309,7 +375,7 @@ function coroutine.yield(···) end -- `package.searchers`. -- -- First `require` queries `package.preload[modname]`. If it has a value, --- this value (which should be a function) is the loader. Otherwise `require` +-- this value (which must be a function) is the loader. Otherwise `require` -- searches for a Lua loader using the path stored in `package.path`. If -- that also fails, it searches for a C loader using the path stored in -- `package.cpath`. If that also fails, it tries an *all-in-one* loader (see @@ -321,8 +387,8 @@ function coroutine.yield(···) end -- returns any non-nil value, `require` assigns the returned value to -- `package.loaded[modname]`. If the loader does not return a non-nil value and -- has not assigned any value to `package.loaded[modname]`, then `require` --- assigns <b>true</b> to this entry. In any case, `require` returns the final --- value of `package.loaded[modname]`. +-- assigns true to this entry. In any case, `require` returns the final value of +-- `package.loaded[modname]`. -- -- If there is any error loading or running the module, or if it cannot find -- any loader for the module, then `require` raises an error. @@ -343,12 +409,14 @@ function require(modname) end -- template. Default is '`?`'. -- The fourth line is a string that, in a path in Windows, is replaced by -- the executable's directory. Default is '`!`'. --- The fifth line is a mark to ignore all text before it when building the +-- The fifth line is a mark to ignore all text after it when building the -- `luaopen_` function name. Default is '`-`'. +-- +-- New in Lua 5.2. -- @field cpath (string) -- The path used by `require` to search for a C loader. -- Lua initializes the C path `package.cpath` in the same way it initializes --- the Lua path `package.path`, using the environment variable `LUA_CPATH_5_2` +-- the Lua path `package.path`, using the environment variable `LUA_CPATH_5_3` -- or the environment variable `LUA_CPATH` or a default path defined in -- `luaconf.h`. -- @field loaded (table) @@ -357,10 +425,14 @@ function require(modname) end -- `require` simply returns the value stored there. -- This variable is only a reference to the real table; assignments to this -- variable do not change the table used by `require`. +-- @field loaders (table) +-- See `package.searchers`. +-- +-- Deprecated in Lua 5.2. -- @field path (string) -- The path used by `require` to search for a Lua loader. -- At start-up, Lua initializes this variable with the value of the --- environment variable `LUA_PATH_5_2` or the environment variable `LUA_PATH` +-- environment variable `LUA_PATH_5_3` or the environment variable `LUA_PATH` -- or with a default path defined in `luaconf.h`, if those environment -- variables are not defined. Any "`;;`" in the value of the environment -- variable is replaced by the default path. @@ -393,18 +465,20 @@ function require(modname) end -- library to be used as the loader. The name of this C function is the string -- "`luaopen_`" concatenated with a copy of the module name where each dot -- is replaced by an underscore. Moreover, if the module name has a hyphen, --- its prefix up to (and including) the first hyphen is removed. For instance, --- if the module name is `a.v1-b.c`, the function name will be `luaopen_b_c`. --- The fourth searcher tries an *all-in-one loader*. It searches the C --- path for a library for the root name of the given module. For instance, --- when requiring `a.b.c`, it will search for a C library for `a`. If found, --- it looks into it for an open function for the submodule; in our example, --- that would be `luaopen_a_b_c`. With this facility, a package can pack --- several C submodules into one single library, with each submodule keeping --- its original open function. +-- its suffix after (and including) the first hyphen is removed. For instance, +-- if the module name is `a.b.c-v2.1 `, the function name will be +-- `luaopen_a_b_c`. The fourth searcher tries an *all-in-one loader*. It +-- searches the C path for a library for the root name of the given module. +-- For instance, when requiring `a.b.c`, it will search for a C library for +-- `a`. If found, it looks into it for an open function for the submodule; in +-- our example, that would be `luaopen_a_b_c`. With this facility, a package +-- can pack several C submodules into one single library, with each submodule +-- keeping its original open function. -- All searchers except the first one (preload) return as the extra value the -- file name where the module was found, as returned by `package.searchpath`. -- The first searcher returns no extra value. +-- +-- New in Lua 5.2. local package --- @@ -443,11 +517,21 @@ function package.loadlib(libname, funcname) end -- Returns the resulting name of the first file that it can open in read mode -- (after closing the file), or nil plus an error message if none succeeds. -- (This error message lists all file names it tried to open.) +-- +-- New in Lua 5.2. function package.searchpath(name, path [, sep [, rep]]) end --- +-- Sets a metatable for `module` with its `__index` field referring to the +-- global environment, so that this module inherits values from the global +-- environment. To be used as an option to function `module`. +-- +-- Deprecated in Lua 5.2. +function package.seeall(module) end + +--- -- Returns the internal numerical codes of the characters `s[i]`, `s[i+1]`, --- ..., `s[j]`. The default value for `i` is 1; the default value for `j` +-- ···, `s[j]`. The default value for `i` is 1; the default value for `j` -- is `i`. These indices are corrected following the same rules of function -- `string.sub`. -- @@ -463,17 +547,24 @@ function string.byte(s [, i [, j]]) end function string.char(···) end --- --- Returns a string containing a binary representation of the given --- function, so that a later `load` on this string returns a copy of the --- function (but with new upvalues). -function string.dump(function) end +-- Returns a string containing a binary representation (a _binary chunk_) of the +-- given function, so that a later `load` on this string returns a copy of the +-- function (but with new upvalues). If `strip` is a true value, the binary +-- representation is created without debug information about the function (local +-- variable names, lines, etc.). +-- +-- Functions with upvalues have only their number of upvalues saved. When +-- (re)loaded, those upvalues receive fresh instances containing nil. (You can +-- use the debug library to serialize and reload the upvalues of a function in a +-- way adequate to your needs.) +function string.dump(function [, strip]) end --- --- Looks for the first match of `pattern` in the string `s`. If it finds a --- match, then `find` returns the indices of `s` where this occurrence starts --- and ends; otherwise, it returns nil. A third, optional numerical argument --- `init` specifies where to start the search; its default value is 1 and --- can be negative. A value of true as a fourth, optional argument `plain` +-- Looks for the first match of `pattern` (see §6.4.1) in the string `s`. If it +-- finds a match, then `find` returns the indices of `s` where this occurrence +-- starts and ends; otherwise, it returns nil. A third, optional numerical +-- argument `init` specifies where to start the search; its default value is 1 +-- and can be negative. A value of true as a fourth, optional argument `plain` -- turns off the pattern matching facilities, so the function does a plain -- "find substring" operation, with no characters in `pattern` being considered -- magic. Note that if `plain` is given, then `init` must be given as well. @@ -485,7 +576,7 @@ function string.find(s, pattern [, init [, plain]]) end --- -- Returns a formatted version of its variable number of arguments following the -- description given in its first argument (which must be a string). The format --- string follows the same rules as the ANSI C function `sprintf`. The only +-- string follows the same rules as the ISO C function `sprintf`. The only -- differences are that the options/modifiers `*`, `h`, `L`, `l`, `n`, and `p` -- are not supported and that there is an extra option, `q`. The `q` option -- formats a string between double quotes, using escape sequences when necessary @@ -500,18 +591,16 @@ function string.find(s, pattern [, init [, plain]]) end -- new line" -- -- Options `A` and `a` (when available), `E`, `e`, `f`, `G`, and `g` all expect --- a number as argument. Options `c`, `d`, `i`, `o`, `u`, `X`, and `x` also --- expect a number, but the range of that number may be limited by the --- underlying C implementation. For options `o`, `u`, `X`, and `x`, the number --- cannot be negative. Option `q` expects a string; option `s` expects a string --- without embedded zeros. If the argument to option `s` is not a string, it is +-- a number as argument. Options `c`, `d`, `i`, `o`, `u`, `X`, and `x` expect an +-- integer. Option `q` expects a string; option `s` expects a string without +-- embedded zeros. If the argument to option `s` is not a string, it is -- converted to one following the same rules of `tostring`. function string.format(formatstring, ···) end --- -- Returns an iterator function that, each time it is called, returns the --- next captures from `pattern` over the string `s`. If `pattern` specifies no --- captures, then the whole match is produced in each call. +-- next captures from `pattern` (see §6.4.1) over the string `s`. If `pattern` +-- specifies no captures, then the whole match is produced in each call. -- -- As an example, the following loop will iterate over all the words from string -- `s`, printing one per line: @@ -536,10 +625,10 @@ function string.gmatch(s, pattern) end --- -- Returns a copy of `s` in which all (or the first `n`, if given) --- occurrences of the `pattern` have been replaced by a replacement string --- specified by `repl`, which can be a string, a table, or a function. `gsub` --- also returns, as its second value, the total number of matches that occurred. --- The name `gsub` comes from "Global SUBstitution". +-- occurrences of the `pattern` (see §6.4.1) have been replaced by a replacement +-- string specified by `repl`, which can be a string, a table, or a function. +-- `gsub` also returns, as its second value, the total number of matches that +-- occurred. The name `gsub` comes from "Global SUBstitution". -- -- If `repl` is a string, then its value is used for replacement. The character -- `%` works as an escape character: any sequence in `repl` of the form `%d`, @@ -575,9 +664,9 @@ function string.gmatch(s, pattern) end -- return load(s)() -- end) -- --> x="4+5 = 9" --- local t = {name="lua", version="5.2"} +-- local t = {name="lua", version="5.3"} -- x = string.gsub("$name-$version.tar.gz", "%$(%w+)", t) --- --> x="lua-5.2.tar.gz" +-- --> x="lua-5.3.tar.gz" function string.gsub(s, pattern, repl [, n]) end --- @@ -592,17 +681,34 @@ function string.len(s) end function string.lower(s) end --- --- Looks for the first *match* of `pattern` in the string `s`. If it --- finds one, then `match` returns the captures from the pattern; otherwise +-- Looks for the first *match* of `pattern` (see §6.4.1) in the string `s`. If +-- it finds one, then `match` returns the captures from the pattern; otherwise -- it returns nil. If `pattern` specifies no captures, then the whole match -- is returned. A third, optional numerical argument `init` specifies where -- to start the search; its default value is 1 and can be negative. function string.match(s, pattern [, init]) end --- +-- Returns a binary string containing the values `v1`, `v2`, etc. packed (that +-- is, serialized in binary form) according to the format string `fmt` (see +-- §6.4.2). +-- +-- New in Lua 5.3. +function string.pack(fmt, v1, v2, ···) end + +--- +-- Returns the size of a string resulting from `string.pack` with the given +-- format. The format string cannot have the variable-length options 's' or 'z' +-- (see §6.4.2). +-- +-- New in Lua 5.3. +function string.packsize(fmt) end + +--- -- Returns a string that is the concatenation of `n` copies of the string `s` -- separated by the string `sep`. The default value for `sep` is the empty --- string (that is, no separator). +-- string (that is, no separator). Returns the empty string if `n` is not +-- positive. function string.rep(s, n [, sep]) end --- @@ -623,12 +729,85 @@ function string.reverse(s) end function string.sub(s, i [, j]) end --- +-- Returns the values packed in string `s` (see `string.pack`) according to the +-- format string `fmt` (see §6.4.2). An optional `pos` marks where to start +-- reading in `s` (default is 1). After the read values, this function also +-- returns the index of the first unread byte in `s`. +-- +-- New in Lua 5.3. +function string.unpack(fmt, s [, pos]) end + +--- -- Receives a string and returns a copy of this string with all lowercase -- letters changed to uppercase. All other characters are left unchanged. The -- definition of what a lowercase letter is depends on the current locale. function string.upper(s) end --- +-- Dummy table. +-- @class table +-- @name utf8 +-- @field charpattern (string) +-- The pattern (a string, not a function) "[\0-\x7F\xC2-\xF4][\x80-\xBF]*" +-- (see §6.4.1), which matches exactly one UTF-8 byte sequence, assuming that +-- the subject is a valid UTF-8 string. +-- +-- New in Lua 5.3. + +--- +-- Receives zero or more integers, converts each one to its corresponding UTF-8 +-- byte sequence and returns a string with the concatenation of all these +-- sequences. +-- +-- New in Lua 5.3. +function utf8.char(···) end + +--- +-- Returns values so that the construction +-- +-- for p, c in utf8.codes(s) do *body* end +-- +-- will iterate over all characters in string `s`, with `p` being the position +-- (in bytes) and `c` the code point of each character. It raises an error if it +-- meets any invalid byte sequence. +-- +-- New in Lua 5.3. +function utf8.codes(s) end + +--- +-- Returns the codepoints (as integers) from all characters in `s` that start +-- between byte position `i` and `j` (both included). The default for `i` is 1 +-- and for `j` is `i`. It raises an error if it meets any invalid byte sequence. +-- +-- New in Lua 5.3. +function utf8.codepoint(s [, i [, j]]) end + +--- +-- Returns the number of UTF-8 characters in string `s` that start between +-- positions `i` and `j` (both inclusive). The default for `i` is 1 and for `j` +-- is -1. If it finds any invalid byte sequence, returns a false value plus the +-- position of the first invalid byte. +-- +-- New in Lua 5.3. +function utf8.len(s [, i [, j]]) end + +--- +-- Returns the position (in bytes) where the encoding of the `n`-th character of +-- `s` (counting from position `i`) starts. A negative `n` gets characters +-- before position `i`. The default for `i` is 1 when `n` is non-negative and +-- `#s + 1` otherwise, so that `utf8.offset(s, -n)` gets the offset of the +-- `n`-th character from the end of the string. If the specified character is +-- neither in the subject nor right after its end, the function returns nil. +-- +-- As a special case, when `n` is 0 the function returns the start of the +-- encoding of the character that contains the `i`-th byte of `s`. +-- +-- This function assumes that `s` is a valid UTF-8 string. +-- +-- New in Lua 5.3. +function utf8.offset(s, n [, i]) end + +--- -- Given a list where all elements are strings or numbers, returns the string -- `list[i]..sep..list[i+1] ··· sep..list[j]`. The default value for `sep` is -- the empty string, the default for `i` is 1, and the default for `j` is @@ -643,9 +822,28 @@ function table.concat(list [, sep [, i [, j]]]) end function table.insert(list, [pos,] value) end --- +-- Returns the largest positive numerical index of the given table, or zero if +-- the table has no positive numerical indices. (To do its job this function +-- does a linear traversal of the whole table.) +-- +-- Deprecated in Lua 5.2. +function table.maxn(table) end + +--- +-- Moves elements from table `a1` to table `a2`. This function performs the +-- equivalent to the following multiple assignment: `a2[t], ··· = a1[f], ···, +-- a1[e]`. The default for `a2` is `a1`. The destination range can overlap with +-- the source range. Index `f` must be positive. +-- +-- New in Lua 5.3. +function table.move(a1, f, e, t [,a2]) end + +--- -- Returns a new table with all parameters stored into keys 1, 2, etc. and with -- a field "`n`" with the total number of parameters. Note that the resulting -- table may not be a sequence. +-- +-- New in Lua 5.2. function table.pack(···) end --- @@ -655,8 +853,8 @@ function table.pack(···) end -- element `list[#list]`; The index `pos` can also be 0 when `#list` is 0, or -- `#list + 1`; in those cases, the function erases the element `list[pos]`. -- --- The default value for `pos` is `#list`, so that a call `table.remove(t)` --- removes the last element of list `t`. +-- The default value for `pos` is `#list`, so that a call `table.remove(l)` +-- removes the last element of list `l`. function table.remove(list [, pos]) end --- @@ -672,11 +870,13 @@ function table.remove(list [, pos]) end function table.sort(list [, comp]) end --- --- Returns the elements from the given table. This function is equivalent to +-- Returns the elements from the given list. This function is equivalent to -- -- return list[i], list[i+1], ···, list[j] -- -- By default, `i` is 1 and `j` is `#list`. +-- +-- New in Lua 5.2. function table.unpack(list [, i [, j]]) end --- @@ -684,14 +884,21 @@ function table.unpack(list [, i [, j]]) end -- @class table -- @name math -- @field huge (number) --- The value `HUGE_VAL`, a value larger than or equal to any other numerical --- value. +-- The float value `HUGE_VAL`, a value larger than any other numerical value. +-- @field maxinteger (number) +-- An integer with the maximum value for an integer. +-- +-- New in Lua 5.3. +-- @field mininteger (number) +-- An integer with the minimum value for an integer. +-- +-- New in Lua 5.3. -- @field pi (number) -- The value of 'π'. local math --- --- Returns the absolute value of `x`. +-- Returns the absolute value of `x`. (integer/float) function math.abs(x) end --- @@ -703,17 +910,24 @@ function math.acos(x) end function math.asin(x) end --- --- Returns the arc tangent of `x` (in radians). -function math.atan(x) end +-- Returns the arc tangent of `y/x` (in radians), but uses the signs +-- of both parameters to find the quadrant of the result. (It also handles +-- correctly the case of `x` being zero.) +-- +-- The default value for `x` is 1, so that the call `math.atan(y)` returns the +-- arc tangent of `y`. +function math.atan(y [, x]) end --- -- Returns the arc tangent of `y/x` (in radians), but uses the signs -- of both parameters to find the quadrant of the result. (It also handles -- correctly the case of `x` being zero.) +-- +-- Deprecated in Lua 5.3. function math.atan2(y, x) end --- --- Returns the smallest integer larger than or equal to `x`. +-- Returns the smallest integral value larger than or equal to `x`. function math.ceil(x) end --- @@ -722,10 +936,12 @@ function math.cos(x) end --- -- Returns the hyperbolic cosine of `x`. +-- +-- Deprecated in Lua 5.3. function math.cosh(x) end --- --- Returns the angle `x` (given in radians) in degrees. +-- Converts the angle `x` from radians to degrees. function math.deg(x) end --- @@ -733,21 +949,25 @@ function math.deg(x) end function math.exp(x) end --- --- Returns the largest integer smaller than or equal to `x`. +-- Returns the largest integral value smaller than or equal to `x`. function math.floor(x) end --- -- Returns the remainder of the division of `x` by `y` that rounds the --- quotient towards zero. +-- quotient towards zero. (integer/float) function math.fmod(x, y) end --- -- Returns `m` and `e` such that 'x = m2^e', `e` is an integer and the -- absolute value of `m` is in the range *[0.5, 1)* (or zero when `x` is zero). +-- +-- Deprecated in Lua 5.3. function math.frexp(x) end --- -- Returns 'm2^e' (`e` should be an integer). +-- +-- Deprecated in Lua 5.3. function math.ldexp(m, e) end --- @@ -756,37 +976,47 @@ function math.ldexp(m, e) end function math.log(x [, base]) end --- --- Returns the maximum value among its arguments. +-- Returns the base-10 logarithm of `x`. +-- +-- Deprecated in Lua 5.2. +function math.log10(x) end + +--- +-- Returns the argument with the maximum value, according to the Lua operator +-- `<`. (integer/float) function math.max(x, ···) end --- --- Returns the minimum value among its arguments. +-- Returns the argument with the minimum value, according to the Lua operator +-- `<`. (integer/float) function math.min(x, ···) end --- --- Returns two numbers, the integral part of `x` and the fractional part of --- `x`. +-- Returns the integral part of `x` and the fractional part of `x`. Its second +-- result is always a float. function math.modf(x) end --- -- Returns *x^y*. (You can also use the expression `x^y` to compute this -- value.) +-- +-- Deprecated in Lua 5.3. function math.pow(x, y) end --- --- Returns the angle `x` (given in degrees) in radians. +-- Converts the angle `x` from degrees to radians. function math.rad(x) end --- --- This function is an interface to the simple pseudo-random generator --- function `rand` provided by Standard C. (No guarantees can be given for its --- statistical properties.) +-- When called without arguments, returns a pseudo-random float with uniform +-- distribution in the range [0,1). When called with two integers `m` and `n`, +-- `math.random` returns a pseudo-random integer with uniform distribution in +-- the range `[m, n]. (The value `m-n` cannot be negative and must fit in a Lua +-- integer.) The call `math.random(n)` is equivalent to `math.random(1, n)`. -- --- When called without arguments, returns a uniform pseudo-random real --- number in the range [0,1). When called with an integer number `m`, --- `math.random` returns a uniform pseudo-random integer in the range [1, m]. --- When called with two integer numbers `m` and `n`, `math.random` returns a --- uniform pseudo-random integer in the range [m, n]. +-- This function is an interface to the underling pseudo-random generator +-- function provided by C. No guarantees can be given for its statistical +-- properties. function math.random([m [, n]]) end --- @@ -800,6 +1030,8 @@ function math.sin(x) end --- -- Returns the hyperbolic sine of `x`. +-- +-- Deprecated in Lua 5.3. function math.sinh(x) end --- @@ -813,9 +1045,32 @@ function math.tan(x) end --- -- Returns the hyperbolic tangent of `x`. +-- +-- Deprecated in Lua 5.3. function math.tanh(x) end --- +-- If the value `x` is convertible to an integer, returns that integer. +-- Otherwise, returns nil. +-- +-- New in Lua 5.3. +function math.tointeger(x) end + +--- +-- Returns "integer" if `x` is an integer, "float" if it is a float, or nil if +-- x is not a number. +-- +-- New in Lua 5.3. +function math.type(x) end + +--- +-- Returns a boolean, true if integer `m` is below integer `n` when they are +-- compared as unsigned integers. +-- +-- New in Lua 5.3. +function math.ult(m, n) end + +--- -- Returns the number `x` shifted `disp` bits to the right. The number `disp` -- may be any representable integer. Negative displacements shift to the left. -- @@ -824,10 +1079,16 @@ function math.tanh(x) end -- right are filled with zeros. In particular, displacements with absolute -- values higher than 31 result in zero or `0xFFFFFFFF` (all original bits are -- shifted out). +-- +-- New in Lua 5.2. +-- Deprecated in Lua 5.3. function bit32.arshift(x, disp) end --- -- Returns the bitwise "and" of its operands. +-- +-- New in Lua 5.2. +-- Deprecated in Lua 5.3. function bit32.band(...) end --- @@ -835,19 +1096,31 @@ function bit32.band(...) end -- identity holds: -- -- assert(bit32.bnot(x) == (-1 - x) % 2^32) +-- +-- New in Lua 5.2. +-- Deprecated in Lua 5.3. function bit32.bnot(x) end --- -- Returns the bitwise "or" of its operands. +-- +-- New in Lua 5.2. +-- Deprecated in Lua 5.3. function bit32.bor(...) end --- -- Returns a boolean signaling whether the bitwise "and" of its operands is -- different from zero. +-- +-- New in Lua 5.2. +-- Deprecated in Lua 5.3. function bit32.btest(...) end --- -- Returns the bitwise "exclusive or" of its operands. +-- +-- New in Lua 5.2. +-- Deprecated in Lua 5.3. function bit32.xor(...) end --- @@ -856,11 +1129,17 @@ function bit32.xor(...) end -- significant). All accessed bits must be in the range [0, 31]. -- -- The default for `width` is 1. +-- +-- New in Lua 5.2. +-- Deprecated in Lua 5.3. function bit32.extract(n, field [, width]) end --- -- Returns a copy of `n` with the bits `field` to `field + width - 1` replaced -- by the value `v`. See `bit32.extract` for details about `field` and `width`. +-- +-- New in Lua 5.2. +-- Deprecated in Lua 5.3. function bit32.replace(n, v, field [, width]) end --- @@ -872,6 +1151,9 @@ function bit32.replace(n, v, field [, width]) end -- assert(bit32.lrotate(x, disp) == bit32.lrotate(x, disp % 32)) -- -- In particular, negative displacements rotate to the right. +-- +-- New in Lua 5.2. +-- Deprecated in Lua 5.3. function bit32.lrotate(x, disp) end --- @@ -884,6 +1166,9 @@ function bit32.lrotate(x, disp) end -- For positive displacements, the following equality holds: -- -- assert(bit32.lshift(b, disp) == (b * 2^disp) % 2^32) +-- +-- New in Lua 5.2. +-- Deprecated in Lua 5.3. function bit32.lshift(x, disp) end --- @@ -895,6 +1180,9 @@ function bit32.lshift(x, disp) end -- assert(bit32.rrotate(x, disp) == bit32.rrotate(x, disp % 32)) -- -- In particular, negative displacements rotate to the left. +-- +-- New in Lua 5.2. +-- Deprecated in Lua 5.3. function bit32.rrotate(x, disp) end --- @@ -909,6 +1197,9 @@ function bit32.rrotate(x, disp) end -- assert(bit32.rshift(b, disp) == math.floor(b % 2^32 / 2^disp)) -- -- This shift operation is what is called logical shift. +-- +-- New in Lua 5.2. +-- Deprecated in Lua 5.3. function bit32.rshift(x, disp) end --- @@ -945,11 +1236,11 @@ function io.input([file]) end --- -- Opens the given file name in read mode and returns an iterator function that -- works like `file:lines(···)` over the opened file. When the iterator function --- detects -- the end of file, it returns nil (to finish the loop) and +-- detects -- the end of file, it returns no values (to finish the loop) and -- automatically closes the file. -- -- The call `io.lines()` (with no file name) is equivalent to --- `io.input():lines()`; that is, it iterates over the lines of the default +-- `io.input():lines("l")`; that is, it iterates over the lines of the default -- input file. In this case it does not close the file when the loop ends. -- -- In case of errors this function raises the error, instead of returning an @@ -1019,10 +1310,10 @@ function file:flush() end --- -- Returns an iterator function that, each time it is called, reads the file --- according to the given formats. When no format is given, uses "*l" as a +-- according to the given formats. When no format is given, uses "l" as a -- default. As an example, the construction -- --- for c in file:lines(1) do <em>body</em> end +-- for c in file:lines(1) do *body* end -- -- will iterate over all characters of the file, starting at the current -- position. Unlike `io.lines`, this function does not close the file when the @@ -1034,23 +1325,30 @@ function file:lines(···) end --- -- Reads the file `file`, according to the given formats, which specify --- what to read. For each format, the function returns a string (or a number) +-- what to read. For each format, the function returns a string or a number -- with the characters read, or nil if it cannot read data with the specified --- format. When called without formats, it uses a default format that reads --- the next line (see below). +-- format. (In this latter case, the function does not read subsequent formats.) +-- When called without formats, it uses a default format that reads the next +-- line (see below). -- -- The available formats are --- "*n": reads a number; this is the only format that returns a number --- instead of a string. --- "*a": reads the whole file, starting at the current position. On end of --- file, it returns the empty string. --- "*l": reads the next line skipping the end of line, returning nil on --- end of file. This is the default format. --- "*L": reads the next line keeping the end of line (if present), returning --- nil on end of file. +-- "n": reads a numeral and returns it as a float or an integer, following the +-- lexical conventions of Lua. (The numeral may have leading spaces and a +-- sign.) This format always reads the longest input sequence that is a +-- valid prefix for a number; if that prefix does not form a valid number +-- (e.g., an empty string, "0x", or "3.4e-"), it is discarded and the +-- function returns nil. +-- "a": reads the whole file, starting at the current position. On end of +-- file, it returns the empty string. +-- "l": reads the next line skipping the end of line, returning nil on +-- end of file. This is the default format. +-- "L": reads the next line keeping the end-of-line character (if present), +-- returning nil on end of file. -- *number*: reads a string with up to this number of bytes, returning nil on --- end of file. If number is zero, it reads nothing and returns an empty --- string, or nil on end of file. +-- end of file. If *number* is zero, it reads nothing and returns an +-- empty string, or nil on end of file. +-- +-- The formats "l" and "L" should be used only for text files. function file:read(···) end --- @@ -1117,26 +1415,27 @@ function os.clock() end -- information is not available. -- -- If `format` is not "`*t`", then `date` returns the date as a string, --- formatted according to the same rules as the ANSI C function `strftime`. +-- formatted according to the same rules as the ISO C function `strftime`. -- -- When called without arguments, `date` returns a reasonable date and time -- representation that depends on the host system and on the current locale -- (that is, `os.date()` is equivalent to `os.date("%c")`). -- --- On non-Posix systems, this function may be not thread safe because of its +-- On non-POSIX systems, this function may be not thread safe because of its -- reliance on C function `gmtime` and C function `localtime`. function os.date([format [, time]]) end --- --- Returns the number of seconds from time `t1` to time `t2`. In POSIX, --- Windows, and some other systems, this value is exactly `t2`*-*`t1`. +-- Returns the difference, in seconds, from time `t1` to time `t2` (where the +-- times are values returned by `os.time`). In POSIX, Windows, and some other +-- systems, this value is exactly `t2`*-*`t1`. function os.difftime(t2, t1) end --- --- This function is equivalent to the ANSI C function `system`. It passes +-- This function is equivalent to the ISO C function `system`. It passes -- `command` to be executed by an operating system shell. Its first result is -- `true` if the command terminated successfully, or `nil` otherwise. After this --- first result the function returns a string and a number, as follows: +-- first result the function returns a string plus a number, as follows: -- "exit": the command terminated normally; the following number is the exit -- status of the command. -- "signal": the command was terminated by a signal; the following number is @@ -1147,7 +1446,7 @@ function os.difftime(t2, t1) end function os.execute([command]) end --- --- Calls the ANSI C function `exit` to terminate the host program. If `code` is +-- Calls the ISO C function `exit` to terminate the host program. If `code` is -- `true`, the returned status is `EXIT_SUCCESS`; if `code` is `false`, the -- returned status is `EXIT_FAILURE`; if `code` is a number, the returned status -- is this number. The default value for `code` is `true`. @@ -1231,6 +1530,12 @@ function os.tmpname() end function debug.debug() end --- +-- Returns the environment of object `o`. +-- +-- Deprecated in Lua 5.2. +function debug.getfenv(o) end + +--- -- Returns the current hook settings of the thread, as three values: the -- current hook function, the current hook mask, and the current hook count -- (as set by the `debug.sethook` function). @@ -1262,15 +1567,17 @@ function debug.getinfo([thread,] f [, what]) end -- `local` of the function at level `f` of the stack. This function accesses not -- only explicit local variables, but also parameters, temporaries, etc. -- --- The first parameter or local variable has index 1, and so on, until the last --- active variable. Negative indices refer to vararg parameters; -1 is the first --- vararg parameter. The function returns nil if there is no variable with the --- given index, and raises an error when called with a level out of range. (You --- can call `debug.getinfo` to check whether the level is valid.) +-- The first parameter or local variable has index 1, and so on, following the +-- order that they are declared in the code, counting only the variables that +-- are active in the current scope of the function. Negative indices refer to +-- vararg parameters; -1 is the first vararg parameter. The function returns nil +-- if there is no variable with the given index, and raises an error when called +-- with a level out of range. (You can call `debug.getinfo` to check whether the +-- level is valid.) -- --- Variable names starting with '`(`' (open parenthesis) represent internal --- variables (loop control variables, temporaries, varargs, and C function --- locals). +-- Variable names starting with '(' (open parenthesis) represent variables with +-- no known names (internal variables such as loop control variables, and +-- variables from chunks saved without debug information). -- -- The parameter `f` may also be a function. In that case, `getlocal` returns -- only the name of function parameters. @@ -1289,23 +1596,35 @@ function debug.getregistry() end -- This function returns the name and the value of the upvalue with index -- `up` of the function `f`. The function returns nil if there is no upvalue -- with the given index. +-- +-- Variable names starting with '(' (open parenthesis) represent variables with +-- no known names (variables from chunks saved without debug information). function debug.getupvalue(f, up) end --- -- Returns the Lua value associated to `u`. If `u` is not a userdata, returns -- nil. +-- +-- New in Lua 5.2. function debug.getuservalue(u) end --- +-- Sets the environment of the given `object` to the given `table`. Returns +-- `object`. +-- +-- Deprecated in Lua 5.2. +function debug.setfenv(object, table) end + +--- -- Sets the given function as a hook. The string `mask` and the number --- `count` describe when the hook will be called. The string mask may have --- the following characters, with the given meaning: +-- `count` describe when the hook will be called. The string mask may have any +-- combination of the following characters, with the given meaning: -- "c": the hook is called every time Lua calls a function; -- "r": the hook is called every time Lua returns from a function; -- "l": the hook is called every time Lua enters a new line of code. -- --- With a `count` different from zero, the hook is called after every `count` --- instructions. +-- Moreover, with a `count` different from zero, the hook is called also after +-- every `count` instructions. -- -- When called without arguments, `debug.sethook` turns off the hook. -- @@ -1341,33 +1660,39 @@ function debug.setupvalue(f, up, value) end --- -- Sets the given `value` as the Lua value associated to the given `udata`. --- `value` must be a table or nil; `udata` must be a full userdata. +-- `udata` must be a full userdata. -- -- Returns `udata`. +-- +-- New in Lua 5.2. function debug.setuservalue(udata, value) end --- -- If `message` is present but is neither a string nor nil, this function -- returns `message` without further processing. Otherwise, it returns a string --- with a traceback of the call stack. An optional `message` string is appended +-- with a traceback of the call stack. The optional `message` string is appended -- at the beginning of the traceback. An optional `level` number tells at which -- level to start the traceback (default is 1, the function calling -- `traceback`). function debug.traceback([thread,] [message] [,level]) end --- --- Returns an unique identifier (as a light userdata) for the upvalue numbered +-- Returns a unique identifier (as a light userdata) for the upvalue numbered -- `n` from the given function. -- -- These unique identifiers allow a program to check whether different closures -- share upvalues. Lua closures that share an upvalue (that is, that access a -- same external local variable) will return identical ids for those upvalue -- indices. +-- +-- New in Lua 5.2. function debug.upvalueid(f, n) end --- -- Make the `n1`-th upvalue of the Lua closure `f1` refer to the `n2`-th upvalue -- of the Lua closure `f2`. +-- +-- New in Lua 5.2. function debug.upvaluejoin(f1, n1, f2, n2) end -- External libraries. diff --git a/modules/lua/tags b/modules/lua/tags index 39f1bde3..dab4924a 100644 --- a/modules/lua/tags +++ b/modules/lua/tags @@ -462,6 +462,7 @@ caret_style _ 0;" F class:buffer caret_width _ 0;" F class:buffer ceil _ 0;" f class:math char _ 0;" f class:string +char _ 0;" f class:utf8 char_at _ 0;" F class:buffer char_left _ 0;" f class:buffer char_left_extend _ 0;" f class:buffer @@ -470,6 +471,7 @@ char_matches _ 0;" t class:textadept.editing char_right _ 0;" f class:buffer char_right_extend _ 0;" f class:buffer char_right_rect_extend _ 0;" f class:buffer +charpattern _ 0;" F class:utf8 chdir _ 0;" f class:lfs choose_caret_x _ 0;" f class:buffer clear _ 0;" f class:buffer @@ -487,6 +489,8 @@ close _ 0;" f class:spawn_proc close_all_buffers _ 0;" f class:io close_buffer _ 0;" f class:io cntrl _ 0;" F class:lexer +codepoint _ 0;" f class:utf8 +codes _ 0;" f class:utf8 collectgarbage _ 0;" f colourise _ 0;" f class:buffer column _ 0;" F class:buffer @@ -638,6 +642,8 @@ get_sel_text _ 0;" f class:buffer get_split_table _ 0;" f class:ui get_text _ 0;" f class:buffer getenv _ 0;" f class:os +getfenv _ 0;" f +getfenv _ 0;" f class:debug gethook _ 0;" f class:debug getinfo _ 0;" f class:debug getlocal _ 0;" f class:debug @@ -703,6 +709,7 @@ insert_text _ 0;" f class:buffer integer _ 0;" F class:lexer io _ 0;" m ipairs _ 0;" f +isyieldable _ 0;" f class:coroutine join_lines _ 0;" f class:textadept.editing keychain _ 0;" t class:keys keys _ 0;" m @@ -712,6 +719,7 @@ kill _ 0;" f class:spawn_proc last_char_includes _ 0;" f class:lexer ldexp _ 0;" f class:math len _ 0;" f class:string +len _ 0;" f class:utf8 length _ 0;" F class:buffer lex _ 0;" f class:lexer lexer _ 0;" m @@ -755,12 +763,15 @@ load _ 0;" f load _ 0;" f class:lexer load _ 0;" f class:textadept.session loaded _ 0;" F class:package +loaders _ 0;" F class:package loadfile _ 0;" f loadlib _ 0;" f class:package +loadstring _ 0;" f locale _ 0;" f class:lpeg lock _ 0;" f class:lfs lock_dir _ 0;" f class:lfs log _ 0;" f class:math +log10 _ 0;" f class:math lower _ 0;" F class:lexer lower _ 0;" f class:string lower_case _ 0;" f class:buffer @@ -810,16 +821,21 @@ match_case_label_text _ 0;" F class:ui.find math _ 0;" m max _ 0;" f class:math maximized _ 0;" F class:ui +maxinteger _ 0;" F class:math +maxn _ 0;" f class:table menu _ 0;" f class:ui menu _ 0;" m class:textadept menubar _ 0;" t class:textadept.menu menubar _ 0;" t class:ui min _ 0;" f class:math +mininteger _ 0;" F class:math mkdir _ 0;" f class:lfs modf _ 0;" f class:math modify _ 0;" F class:buffer +module _ 0;" f mouse_dwell_time _ 0;" F class:buffer mouse_selection_rectangular_switch _ 0;" F class:buffer +move _ 0;" f class:table move_caret_inside_view _ 0;" f class:buffer move_selected_lines_down _ 0;" f class:buffer move_selected_lines_up _ 0;" f class:buffer @@ -838,6 +854,7 @@ next_user_list_type _ 0;" f class:_SCINTILLA nonnewline _ 0;" F class:lexer nonnewline_esc _ 0;" F class:lexer oct_num _ 0;" F class:lexer +offset _ 0;" f class:utf8 ok_msgbox _ 0;" f class:ui.dialogs open _ 0;" f class:io open_file _ 0;" f class:io @@ -847,8 +864,10 @@ optionselect _ 0;" f class:ui.dialogs os _ 0;" m output _ 0;" f class:io overtype _ 0;" F class:buffer +pack _ 0;" f class:string pack _ 0;" f class:table package _ 0;" m +packsize _ 0;" f class:string page_down _ 0;" f class:buffer page_down_extend _ 0;" f class:buffer page_down_rect_extend _ 0;" f class:buffer @@ -966,6 +985,7 @@ searchers _ 0;" F class:package searchpath _ 0;" f class:package secure_inputbox _ 0;" f class:ui.dialogs secure_standard_inputbox _ 0;" f class:ui.dialogs +seeall _ 0;" f class:package seek _ 0;" f class:file sel_alpha _ 0;" F class:buffer sel_eol_filled _ 0;" F class:buffer @@ -1011,6 +1031,8 @@ set_whitespace_back _ 0;" f class:buffer set_whitespace_fore _ 0;" f class:buffer set_x_caret_policy _ 0;" f class:buffer set_y_caret_policy _ 0;" f class:buffer +setfenv _ 0;" f +setfenv _ 0;" f class:debug sethook _ 0;" f class:debug setlocal _ 0;" f class:debug setlocale _ 0;" f class:os @@ -1115,6 +1137,7 @@ toggle _ 0;" f class:textadept.bookmarks toggle_block _ 0;" f class:_M.ruby toggle_caret_sticky _ 0;" f class:buffer toggle_fold _ 0;" f class:buffer +tointeger _ 0;" f class:math token _ 0;" f class:lexer tonumber _ 0;" f tostring _ 0;" f @@ -1126,13 +1149,17 @@ try_to_autocomplete_end _ 0;" f class:_M.ruby type _ 0;" f type _ 0;" f class:io type _ 0;" f class:lpeg +type _ 0;" f class:math typeover_chars _ 0;" t class:textadept.editing ui _ 0;" m ui.command_entry _ 0;" m ui.dialogs _ 0;" m ui.find _ 0;" m +ult _ 0;" f class:math undo _ 0;" f class:buffer unlock _ 0;" f class:lfs +unpack _ 0;" f +unpack _ 0;" f class:string unpack _ 0;" f class:table unsplit _ 0;" f class:view upper _ 0;" F class:lexer @@ -1142,6 +1169,7 @@ upvalueid _ 0;" f class:debug upvaluejoin _ 0;" f class:debug use_tabs _ 0;" F class:buffer user_list_show _ 0;" f class:buffer +utf8 _ 0;" m v_scroll_bar _ 0;" F class:buffer vc_home _ 0;" f class:buffer vc_home_display _ 0;" f class:buffer |