Revision: 1477 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1477&view=re... Author: dmaphy Date: 2010-07-17 20:48:39 +0000 (Sat, 17 Jul 2010)
Log Message: ----------- add the geanylua documentation directory. Note: this has to be kept in sync with the geanylua documentation
Added Paths: ----------- www/staging/geanylua/ www/staging/geanylua/Makefile.am www/staging/geanylua/geanylua-index.html www/staging/geanylua/geanylua-input.html www/staging/geanylua/geanylua-intro.html www/staging/geanylua/geanylua-keyfile.html www/staging/geanylua/geanylua-keys.html www/staging/geanylua/geanylua-ref.html www/staging/geanylua/luarefv51.html
Added: www/staging/geanylua/Makefile.am =================================================================== --- www/staging/geanylua/Makefile.am (rev 0) +++ www/staging/geanylua/Makefile.am 2010-07-17 20:48:39 UTC (rev 1477) @@ -0,0 +1,23 @@ +# don't include if geanylua's disabled, otherwise a whole bunch of empty +# directories will be created +if ENABLE_GEANYLUA +include $(top_srcdir)/build/vars.docs.mk +endif + +plugin = geanylua + +DOCFILES = \ + geanylua-index.html \ + geanylua-input.html \ + geanylua-intro.html \ + geanylua-keyfile.html \ + geanylua-keys.html \ + geanylua-ref.html \ + luarefv51.html + +if ENABLE_GEANYLUA +htmldoc_DATA = $(DOCFILES) +endif + +# make sure that these files are distributed as well +EXTRA_DIST = $(DOCFILES)
Added: www/staging/geanylua/geanylua-index.html =================================================================== --- www/staging/geanylua/geanylua-index.html (rev 0) +++ www/staging/geanylua/geanylua-index.html 2010-07-17 20:48:39 UTC (rev 1477) @@ -0,0 +1,19 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> +<html> +<head> +<title>Lua plugin for Geany - Index</title> +</head> +<body> +<center> +<h3> +<br><br> +<a href="./geanylua-intro.html">Introduction to GeanyLua.</a><br><br> +<a href="./geanylua-ref.html">Reference to functions and variables.</a><br><br> +<a href="./geanylua-keyfile.html">Accessing keyfile configuration data.</a><br><br> +<a href="./geanylua-input.html">Creating custom dialog boxes.</a><br><br> +<a href="./geanylua-keys.html">Assigning keybindings to scripts.</a><br><br> +<a href="./luarefv51.html">Lua language quick reference.</a><br><br> +</h3> +</center> +</body> +</html>
Added: www/staging/geanylua/geanylua-input.html =================================================================== --- www/staging/geanylua/geanylua-input.html (rev 0) +++ www/staging/geanylua/geanylua-input.html 2010-07-17 20:48:39 UTC (rev 1477) @@ -0,0 +1,179 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> +<html> +<head> +<title>The Dialog Module for Lua</title> +</head> +<body style="margin: 32px 25% 24px 5%"> +<hr><h2>The Dialog module</h2><hr> +<p> +The <tt>dialog</tt> module provides a relatively simple way to create some fairly +complex dialog boxes for user interaction. The general idea is very loosely based on HTML forms. +<p> + + +<p>The functions are described below. The <tt>dlg</tt> argument expects a +dialog object, most other arguments are strings, unless otherwise noted.</p> + +Note that you can also use these functions in object-oriented style:<br> + For instance <tt>dialog.label(dlg, "hello")</tt> <br> + can also be written as <tt>dlg:label("hello")</tt><br></p> + + +<br> + +<hr><tt><b><big>function dialog.new ( title, buttons )</big></b></tt><br><p> +Creates a new dialog object. The <tt>title</tt> string assigns the window's title bar +text for the dialog. The <tt>buttons</tt> argument is a table of +strings, where each string will create a button with that text and add it to the +bottom row of the dialog. If a button's text contains an underscore, the letter after +it will be seen as an underlined accelerator for the button.</p> + +<br> +<hr><tt><b><big>function dialog.run ( dlg )</big></b></tt><br> +<p>Displays the dialog to the user and waits for submission.</p><p> +This function returns two values: the one-based <tt>index</tt> of the the clicked button, +and a <tt>results</tt> table containing key-value pairs collected from the dialog's elements.</p><p> +If the user cancels the dialog e.g. by pressing the <tt>[Esc]</tt> key, the <tt>index</tt> will be zero, and the <tt>results</tt> table will be <tt>nil</tt>. +</p> + +<br> +<hr><tt><b><big>function dialog.label ( dlg, text )</big></b></tt><br> +<p>Adds some informative text to the dialog.</p> + + +<br> +<hr><tt><b><big>function dialog.hr ( dlg )</big></b></tt><br> +<p>Draws a horizontal separator across the dialog.</p> + +<br> +<hr><tt><b><big>function dialog.heading ( dlg, text )</big></b></tt><br> +<p>Adds a horizontal separator with some informative text below it.</p> +<p>This function is the same as calling the <tt>hr()</tt> and <tt>label()</tt> functions individually.</p> + + +<br> +<hr><tt><b><big>function dialog.text ( dlg, key, default, prompt )</big></b></tt><br> +<p>Creates a single-line text entry widget.</p> +<p> +The value of the <tt>key</tt> field in the <tt>results</tt> table will be set to the contents of the entry box.<br> +If the <tt>default</tt> string is non-nil, that text will initially be displayed in the entry box.<br> +The <tt>prompt</tt> string displays a label in front of the entry box to describe the requested input. +</p> + + +<br> +<hr><tt><b><big>function dialog.password ( dlg, key, default, prompt )</big></b></tt><br> +<p>Identical to the <tt>text()</tt> function, except that the contents of the entry box are "masked", the characters are displayed as asterisks. </p> + + +<br> +<hr><tt><b><big>function dialog.textarea ( dlg, key, default, caption )</big></b></tt><br> +<p>Creates a multi-line text entry widget.</p> +<p> +The value of the <tt>key</tt> field in the results table will be set to the contents of the text area.<br> +If the <tt>default</tt> string is non-nil, that text will initially be displayed in the text area.<br> +The <tt>caption</tt> string displays a label above the text area to describe the requested input. +</p> + +<br> +<hr><tt><b><big>function dialog.checkbox ( dlg, key, default, caption )</big></b></tt><br> +<p>Creates an on/off toggle button.</p> +<p> +If the boolean <tt>default</tt> argument is <tt>true</tt>, the button will initially be shown in a "checked" state.<br> +The <tt>caption</tt> argument is the human-readable text to be displayed next to the button. +</p><p> +Note that although the default argument is boolean, the <tt>key</tt> value returned in the + <tt>results</tt> table will be a string, either <tt>"1"</tt> + for checked or <tt>"0"</tt> for unchecked. +</p> + + + +<br> +<hr><tt><b><big>function dialog.select ( dlg, key, default, caption )</big></b></tt><br> +<p>Creates an empty drop-down list box.</p> +<p> +The contents of the <tt>key</tt> field in the <tt>results</tt> table will be set to the value of the selected item.<br> +If the <tt>default</tt> string is non-nil, the item with that value will initially be selected in the list.<br> +The <tt>caption</tt> string displays a label in front of the list box to describe the requested input. +</p> + +<br> +<hr><tt><b><big>function dialog.option ( dlg, key, value, label )</big></b></tt><br> +<p>Adds an item to the drop-down list identified by <tt>key</tt>.</p> +<p> +The returned value of <tt>key</tt> will be set to this <tt>value</tt> in the <tt>results</tt> table if this item is selected.<br> +The <tt>label</tt> argument is the human-readable text to be displayed in the list. +</p> + + +<br> +<hr><tt><b><big>function dialog.group ( dlg, key, default, caption )</big></b></tt><br> +<p>Creates an empty group for radio buttons.</p><p> +The contents of the <tt>key</tt> field in the <tt>results</tt> table will be set to +the value of the selected radio button.<br> +If the <tt>default</tt> string is non-nil, the button with that value will initially be selected in the group.<br> +The <tt>caption</tt> string displays a label above of the group to describe the requested input. +</p> + +<br> +<hr><tt><b><big>function dialog.radio ( dlg, key, value, label )</big></b></tt><br> +<p>Adds a button to the radio group identified by <tt>key</tt>.</p> +<p> +The returned value of <tt>key</tt> will be set to this <tt>value</tt> in the <tt>results</tt> table if this button is selected.<br> +The <tt>label</tt> argument is the human-readable text to be displayed next to this button. +</p> + +<br> +<hr><tt><b><big>function dialog.file ( dlg, key, default, caption )</big></b></tt><br> +<p> +Creates a single-line text entry widget, along with a "browse" button that +invokes a separate file-selection dialog. <br> +If the user selects a filename in the file dialog, the text in the +entry widget will be set to the selected filename. +</p> +<p> +The value of the <tt>key</tt> field in the <tt>results</tt> table will be set to +the contents of the entry box.<br> +</p> + + +<br> +<hr><tt><b><big>function dialog.color ( dlg, key, default, caption )</big></b></tt><br> +<p> +Creates a single-line text entry widget, along with a "choose" button that +invokes a separate color-selection dialog. <br> +If the user selects a color from the dialog, the text in the +entry widget will be set to the selected color name in <tt>#RRGGBB</tt> format. +</p> +<p> +The value of the <tt>key</tt> field in the <tt>results</tt> table will be set to +the contents of the entry box.<br> +</p> + + +<br> +<hr><tt><b><big>function dialog.font ( dlg, key, default, caption )</big></b></tt><br> +<p> +Creates a single-line text entry widget, along with a "select" button that +invokes a separate font-selection dialog. <br> +If the user selects a font from the dialog, the text in the +entry widget will be set to the font name. +</p> +<p> +The value of the <tt>key</tt> field in the <tt>results</tt> table will be set to +the contents of the entry box.<br> +</p> +<br> + + + +<hr> +<br><br> +<div align="right"><small>© 2007-2008 <i>Jeff Pohlmeyer </i> </small></div> +<br><br> +<br><br><br><br> + + +</body> +</html>
Added: www/staging/geanylua/geanylua-intro.html =================================================================== --- www/staging/geanylua/geanylua-intro.html (rev 0) +++ www/staging/geanylua/geanylua-intro.html 2010-07-17 20:48:39 UTC (rev 1477) @@ -0,0 +1,131 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> +<html> +<head> +<title>Lua plugin for Geany - Introduction</title> +</head> +<body style="margin: 32px 25% 24px 5%"> +<hr><h2>Lua scripting plugin for the Geany IDE</h2><hr> +<p> +This is a plugin for the <a href="http://www.geany.org/">Geany</a> IDE + to provide <a href="http://www.lua.org/">Lua</a> scripting. +</p><p> +To begin, you should install the plugin and the example scripts. Please +read the <tt> INSTALL </tt> file for more information. +</p><p> +The next time you start Geany, the plugin will look for a directory named <tt><b>geanylua</b></tt> +in the user's plugin directory. <br> +On Linux, this would be: <tt>~/.geany/plugins/geanylua</tt><br> +( Unless you specify another config folder by the geany <tt>--config</tt> command line.)<br> +Any scripts found in this <tt>/plugins/geanylua/</tt> directory will appear in +the <i style="font-family:sans-serif">Tools->Lua Scripts</i> menu in Geany. +</p><p> +You can create additional scripts yourself, but all script files must have +names that end with the <tt><b>.lua</b></tt> file extension. +The menu labels are generated from the filenames like this: +<ol> + <li> The <tt><b>.lua</b></tt> filename extension is removed. + <li> If the filename <i>begins</i> with two decimal digits, followed by a dot, + those three characters are stripped off. Since the list of filenames is + scanned in alphanumeric order, this convention allows for arbitrary + sorting. For example if you wanted "<tt>Zebra</tt>" to appear before "<tt>Apple</tt>" + you could name your files + "<tt>01.Zebra.lua</tt>" and "<tt>02.Apple.lua</tt>" . + <li> If the resulting label <i>ends</i> with a trailing underscore, that underscore + is removed, and replaced with an ellipsis (three dots). This notation is generally + used to indicate to the user that the menu item invokes an additional dialog. + <li> If the label contains any addtional underscores, the first (leftmost) underscore is removed, + and the letter immediately following it will be marked as the underlined + "accelerator" key for the menu item. + <li> Finally, the first letter of the label is capitalized, and all hyphens are converted to spaces. + +</ol> +<p> +No effort is made by the plugin to resolve conflicting accelerators. +While these collisions are generally harmless, you should take some +effort to make sure you don't create inaccessible (duplicate) mnemonic keys. +</p><p> +Note that if you modify an existing script, the change will take effect immediately, but if you delete an existing script, or add a new script, you must +reload the plugin in order for the change to completely take effect. + ( The plugin can be reloaded either by restarting Geany, or +by toggling it OFF/ON via Geany's Plugin Manager, +or by calling the <tt>rescan()</tt> function from inside a script. ) +</p><p> +If there are any sub-directories that contain scripts, these will be recursed +to create sub-menus, with two exceptions - folders named <tt><b>events</b></tt> or <tt><b>support</b></tt> +will be ignored, these names are considered reserved. The <tt><b>events</b></tt> folder is +described below, and the <tt><b>support</b></tt> folder can be used to store arbitrary +user data files, modules, etc. +</p><p> +<a name="events"><br></a>The special directory <tt>./plugins/geanylua/events/</tt> +can contain some scripts that +will be invoked whenever the respective event is triggered by Geany. +</p><p> +Currently, there are nine valid filenames for the event scripts: +<dl compact> + <dt><tt>init.lua </tt></dt><dd> -- Runs when the plugin is loaded.</dd> + <dt><tt>cleanup.lua </tt></dt><dd> -- Runs when the plugin is unloaded.</dd> + + <dt><tt>saved.lua </tt></dt><dd> -- Runs when an open document is saved.</dd> + <dt><tt>created.lua </tt></dt><dd> -- Runs when a new document is created.</dd> + <dt><tt>opened.lua </tt></dt><dd> -- Runs when an existing file is opened.</dd> + <dt><tt>activated.lua</tt></dt><dd> -- Runs when switching documents (notebook tabs).</dd> + + <dt><tt>proj-opened.lua </tt></dt><dd> -- Runs when a project is opened.</dd> + <dt><tt>proj-saved.lua </tt></dt><dd> -- Runs when a project is saved.</dd> + <dt><tt>proj-closed.lua </tt></dt><dd> -- Runs when a project is closed.</dd> +</dl> +<p> +Note that if any of these nine files exists, it will be executed each time +its corresponding event occurs, which will result in some increase in disk activity. +In particular, you might notice a delay in startup time with the <tt>opened.lua</tt> +script when you open a bunch of files at once from the commmand line, etc. +</p><p> +<br><br> +Consult the <a href="geanylua-ref.html">reference</a> page for documentation of the Geany-specific Lua functions. +</p><p> + +A complete discussion of the Lua language is way beyond the scope of this +plugin package, but there is plenty of information available on the net, +For starters, you can check out: +</p><p> +<dl> + +<dt> +The manual: +</dt> +<dd> +<a href="http://www.lua.org/manual/5.1/"> +http://www.lua.org/manual/5.1/ +</a><br><br> +</dd> + +<dt>The wiki:</dt> +<dd> +<a href="http://lua-users.org/wiki/TutorialDirectory"> +http://lua-users.org/wiki/TutorialDirectory +</a><br><br> +</dd> + +<dt> +The book: +</dt> +<dd> +<a href="http://www.lua.org/pil/"> +http://www.lua.org/pil/ +</a><br><br> +</dd> + +</dl> + +<p> +Also, be warned that the plugin does not place any restrictions on what +you can or can't do from inside a script. For example, if you decide to +call <tt> os.exit() </tt> from a script, you will end your current Geany session +immediately, and any unsaved changes will be lost! </p><p> +You should also take some caution not to write a script that hangs indefinitely, +if this happens, the only way out is to kill the editor. +</p> + + +</body> +</html>
Added: www/staging/geanylua/geanylua-keyfile.html =================================================================== --- www/staging/geanylua/geanylua-keyfile.html (rev 0) +++ www/staging/geanylua/geanylua-keyfile.html 2010-07-17 20:48:39 UTC (rev 1477) @@ -0,0 +1,62 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> +<html> +<head> +<title>Lua plugin for Geany - The Keyfile Module</title> +</head> +<body style="margin: 32px 25% 24px 5%"> +<hr><h2>The Keyfile module</h2><hr> +<p> +The <tt>keyfile</tt> module provides a minimal Lua wrapper around the GLib library's <tt><a href="http://www.gtk.org/api/2.6/glib/glib-Key-value-file-parser.html">GKeyFile</a></tt> object, +for reading and writing of key-value file data, somewhat similar to MS-Windows <tt>*.INI</tt> files. +</p> +<p> +This file format is used by Geany for various configuration and project files. +Note that this module does not provide any functions for reading or writing disk files, +it simply receives or returns its file data as a single continuous string. If you need to +read or write a disk file, you can use Lua's built-in <tt>io</tt> module. +</p><p> +The functions are listed below... <br> +Optional parameters are noted in [ square ] brackets. +</p><p> +For get/set style functions, calling the function <i>with</i> the optional parameter +<i><u>assigns</u></i> a new value, calling the function <i>without</i> the optional +parameter <i><u>returns</u></i> the current value.<br> +</p><p> +Note that you can also use these functions in object-oriented style:<br> +For instance, <tt>keyfile.value(kf,"foo","bar")</tt> <br>can also be written +as <tt>kf:value("foo","bar")</tt><br></p><br> + + +<hr><tt><b><big>function keyfile.new ()</big></b></tt><br> +<p>Creates a new, empty <tt>keyfile</tt> object.</p><br> + +<hr><tt><b><big>function keyfile.data ( kf [, text] )</big></b></tt> -- <small>get/set</small><br> +<p>Returns or assigns the full text of the keyfile.</p><br> + +<hr><tt><b><big>function keyfile.groups ( kf )</big></b></tt><br> +<p>Returns an iterator to list the groups within the keyfile.</p><br> + +<hr><tt><b><big>function keyfile.keys ( kf, group )</big></b></tt><br> +<p>Returns an iterator to list the keys within the specified group.</p><br> + +<hr><tt><b><big>function keyfile.value ( kf, group, key [, value] )</big></b></tt> -- <small>get/set</small><br> +<p>Returns or assigns the value of the specified key.</p><br> + +<hr><tt><b><big>function keyfile.comment ( kf, group, key [, comment] )</big></b></tt> -- <small>get/set</small><br> +<p>Returns or assigns the comment for the specified key.<br> +If <tt>key</tt> is nil, it gets/sets the group comment.<br> +If <tt>group</tt> is nil, it gets/sets the comment for the file.<br> +</p><br> + +<hr><tt><b><big>function keyfile.has ( kf, group [, key] )</big></b></tt><br> +<p>Returns <tt>true</tt> if the specified group (and optionally the key) already exists.</p><br> + +<hr><tt><b><big>function keyfile.remove ( kf, group [, key] )</big></b></tt><br> +<p>Deletes the key, if specified, else it deletes the entire group.</p><br> +<hr> +<br><br> +<div align="right"><small>© 2007-2008 <i>Jeff Pohlmeyer </i> </small></div> +<br><br> +<br><br><br><br> +</body> +</html>
Added: www/staging/geanylua/geanylua-keys.html =================================================================== --- www/staging/geanylua/geanylua-keys.html (rev 0) +++ www/staging/geanylua/geanylua-keys.html 2010-07-17 20:48:39 UTC (rev 1477) @@ -0,0 +1,57 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> +<html> +<head> +<title>Lua plugin for Geany - Keybindings</title> +</head> +<body style="margin: 32px 25% 24px 5%"> +<hr><h2>How to assign custom key bindings to scripts</h2><hr> +Beginning with Geany version 0.14, it is now possible to integrate plugin +key bindings with Geany's built-in preferences system. This allows for +much easier configuration, and also helps to resolve conflicts between +the editor's bindings and the bindings associated with plugins.</p> +<p> +To use the new method, you simply create a plain text file named +"<tt><b>hotkeys.cfg</b></tt>" and place it your <b>/plugins/geanylua/</b> +folder. In this file you will list any scripts that you want to configure +keybindings for. The scripts should be listed one per line and may be +specified either by using an absolute path, or with a path relative +to your <b>/plugins/geanylua/</b> folder.</p><p> +After reloading the plugin (or restarting Geany) the scripts will +appear in Geany's <b>Edit->Preferences->Keybindings</b> dialog. + The names appearing in the dialog are derived from the filenames in a +manner similar to the way menu items are created from filenames. +<br><br> +</p> +<hr> +<h3>(The old way)</h3> +<p> +<b>Important:</b> The technique described below has been deprecated in favor +of Geany's built-in keybinding API. It is still working for now, however +you are strongly urged to convert your scripts over to the new method. +The reference below is provided mainly for historical reasons... + +</p> +<p> +Before we begin, it is assumed that you are comfortable with your current +keybindings in the editor itself. If you are the sort who +likes to tweak your editor keybindings on a daily basis, adding script keybindings +into the mix will likely be an exercise in frustration! This is because there is +absolutely no coordinated way to detect conflicts between the Geany keybindings + and script keybindings, or even between the individual scripts. So you + are the only one responsible to insure that such conflicts don't occur, or at + least that they don't cause you any major problems. +</p><p> +The syntax for enabling a keybinding is quite simple, but it <i>must</i> be the very first line in the script file. +The line should begin with a double dash (the standard single-line Lua comment marker) followed by a space and the string <tt><b>@ACCEL@</b></tt> followed by another space and then the accelerator specification in standard +<a href="http://www.gtk.org/api/2.6/gtk/gtk-Keyboard-Accelerators.html#gtk-accelerator-parse">GTK syntax</a>. +</p><p> +For example, to launch a script by pressing the keys <b> <u>[Ctrl]</u> <u>[Shift]</u> <u>[J]</u> </b> you could write this as the first line of your script:<br> +<h3><tt>-- @ACCEL@ <Control><Shift>j</tt></h3> +<p>Note that such tags are scanned once only when the plugin is loaded, so any changes require reloading the plugin before the change will take effect. + The plugin can be reloaded either by restarting Geany, or +by toggling it OFF/ON via Geany's Plugin Manager, +or by calling the <tt>rescan()</tt> function from inside a script. +</p> +<br><hr> +</body> +</html>
Added: www/staging/geanylua/geanylua-ref.html =================================================================== --- www/staging/geanylua/geanylua-ref.html (rev 0) +++ www/staging/geanylua/geanylua-ref.html 2010-07-17 20:48:39 UTC (rev 1477) @@ -0,0 +1,1224 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> +<html> +<head> +<title>Lua plugin for Geany - Reference</title> +<style type="text/css"> +<!-- +UL,PRE,P{ + margin: 12px 25% 12px 5% +} +.odd { + background-color:#f4f4fc +} +.even { + background-color:#ffffff +} +.desc { + font-family:sans-serif +} +--> +</style> +</head> +<body > +<hr><h2>Lua scripting plugin for the Geany IDE</h2><hr><br> +The Geany module provides these functions and variables...<br><br><br> +<div style="background-color:#fcf4f4; margin-left:12px; margin-right:12px"> +<hr> +<table summary="quick links" width="90%" align="center" > +<tr align="center" > +<td><a href="#Editor_functions">Editor functions</a></td> +<td><a href="#System_functions">System functions</a></td> +<td><a href="#Dialog_functions">Dialog functions</a></td> +</tr></table> +<hr> +</div> +<br><br> + +<b><a name="Editor_functions"></a>Editor functions:</b> + +<table style="font-family:monospace" summary="function index" width="90%"> +<tr class="odd"> + <td> function <a href="#activate"><b>activate</b></a> ( tab_id )<br></td> + <td class="desc">-- Focus the specified editor tab.</td> +</tr> +<tr class="even"> + <td> function <a href="#appinfo"><b>appinfo</b></a> ()<br></td> + <td class="desc">-- Return information about the current Geany instance.</td> +</tr> +<tr class="odd"> + <td> function <a href="#batch"><b>batch</b></a> ( start )<br></td> + <td class="desc">-- Set a marker for a reversible group of operations.</td> +</tr> + +<tr class="even"> + <td> function <a href="#byte"><b>byte</b></a> ( [position] )<br></td> + <td class="desc">-- Get the numeric value of the character at position.</td> +</tr> +<tr class="odd"> + <td> function <a href="#caret"><b>caret</b></a> ( [position] )<br></td> + <td class="desc">-- Get or set the caret position.</td> +</tr> + +<tr class="even"> + <td> function <a href="#close"><b>close</b></a> ( [filename]|[index] )<br></td> + <td class="desc">-- Close a document.</td> +</tr> + +<tr class="odd"> + <td> function <a href="#copy"><b>copy</b></a> ( [content]|[start,stop] )<br></td> + <td class="desc">-- Copy text to the clipboard.</td> +</tr> + +<tr class="even"> + <td> function <a href="#count"><b>count</b></a> ()<br></td> + <td class="desc">-- Get the number of open tabs.</td> +</tr> + +<tr class="odd"> + <td> function <a href="#cut"><b>cut</b></a> ()<br></td> + <td class="desc">-- Cut selection to the clipboard.</td> +</tr> + +<tr class="even"> + <td> function <a href="#documents"><b>documents</b></a> ( [doc_id] )<br></td> + <td class="desc">-- Access the list of all open documents.</td> +</tr> + +<tr class="odd"> + <td> function <a href="#filename"><b>filename</b></a> ()<br></td> + <td class="desc">-- Get the name of the current document.</td> +</tr> + +<tr class="even"> + <td> function <a href="#fileinfo"><b>fileinfo</b></a> ()<br></td> + <td class="desc">-- Return some information about the current document.</td> +</tr> + +<tr class="odd"> + <td> function <a href="#find"><b>find</b></a> ( phrase, start, stop, options )<br></td> + <td class="desc">-- Search for text within the document.</td> +</tr> + +<tr class="even"> + <td> function <a href="#height"><b>height</b></a> ()<br></td> + <td class="desc">-- Get the number of lines in the current document</td> +</tr> + +<tr class="odd"> + <td> function <a href="#keycmd"><b>keycmd</b></a> ( command )<br></td> + <td class="desc">-- Activate a built-in Geany menu command.</td> +</tr> + +<tr class="even"> + <td> function <a href="#keygrab"><b>keygrab</b></a> ( [prompt] )<br></td> + <td class="desc">-- Intercept a keystroke from Geany.</td> +</tr> + + +<tr class="odd"> + <td> function <a href="#length"><b>length</b></a> ()<br></td> + <td class="desc">-- Get number of characters in the current document.</td> +</tr> + +<tr class="even"> + <td> function <a href="#lines"><b>lines</b></a> ( [index] )<br></td> + <td class="desc">-- Get the text on one specific line, or all of them.</td> +</tr> + +<tr class="odd"> + <td> function <a href="#match"><b>match</b></a> ( [position] )<br></td> + <td class="desc">-- Find a matching bracket, parenthesis, etc.</td> +</tr> + +<tr class="even"> + <td> function <a href="#navigate"><b>navigate</b></a> ( mode,count [,extend [,rect]])<br></td> + <td class="desc">-- Move the caret incrementally.</td> +</tr> + +<tr class="odd"> + <td> function <a href="#newfile"><b>newfile</b></a> ( [filename] )<br></td> + <td class="desc">-- Create a new document.</td> +</tr> + +<tr class="even"> + <td> function <a href="#open"><b>open</b></a> ( [filename]|[index] )<br></td> + <td class="desc">-- Open or reload a file from disk.</td> +</tr> + +<tr class="odd"> + <td> function <a href="#paste"><b>paste</b></a> ()<br></td> + <td class="desc">-- Paste text from the clipboard.</td> +</tr> + + +<tr class="even"> + <td> function <a href="#rowcol"><b>rowcol</b></a> ( [pos]|[row,col] )<br></td> + <td class="desc">-- Translate between linear and rectangular locations.</td> +</tr> + +<tr class="odd"> + <td> function <a href="#save"><b>save</b></a> ( [filename]|[index] )<br></td> + <td class="desc">-- Save an open document to a disk file.</td> +</tr> + +<tr class="even"> + <td> function <a href="#scintilla"><b>scintilla</b></a> ( msg_id, wparam, lparam )<br></td> + <td class="desc">-- Send a message directly to the Scintilla widget.</td> +</tr> + +<tr class="odd"> + <td> function <a href="#select"><b>select</b></a> ( [[start,] stop] )<br></td> + <td class="desc">-- Get or set the selection endpoints and caret.</td> +</tr> + +<tr class="even"> + <td> function <a href="#selection"><b>selection</b></a> ( [content] )<br></td> + <td class="desc">-- Get or set the contents of the document's selection.</td> +</tr> + +<tr class="odd"> + <td> function <a href="#signal"><b>signal</b></a> ( widget, signal )<br></td> + <td class="desc">-- Send a GTK signal to a Geany interface widget.</td> +</tr> + +<tr class="even"> + <td> function <a href="#text"><b>text</b></a> ( [content] )<br></td> + <td class="desc">-- Get or set the contents of the entire document.</td> +</tr> + +<tr class="odd"> + <td> function <a href="#word"><b>word</b></a> ( [position] )<br></td> + <td class="desc">-- Get the word at the specified location.</td> +</tr> + +<tr class="even"> + <td> function <a href="#xsel"><b>xsel</b></a> ( [text] )<br></td> + <td class="desc">-- Get or set the contents of the primary X selection.</td> +</tr> + +<tr class="odd"> + <td> function <a href="#yield"><b>yield</b></a> ()<br></td> + <td class="desc">-- Refreshes the user interface.</td> +</tr> + + +<tr class="even"> + <td> </td> + <td></td> +</tr> + +<tr class="odd"> +<td> var <a href="#caller"><b>caller</b></a> : <i>number</i><br> +</td><td class="desc">-- The index of the document that triggered an event.</td> +</tr> + +<tr class="even"> +<td> var <a href="#rectsel"><b>rectsel</b></a> : <i>boolean</i><br> +</td><td class="desc">-- Whether or not the selection is in rectangular mode.</td> +</tr> +<tr class="odd"> +<td> var <a href="#project"><b>project</b></a> : <i>keyfile</i><br> +</td><td class="desc">-- An object representing a project configuration event.</td> +</tr> +<tr class="even"> +<td> var <a href="#script"><b>script</b></a> : <i>string</i><br> +</td><td class="desc">-- The filename of the currently executing Lua script.</td> +</tr> +<tr class="odd"> +<td> var <a href="#wordchars"><b>wordchars</b></a> : <i>string</i><br></td> +<td class="desc">-- The characters that are considered part of a word.</td> +</tr> + +</table> + + +<br> +<br><br> + +<b><a name="System_functions"></a>System functions:</b> +<table style="font-family:monospace" summary="function index" width="90%"> +<tr class="odd"> +<td> function <a href="#basename"><b>basename</b></a>( pathstr )<br></td> +<td class="desc">-- Extract the filename portion of a path string.</td> +</tr> +<tr class="even"> +<td> function <a href="#dirlist"><b>dirlist</b></a>( path )<br></td> +<td class="desc">-- List the contents of a folder.</td> +</tr> +<tr class="odd"> +<td> function <a href="#dirname"><b>dirname</b></a>( pathstr )<br></td> +<td class="desc">-- Get the directory portion of a file's path.</td> +</tr> +<tr class="even"> +<td> function <a href="#fullpath"><b>fullpath</b></a>( filename )<br></td> +<td class="desc">-- Get the full path to a file.</td> +</tr> +<tr class="odd"> + <td> function <a href="#launch"><b>launch</b></a> ( program [, arg1 [, arg2, ...]] )<br></td> + <td class="desc">-- Execute an external application.</td> +</tr> +<tr class="even"> + <td> function <a href="#optimize"><b>optimize</b></a> ()<br></td> + <td class="desc">-- Run a script without the debug hook.</td> +</tr> +<tr class="odd"> + <td> function <a href="#rescan"><b>rescan</b></a> ()<br></td> + <td class="desc">-- Regenerate the scripts menu.</td> +</tr> +<tr class="even"> + <td> function <a href="#stat"><b>stat</b></a> ( filename [, lstat] )<br></td> + <td class="desc">-- Retrieve some information about a disk file.</td> +</tr> +<tr class="odd"> + <td> function <a href="#timeout"><b>timeout</b></a> ( seconds )<br></td> + <td class="desc">-- Control maximum time allowed for script execution.</td> +</tr> +<tr class="even"> + <td> function <a href="#wkdir"><b>wkdir</b></a> ( [folder] )<br></td> + <td class="desc">-- Get or set the current working directory.</td> +</tr> +<tr class="even"> + <td> </td> + <td></td> +</tr> +<tr class="odd"> +<td> var <a href="#dirsep"><b>dirsep</b></a> : <i>string</i><br> +</td><td class="desc">-- The default filesystem path separator, "<tt>/</tt>" or "<tt></tt>".</td> +</tr> +</table> + +<br> +<br><br> + +<b><a name="Dialog_functions"></a>Dialog functions:</b> +<table style="font-family:monospace" summary="function index" width="90%"> +<tr class="odd"> +<td> function <a href="#choose"><b>choose</b></a> ( prompt, items )</td> +<td class="desc" width="33%">-- Select an item from the list.</td> +</tr> +<tr class="even"> +<td> function <a href="#confirm"><b>confirm</b></a> ( title, question, default )</td> +<td class="desc">-- Ask a yes-or-no question.</td> +</tr> +<tr class="odd"> +<td> function <a href="#input"><b>input</b></a> ( [prompt] [,default] )</td> +<td class="desc">-- Prompt to enter some text.</td> +</tr> +<tr class="even"> +<td> function <a href="#message"><b>message</b></a> ( [title,] message )</td> +<td class="desc">-- Display some information.</td> +</tr> +<tr class="odd"> +<td> function <a href="#pickfile"><b>pickfile</b></a> ( [mode [,path [,filter]]] )</td> +<td class="desc">-- Select a file from disk.</td> +</tr> +<tr class="even"> + <td> </td> + <td></td> +</tr> +<tr class="odd"> +<td> var <a href="#banner"><b>banner</b></a> : <i>string</i><br></td> +<td class="desc">-- The window title for all dialogs.</td> +</tr> +</table><br> +If you need a more advanced dialog creation API, check out the +<tt><big><a href="geanylua-input.html">dialog</a></big></tt> module. +<br><br><br> +<hr> + + +<hr><a name="activate"></a><h3><tt>geany.activate ( tab_id )</tt></h3><p> +Activates the document specified by <tt><b>tab_id</b></tt>. +</p> +<p> +If <tt><b>tab_id</b></tt> is a number, it activates the document at that index. + A <i>positive</i> number refers to the internal document array, and a <i>negative</i> +number refers to the (absolute) GtkNotebook index.<br> +Note that the indices begin at <tt>(1)</tt> and <tt>(-1)</tt> respectively. +</p> +<p> +If <tt><b>tab_id</b></tt> is a string, the function will try to activate the +notebook tab whose filename matches that string.<br> +( The full pathname is required! ) +</p><p> +Returns <tt><b>true</b></tt> on success, or <tt><b>false</b></tt> if the tab could not be found. +</p><br><br> + +<a name="appinfo"></a><hr><h3><tt>geany.appinfo ()</tt></h3><p> +Returns a Lua table containing information about the currently running Geany instance.<br><br> +The <tt>appinfo</tt> table contains the following fields: +<br> +<table border="0" summary="appinfo table fields"> +<tr><td width="5%"></td><td><tt>debug</tt></td><td> -- <tt>true</tt> if Geany is running in debug mode.</td></tr> +<tr><td width="5%"></td><td><tt>configdir </tt></td><td> -- User's local configuration folder.</td></tr> +<tr><td width="5%"></td><td><tt>datadir</tt></td><td> -- System-wide configuration folder.</td></tr> +<tr><td width="5%"></td><td><tt>docdir</tt></td><td> -- Location of the Geany help files.</td></tr> +<tr><td width="5%"></td><td><tt>scriptdir</tt></td><td> -- Top level folder for GeanyLua scripts.</td></tr> +<tr><td width="5%"></td><td><tt>tools</tt></td><td> -- Table of user-configured tools. (see below)</td></tr> +<tr><td width="5%"></td><td><tt>template</tt></td><td> -- Table of user's template information. (see below)</td></tr> +<tr><td width="5%"></td><td><tt>project</tt></td><td> -- Table of current project information. (see below)</td></tr> +</table> +<p> +————</p><p> +The <tt>tools</tt> sub-table contains the following fields: +<br> +<table border="0" summary="tools table fields"> +<tr><td width="15%"></td><td><tt>browser</tt> </td></tr> +<tr><td width="15%"></td><td><tt>term</tt> </td><td></tr> +<tr><td width="15%"></td><td><tt>print</tt> </td></tr> +<tr><td width="15%"></td><td><tt>grep</tt> </td></tr> +<tr><td width="15%"></td><td><tt>action</tt> </td></tr> +</table> +<p> +————</p><p> +The <tt>template</tt> sub-table contains the following fields: +<br> +<table border="0" summary="template fields"> +<tr><td width="15%"></td><td><tt>developer</tt> </td></tr> +<tr><td width="15%"></td><td><tt>company</tt> </td></tr> +<tr><td width="15%"></td><td><tt>mail</tt> </td><td></tr> +<tr><td width="15%"></td><td><tt>initial</tt> </td></tr> +<tr><td width="15%"></td><td><tt>version</tt> </td></tr> +</table> +<p> +————</p><p> +The <tt>project</tt> sub-table *might* contain the following fields: +<br> +<table border="0" summary="template fields"> +<tr><td width="15%"></td><td><tt>name</tt> </td><td> -- Name of project.</td></tr> +<tr><td width="15%"></td><td><tt>desc</tt> </td><td> -- Project description.</td></tr> +<tr><td width="15%"></td><td><tt>file</tt> </td><td> -- Project filename.</td></tr> +<tr><td width="15%"></td><td><tt>base</tt> </td><td> -- Base path of project files.</td></tr> +<tr><td width="15%"></td><td><tt>mask</tt> </td><td> -- Semicolon-delimited list of filetypes.</td></tr> +</table> +<p> +<b>* Important:</b> The entire <tt>project</tt> sub-table will be <tt>nil</tt> if there is no open project!<br> +<br><br> + +<a name="basename"></a><hr><h3><tt>geany.basename ( pathstr )</tt></h3><p> +Returns the rightmost filename portion of <tt>pathstr</tt>, with the directory portion removed. +</p><br><br> + +<hr><a name="batch"></a><h3><tt>geany.batch ( start )</tt></h3><p> +This function marks the beginning or ending of a group of operations<br> +that you want the user to be able to undo in a single step.</p> +<p> +If the <tt><b>start</b></tt> argument is <tt><b>true</b></tt>, +it marks the <i>beginning</i> of a group of operations.</p> +<p> +If the <tt><b>start</b></tt> argument is <tt><b>false</b></tt>, +it marks the <i>ending</i> of a group of operations. +</p><br><br> + +<hr><a name="byte"></a><h3><tt>geany.byte ( [position] )</tt></h3><p> +When called with no arguments, returns the numeric value of the character at +the current caret position.</p><p> +When called with a numeric <tt><b>position</b></tt> argument, returns the +value of the character at that position. +</p><br><br> + + +<hr><a name="caret"></a><h3><tt>geany.caret ( [position] )</tt></h3><p> +When called with no arguments, returns the current caret position.</p> +<p> +When called with a single numeric argument, moves the caret to that position.<br> +Out-of-range values are adjusted to the nearest possible position (i.e. the start or end of the document.) +</p><br><br> + +<a name="close"></a><hr><h3><tt>geany.close ( [filename]|[index] )</tt></h3> +<p> +When called with no arguments, closes the currently active document. +</p> +<p> +When called with a numeric argument, closes the file of that document index. +</p> +<p> +When called with a string argument, it will close that named document. +</p> +<p> +If the document has unsaved changes, the user will be prompted to save before closing,<br> +and will also be given the option to cancel the operation. To avoid this, you might <br> +want to consider using the <tt>geany.save()</tt> function beforehand. +</p> +<p> +Returns <tt><b>true</b></tt> if the document was successfully closed, or <tt><b>false</b></tt> otherwise.</p> +<br><br> + +<hr><a name="copy"></a><h3><tt>geany.copy ( [content]|[start,stop] )</tt></h3><p> +When called with no arguments, copies the current selection to the clipboard. +</p><p> +When called with a single string argument, copies the contents of that string to the clipboard. +</p> +<p> +When called with two arguments, copies the portion of the current document's text +that lies between the <tt><b>start</b></tt> and <tt><b>stop</b></tt> positions. +(Both positions must be positive numbers.) +</p> +<p> +Returns the number of characters copied, or <tt><b>nil</b></tt> if there is no open document. +</p> +<br><br> + +<hr><a name="count"></a><h3><tt>geany.count ()</tt></h3><p> +Returns the number of open documents. +</p><br><br> + + +<hr><a name="cut"></a><h3><tt>geany.cut ()</tt></h3><p> +Cuts the current selection to the clipboard. +</p> +<p> +Returns the number of characters cut, or <tt><b>nil</b></tt> if there is no open document. +</p><br><br> + + +<a name="dirlist"></a><hr><h3><tt>geany.dirlist ( path )</tt></h3><p> +Returns an iterator function that will be called once for each entry (file or subdirectory) in the specified folder. +The iterator produces only the name of each entry, and in no particular order.</p><p> +This function will generate an error dialog if the specified folder does not exist or cannot be accessed. +</p><br><br> + +<a name="dirname"></a><hr><h3><tt>geany.dirname ( pathstr )</tt></h3><p> +Returns the directory portion of <tt>pathstr</tt>, with the rightmost filename portion removed. +</p><br><br> + +<hr><a name="documents"></a><h3><tt>geany.documents ( [doc_id] )</tt></h3><p> +When called with a numeric argument, returns the full path and filename of <br> +the document at the index specified by <tt><b>doc_id</b></tt>. +</p> +<p> +When called with a string argument, returns the numeric index of the document with the<br> +path/filename that matches the <tt><b>doc_id</b></tt> string.<br> +</p> +<p> +Either of the two forms above may also return <tt><b>nil</b></tt> if the argument cannot be matched.</p> +<p> +Note: The <i>index</i> here refers to the editor's internal document array, +and might not be <br> +the same as the notebook tab index, since the tabs can be re-ordered by the user. +</p> +<p> +<br><br> +When called with no arguments, the function returns an iterator to list the full path and filename +of each document currently open in the editor.</p><p> +For example:</p> +<pre> + +for filename in geany.documents() +do + print(filename) +end +</pre> + +<br><br> + + +<a name="filename"></a><hr><h3><tt>geany.filename ()</tt></h3><p> +Returns the full path and filename of the current Geany document.</p><p> +If there is no open document, or if the current document is untitled, returns <tt><b>nil</b></tt>. +</p><br><br> + + +<a name="fileinfo"></a><hr><h3><tt>geany.fileinfo ()</tt></h3><p> +Returns a Lua table containing various information about the current document.<br> +If there is no open document, returns <tt><b>nil</b></tt>. +</p><p> +The returned table contains the following fields: +<table border="0" summary="fileinfo fields"> +<tr><td width="5%"></td><td><tt>name</tt> </td><td> -- The filename, without the path.</td></tr> +<tr><td width="5%"></td><td><tt>path</tt> </td><td> -- The full path of the file's directory, including the trailing slash.</td></tr> +<tr><td width="5%"></td><td><tt>ext</tt> </td><td> -- The file extension, including the dot, e.g. "<b>.DLL</b>" or "<b>.txt</b>"</td></tr> +<tr><td width="5%"></td><td><tt>type</tt> </td><td> -- A one-word description of the filetype, e.g. "<b>C</b>" or "<b>Python</b>".</td></tr> +<tr><td width="5%"></td><td><tt>desc</tt> </td><td> -- A longer description of the filetype, e.g. "<b>Lua source file</b>" or "<b>Cascading StyleSheet</b>".</td></tr> +<tr><td width="5%"></td><td><tt>opener</tt> </td><td> -- The string used to begin a comment, e.g. "<b class="desc"><!--</b>".</td></tr> +<tr><td width="5%"></td><td><tt>closer</tt> </td><td> -- The string used to end a comment, e.g. "<b class="desc">--></b>".</td></tr> +<tr><td width="5%"></td><td><tt>action</tt> </td><td> -- The action command as executed by the context menu</td></tr> +<!-- +<tr><td width="5%"></td><td><tt>compiler</tt> </td><td> -- The command used to compile this type of file.</td></tr> +<tr><td width="5%"></td><td><tt>linker</tt> </td><td> -- The command used to link this type of file.</td></tr> +<tr><td width="5%"></td><td><tt>exec</tt> </td><td> -- The primary command used to execute this type of file.</td></tr> +<tr><td width="5%"></td><td><tt>exec2</tt> </td><td> -- An alternative command used to execute this type of file.</td></tr> +--> +<tr><td width="5%"></td><td><tt>ftid</tt> </td><td> -- The unique numeric filetype identifier, as used by Geany.</td></tr> +<tr><td width="5%"></td><td><tt>encoding</tt> </td><td> -- The file's in-memory encoding. (may differ from the on-disk encoding.)</td></tr> +<tr><td width="5%"></td><td><tt>bom</tt> </td><td> -- <tt><b>true</b></tt> if the file contains a <b>B</b>yte-<b>O</b>rder <b>M</b>arker.</td></tr> +<tr><td width="5%"></td><td><tt>changed</tt> </td><td> -- <tt><b>true</b></tt> if the file has unsaved changes.</td></tr> +<tr><td width="5%"></td><td><tt>readonly</tt> </td><td> -- <tt><b>true</b></tt> if the in-memory document is tagged as read-only.</td></tr> +</table> +<br><br> + + + +<a name="find"></a><hr><h3><tt>geany.find ( phrase, start, stop, options )</tt></h3><p> +Searches within the current document for the string <tt>phrase</tt>, beginning at <br> +the numeric <tt>start</tt> position and ending at the <tt>stop</tt> position.<br> +( To search backwards, specify a <tt>start</tt> value greater than <tt>stop</tt> . )<br><br> +</p><p> + + +The <tt>options</tt> argument is a table, each element may be one of the following strings:<br> + +<table border="0" summary="search options"> +<tr><td width="3%"> </td><td width="20%"><tt> +"matchcase"</tt></td><td> -- A match only occurs with text that matches the case of the search string. +</td></tr> +<tr><td> </td><td><tt> +"wholeword" </tt> </td><td> -- A match only occurs if the characters before and after are not word characters. +</td></tr> +<tr><td> </td><td><tt> +"wordstart" </tt> </td><td> -- A match only occurs if the character before is not a word character. +</td></tr> +<tr><td> </td><td><tt> +"regexp" </tt> </td><td> -- The search string should be interpreted as a regular expression. +</td></tr> +<tr><td> </td><td><tt> +"posix" </tt> </td><td> -- Use bare parentheses +<tt><b>(</b></tt> +<tt><b>)</b></tt> +for tagged sections rather than the escaped <tt><b>(</b></tt> and <tt><b>)</b></tt>. +</td></tr> +<tr><td colspan="3"> +( The empty set <tt><b>{}</b></tt> may also be specified, to search using the default options. ) +</td></tr> +</table> +<p> +If a match is found, the function returns the starting and ending positions of the match,<br> +otherwise it returns <tt><b>nil</b>.</tt> +</p><p> +For example, to select the first case-sensitive whole-word match of the string + '<b>foobar</b>' you could use something like this:</p> +<pre> + a,b = geany.find( "foobar", 0, geany.length(), {"wholeword","matchcase"} ) + if (a) then + geany.select(a,b) + else + geany.message("Search phrase not found.") + end +</pre><br><br> + + + +<a name="fullpath"></a><hr><h3><tt>geany.fullpath ( filename )</tt></h3><p> +Returns the fully canonicalized form of the path to an <i>existing</i> named file, or <tt>nil</tt> if the path could not be found. +</p><br><br> + + + + +<a name="height"></a><hr><h3><tt>geany.height ()</tt></h3><p> +Returns the total number of lines in the current document. +</p><br><br> + +<a name="keycmd"></a><hr><h3><tt>geany.keycmd ( command )</tt></h3><p> +Activates (runs) one of Geany's built-in menu commands.</p><p> +The <tt>command</tt> argument should be one the string constants defined in the +"<tt>glspi_keycmd.h</tt>" header from the plugin sources. +For example, to display Geany's preferences dialog, you could use:</p><p> +<tt> geany.keycmd("MENU_PREFERENCES")</tt> +</p> +<p> +This function raises an error if the command argument is invalid. +</p><br><br> + + + + + +<a name="keygrab"></a><hr><h3><tt>geany.keygrab ( [prompt] )</tt></h3><p> + +Intercepts the next keyboard key pressed, preventing the editor from receiving +that keyboard event.</p> +<p> +The function returns the value of the pressed key as a string, +alphanumeric keys will return their keyboard value, such as + <tt>"a"</tt> or <tt>"1"</tt> while other keys may +return a string describing the key, such +as <tt>"Return"</tt> or <tt>"Escape"</tt>. +( Consult the file <tt>gdk/gdkkeysyms.h</tt> in the GTK sources for some idea of the key names. ) +</p><p> +It should be possible to use this function on keyboards other than US, +although this hasn't been tested, and scripts written for one keyboard +might not be portable to another system. </p> +<p>Key combinations with the modifier keys <b>[Ctrl]</b> or <b>[Alt]</b> +are not supported. Detection of the <b>[Shift]</b> key state is somewhat supported, +although currently it may not be completely reliable. + Repeatedly calling this function in rapid succession (as in a loop) may also result in some "dropped" keys, +so for best results its use should be confined to detecting a single "lowercase" key press.</p><p> + +If the optional <tt>prompt</tt> string argument is present, its text will be shown +as a "calltip" near the upper left-hand area of the current document. +(but only if there is a document open.)</p> +<p> +This function was primarily intended for assigning "chained" sets of hot key +options, in conjunction with user-defined <a href="geanylua-keys.html">keybindings</a>. + + +</p> +<p> + +</p><br><br> + + + + + +<a name="launch"></a><hr><h3><tt>geany.launch ( program [, arg1 [, arg2, ...]] )</tt></h3><p> +Executes the external application specified by <tt>program</tt>, +passing any additional arguments to its command line. +</p> +<p> +Returns <tt>true</tt> if the process was succesfully created, else it returns <tt>false</tt> plus an error message.</p> +<p> +For example:<br><tt> + local ok,msg = geany.launch("firefox", "http://www.yahoo.com/")<br> + if not ok then geany.message(msg) end</tt> +</p> +<p> +This function returns immediately, regardless of the status of the newly-created process. +If you need to wait for a process to complete before returning, +use Lua's built-in <tt>os.execute()</tt> function instead. +</p> +<p>Note that using this function on MS-Windows might require installing the +"<b><tt>gspawn-win32-helper.exe</tt></b>" program somewhere in your <tt>PATH</tt>. +( It is included in the GTK/GLib package. )</p> +<br><br> + + +<a name="length"></a><hr><h3><tt>geany.length ()</tt></h3><p> +Returns the text length of the current document. +</p><br><br> + + +<a name="lines"></a><hr><h3><tt>geany.lines ( [index] )</tt></h3><p> +When called with one argument, returns a string containing the text at +the specified line number of the current document.<br> +It may also return <tt><b>nil</b></tt> if there is no open document, +or if the specified <tt><b>index</b></tt> is outside the range of lines. +</p><p> +When called without any arguments, it returns an iterator that steps +through each line of the current document. <br> +So you can use it like this:<pre> +for line in geany.lines() +do + print(line) +end +</pre> +<br><br> + + +<a name="match"></a><hr><h3><tt>geany.match ( [position] )</tt></h3><p> +Attempts to find a corresponding matching brace from the given <tt><b>position</b></tt> of one brace.<br> +( If the <tt><b>position</b></tt> argument is omitted, the current caret position is assumed. ) +</p> +<p>The brace characters handled are: <tt><b> () [] {} <></b></tt></p> +<p> The search is forwards from an opening brace and backwards from a closing brace.<br> +If the character at <tt><b>position</b></tt> is not a brace character, or a matching brace cannot be found,<br> +the return value is -1. Otherwise, the return value is the position of the matching brace. +</p><br><br> + + + +<a name="navigate"></a><hr><h3><tt>geany.navigate ( mode, count [,extend [,rect]] )</tt></h3><p> +Moves the caret incrementally.</p> +<p> +The <tt><b>mode</b></tt> argument must be one of the following strings: +<ul> +<li><tt>"char"</tt> -- Move by characters.</li> +<li><tt>"part"</tt> -- Move by segments in <big>MixedCase</big> or <big>under_score</big> style identifiers.</li> +<li><tt>"word"</tt> -- Move by words.</li> +<li><tt>"edge"</tt> -- Move to beginning or end of current line.</li> +<li><tt>"line"</tt> -- Move up or down by lines.</li> +<li><tt>"para"</tt> -- Move up or down by paragraphs.</li> +<li><tt>"page"</tt> -- Move up or down by pages.</li> +<li><tt>"body"</tt> -- Move to the beginning or end of the entire document.</li> +</ul> +<p> +If the numeric <tt><b>count</b></tt> argument is <i>positive</i>, the caret is moved <i>forward</i> or <i>down</i> by that many steps.<br> +If it is <i>negative</i>, the caret is moved <i>backward</i> or <i>up</i> by that many steps.<br> +( If it is <i>zero</i> there is not much point in using this function. )<br> +There is also no point in using a magnitude greater than <i>one</i> for the <tt>"edge"</tt> or <tt>"body"</tt> modes. +</p> +<p> +If the optional boolean <tt><b>extend</b></tt> argument is <tt><b>true</b></tt>, +the selection is expanded or contracted to the new caret position, +similar to holding down the <big>[Shift]</big> key when navigating with the keyboard. +</p><p> +If the optional boolean <tt><b>rect</b></tt> argument is also <tt><b>true</b></tt>, +the selection is treated as <i>rectangular</i> rather than <i>linear</i>.<br> +( Rectangular selection is only supported for <tt>char</tt>, <tt>edge</tt>, +<tt>line</tt>, or <tt>page</tt> modes. ) +</p> +<br><br> + + +<a name="newfile"></a><hr><h3><tt>geany.newfile ( [filename] )</tt></h3><p> +When called with one argument, creates a new document with the specified +<tt>filename</tt>. </p><p>When called with no arguments, creates a new, untitled document. +</p><br><br> + + + +<a name="open"></a><hr><h3><tt>geany.open ( [filename]|[index] )</tt></h3><p> +When called with no arguments, reloads the currently active document from disk. +</p><p> +When called with a numeric argument, reloads the file of that document index. +</p><p> +When called with a string argument, it will reload that filename if it is already open, +or otherwise it will open it in a new tab. <br> +It will not create a non-existent file, for that you need to use <tt>geany.newfile()</tt> +</p> +<p> +Returns the <i>one-based</i> document index on success, +or <i>zero</i> if the document could not be opened or reloaded.</p> +<br><br> + +<a name="optimize"></a><hr><h3><tt>geany.optimize ()</tt></h3><p> +Disables the Lua interpreter's "debug hook", the thing that +allows the plugin to track line number information and elapsed time.</p><p> +The advantage of calling <tt>optimize()</tt> is that a lengthy, CPU-intensive +script can sometimes run much faster. +</p><p> +The disadvantage is that you lose the line number information that helps in +debugging your script, and the built-in protection against things like endless loops. +For this reason you should only use this function if you really need it, and +only when you are reasonably sure that your script doesn't contain any errors. +</p><p>For best results this function should be called at the very +beginning of the script. + +</p> +<br><br> + +<a name="paste"></a><hr><h3><tt>geany.paste ()</tt></h3><p> +Pastes the text from the clipboard into the active document at the current caret position,<br> +replacing any current selection. +</p><p> +Returns <tt><b>nil</b></tt> if there is no open document, +or if the document is marked read-only.</p><p> +Otherwise it returns the effective change in the document's size. <br> +( Which may actually be negative, if the clipboard content size is less than the prior selection. ) +</p> +<br><br> + + +<a name="rescan"></a><hr><h3><tt>geany.rescan ()</tt></h3><p> +Scans the scripts folder, rebuilds the <b><i>Tools-><u>L</u>ua Scripts</i></b> menu, +and re-initializes the GTK accelerator group (keybindings) associated with the plugin. +</p><br><br> + + +<a name="rowcol"></a><hr><h3><tt>geany.rowcol ( [position]|[line,column] )</tt></h3><p> +This function translates between line/column coordinates and linear position (offset from beginning of document).<br> +</p> +<p>The syntax takes three forms:</p> +<ul> +<li> +With <i>no</i> arguments, it returns the rectangular coordinates of the current caret position:<br> +<tt> line, column = geany.rowcol()</tt><br> +( Note that in Lua a single function call like the one above returns both values! )<br><br> +</li> +<li> +With <i>one</i> argument, it it returns the rectangular coordinates of the specified <tt><b>position</b></tt> +argument:<br> +<tt> line, column = geany.rowcol(position)</tt><br><br> +</li> + +<li> +With <i>two</i> arguments, it translates from the given <tt><b>line</b></tt> and <tt><b>column</b></tt> +to the linear position:<br> +<tt> position = geany.rowcol(line,column)</tt> +</li> +</ul> +<p> +Out-of-range arguments are adjusted to the nearest valid possibility. +</p><br><br> + +<a name="save"></a><hr><h3><tt>geany.save ( [filename]|[index] )</tt></h3><p> +When called with no arguments, saves the currently active document to disk. +</p><p> +When called with a numeric argument, saves the file of that document index. +</p><p> +When called with a string argument, it will save that named document ( That is, of course, if it is open. ) +</p> +<p> +Returns <tt><b>true</b></tt> on success, or <tt><b>false</b></tt> if the document could not be saved.</p> +<br><br> + + +<a name="scintilla"></a><hr><h3><tt>geany.scintilla ( msg_id [, wparam [, lparam]] )</tt></h3><p> +<i>Power users only!</i> +</p> +<p> +Sends a <tt><b>SCI_*</b></tt> message directly to the Scintilla widget of the active document.</p> +<p> +The <tt><b>msg_id</b></tt> can be a numeric value, or a case-insensitive string with or +without the <tt>"SCI_"</tt> prefix, +such as <tt>"SCI_POSITIONFROMPOINT"</tt>, <tt>"POSITIONFROMPOINT"</tt>, or <tt>"PositionFromPoint"</tt>. +</p><p> +The wparam, lparam, and return types depend on the particular message, based on the +interface described in the "<tt><small>Scintilla.iface</small></tt>" file from the Scintilla sources. +</p><p> +For API calls which expect a pre-allocated char buffer as the lparam, the allocation is +automatically managed +by the GeanyLua module, your lparam is ignored, and the return value is a Lua string. +In cases where the length is specified +in the wparam, the null terminator is not counted - if you ask for 3 chars, you get 3 chars. +</p><p> +Currently only string, numeric, and boolean types are supported, any API call that +expects or returns complex types will result in an error. This function tries hard to +protect from garbage being passed to +Scintilla, but ultimately <i>you</i> are expected to know what you're doing! +</p><br><br> + +<a name="select"></a><hr><h3><tt>geany.select ( [[start,] stop]] )</tt></h3><p> +When called with no arguments, returns the beginning <b><i>and</i></b> ending points of +the current selection, in the form:<br> +<tt> + start, stop = geany.select() +</tt><br> +( Note that in Lua a single function call like the one above returns both values! )</p> +<p> +To find out if the selection is rectangular, test the +boolean variable <tt><b>geany.rectsel</b></tt> immediately after this call. +</p> +<p><br> +If this function is called with two arguments, it creates a new selection in +the current document. +<br> The selection is <i>anchored</i> at the <tt><b>start</b></tt> +position, and <i>extended</i> to the <tt><b>stop</b></tt> position.</p><p> +The boolean variable <tt><b>geany.rectsel</b></tt> can be set prior to this +call to control +whether this selection is created in normal or rectangular mode. +</p> +<p><br> +If called with one argument, the caret is moved to that position, but no selection is created,<br> +and any existing selection is lost. +</p> +<p> +<br> +Note that in all cases, the value of <tt><b>stop</b></tt> is considered to be +the end of the selection where the caret is located.</p><p> +So, if <tt><b>stop</b></tt> is less than <tt><b>start</b></tt>, the caret is postioned +at the <i>beginning</i> of the selection, <br>similar to a selection created by +dragging the mouse <i>backwards</i> in the document.</p> +<p> +<b>Hint:</b> To select the entire document, you can use: +<tt>geany.select( 0, geany.length() )</tt> +</p><br><br> + + +<a name="selection"></a><hr><h3><tt>geany.selection ( [content] )</tt></h3><p> +When called with no arguments, returns the selected text in the current Geany +document as a string. <br> +Returns the empty string if no text is selected, or <tt><b>nil</b></tt> +if there is no open document. +</p><p>When called with one argument, the selected text of the current document +will be replaced with the specified <tt>content</tt> +string.<br> +If no text is currently selected, the text will be inserted at the current +(caret) position. +</p><br><br> + +<a name="signal"></a><hr><h3><tt>geany.signal ( widget, signal )</tt></h3><p> +Emits a GTK signal to a given widget in the Geany user interface.</p><p> +The <tt>widget</tt> argument is a string identifying the widget by its Glade <tt><b>"id"</b></tt> attribute.<br> +The <tt>signal</tt> argument is a string identifying the signal to be emitted. +</p><p> +This function was primarily intended for activating Geany's builtin menu commands.<br> +For instance, to display the file open dialog you could do:<br> +<tt> geany.signal("menu_open1", "activate")</tt> +</p><p> +The function does not return a value, but may trigger an error message if the +widget name is not found or the signal name is not valid for the specified widget. + +Note that it is generally easier and more reliable to use the <tt>keycmd()</tt> function whenever possible. +</p><br><br> + +<a name="stat"></a><hr><h3><tt>geany.stat( filename [, lstat] )</tt></h3><p> +Returns a table providing some (limited) information about the specified file.<br> +If the information could not be obtained, the function returns <tt>nil</tt> plus an string describing the reason for failure. +</p> +<p> +If the file is a symbolic link, and the optional <tt>lstat</tt> argument is <tt>true</tt>, the +information is returned about the link itself, otherwise the table provides +information about the file that the link points to. +</p><p> +The returned table contains the following fields: +<table border="0" summary="stat table fields"> +<tr><td width="5%"></td><td><tt>size </tt></td><td> -- The size of the file, in bytes.</td></tr> +<tr><td width="5%"></td><td><tt>time </tt></td><td> -- Modification time, in seconds from the epoch.</td></tr> +<tr><td width="5%"></td><td><tt>type </tt></td><td> -- A single-character string that denotes the type of file (see below)</td></tr> +<tr><td width="5%"></td><td><tt>read </tt></td><td> -- <tt>true</tt> if the effective user can read from the file.</td></tr> +<tr><td width="5%"></td><td><tt>write</tt></td><td> -- <tt>true</tt> if the effective user can modify the file.</td></tr> +<tr><td width="5%"></td><td><tt>exec </tt></td><td> -- <tt>true</tt> if the effective user can execute the file.</td></tr> +</table> +<p><br> +The <tt>type</tt> field contains one of the following values: +<table border="0" summary="stat table type field values"> +<tr><td width="5%"></td><td><tt>"b" </tt></td><td> -- a block-oriented device.</td></tr> +<tr><td width="5%"></td><td><tt>"c" </tt></td><td> -- a character-special device.</td></tr> +<tr><td width="5%"></td><td><tt>"d" </tt></td><td> -- a directory.</td></tr> +<tr><td width="5%"></td><td><tt>"f" </tt></td><td> -- a FIFO or named pipe.</td></tr> +<tr><td width="5%"></td><td><tt>"l" </tt></td><td> -- a symbolic link.</td></tr> +<tr><td width="5%"></td><td><tt>"r" </tt></td><td> -- a regular file.</td></tr> +<tr><td width="5%"></td><td><tt>"s" </tt></td><td> -- a socket.</td></tr> +</table> +<p> +Note that this function does not support symbolic links or ACL permissions on MS-Windows. +</p><br><br> + + + +<a name="text"></a><hr><h3><tt>geany.text ( [content] )</tt></h3><p> +When called with no arguments, returns the entire text of the currently +active Geany document as a string.<br>( Returns <tt><b>nil</b></tt> +if there is no open document.) +</p><p> +When called with one argument, the entire text of the current +document is replaced with the specified <tt>content</tt> string. +</p><br><br> + + +<a name="timeout"></a><hr><h3><tt>geany.timeout ( seconds )</tt></h3><p> + +Attempts to control the maximum time allowed, in whole seconds, for the current script to +finish execution.</p><p> +By default, scripts are allowed 15 seconds to complete, but if your script needs +more time, you can increase it here. +</p><p> +Note that the interpreter is only able to trigger this "timeout exceeded" error when it is actually processing instructions. +This provides protection against things like accidentally creating an endless loop, +but it might still be possible to create a script that hangs indefinitely. ( For instance if +you call <tt>io.read()</tt> without access to a terminal. )</p><p> +The internal timer is paused whenever one of the dialog box functions is called, +to allow the user time to respond. +</p><p> +Setting the timeout to zero will disable it completely, that is, the script will never time out. +</p><p><br><br> + +<a name="wkdir"></a><hr><h3><tt>geany.wkdir ( [folder] )</tt></h3><p> +When called with no arguments, returns the current working directory.</p> +<p> +When called with one argument, tries to change into that <tt>folder</tt>, +and returns <tt>true</tt> on sucess, or <tt>false</tt> plus an error message +on failure. +</p><br><br> + +<a name="word"></a><hr><h3><tt>geany.word ( [position] )</tt></h3><p> +When called with no arguments, returns the word at the current caret position. +</p><p> +When called with one argument, returns the word at the specified +<tt><b>position</b></tt>. +</p><p> +This function can return an empty string if the position is not touching +a character that is considered to be part of a word. You can modify this +set of characters in the <tt><b>geany.wordchars</b></tt> variable. +</p><br><br> + + +<a name="xsel"></a><hr><h3><tt>geany.xsel ( [text] )</tt></h3><p> +When called with no arguments, returns the text-based contents of the primary X selection. +</p><p> +When called with one argument, assigns that <tt>text</tt> as the contents of the primary X selection. + +</p><p> +This function is only valid for X-Window environments, on MS-Windows, it does nothing. +</p><br><br> + +<a name="yield"></a><hr><h3><tt>geany.yield ()</tt></h3><p> +Temporarily returns control to the IDE, to allow user interface elements to +be refreshed/repainted during lengthy script operations. +</p><p>Since most scripts will probably have a run time of less than a couple of seconds, +you will likely never need this function. But if you do, it should be used with caution, +since it allows Geany's state to be changed during script execution. This could have +unpleasant consequences, for instance if the user closes a document that the script is referencing. +</p> +<br><br> +<br><br> +<hr><hr> + +<!-- Dialog functions --> +<h3> Dialog functions</h3> +<hr> + +<a name="choose"></a><hr><h3><tt>geany.choose ( prompt, items )</tt></h3><p> +Displays a dialog box to allow the user to choose from a list of items. </p><p> +The <tt>prompt</tt> argument string will display a message above the list box +to explain the request.</p><p> +The <tt>items</tt> argument is a Lua table, each element of the table must be +a string. +</p><p> +The function returns the selected item as a string:</p> +<ul> +<li>If the <b>OK</b> button is clicked, +<li>If the [Return] key is pressed while the item list is active. +<li>If the user double-clicks an item in the list. +</ul> +<p> +If the <b>Cancel</b> button is clicked, or if the dialog is is dismissed by +some other means, e.g. by pressing the [Escape] key, the function returns +<tt><b>nil</b></tt>. +</p><br><br> + + +<a name="confirm"></a><hr><h3><tt>geany.confirm ( title, question, default )</tt></h3><p> + Displays a simple yes-or-no style dialog box to ask the specified + <tt>question</tt>.<br> + The <tt>title</tt> argument is displayed as a bold-faced title for the dialog. + </p><p> + Returns <tt><b>true</b></tt> if the 'Yes' button is clicked, + or <tt><b>false</b></tt> if the 'No' button is + clicked.</p><p> + If the dialog is dismissed by some other means, e.g. by pressing the + [Escape] key, <br>the function will return the boolean value specified by the + <tt>default</tt> argument. </p> + <p>All three arguments are required, but you can pass <tt><b>nil</b></tt> + as the first argument to suppress the title. +</p><br><br> + + +<a name="input"></a><hr><h3><tt>geany.input ( [prompt] [,default] )</tt></h3><p> +Displays an input dialog to prompt the user for some text. </p><p> +The <tt>prompt</tt> argument string will display a message above the entry box +to explain what input is requested.</p><p> +The <tt>default</tt> argument string, if present, will add some pre-selected +text into the entry area.</p><p> +If the <b>OK</b> button is clicked, or if the [Return] key is pressed while the +entry field is active, the function will return the contents of the entry field + as a string.</p><p> +If the <b>Cancel</b> button is clicked, or if the dialog is is dismissed by +some other means, e.g. by pressing the + [Escape] key, the function returns <tt><b>nil</b></tt>. +</p><br><br> + + +<a name="message"></a><hr><h3><tt>geany.message ( [title,] message )</tt></h3><p> +When called with one argument, displays a simple dialog box containing +the specified <tt>message</tt> string. </p> +<p>When called with two arguments, the <tt>title</tt> argument is displayed as +a bold-faced title, +and the <tt>message</tt> argument will be the message text. +</p><br><br> +<hr> + +<a name="pickfile"></a><hr><h3><tt>geany.pickfile ( [mode [,path [,filter]]] )</tt></h3> +<p> +Displays a dialog that allows the user to select a filename.</p><p> +All three arguments are optional, but you can pass <tt>nil</tt> as a placeholder to +use the default value for any of the arguments.</p><p> +The <tt>mode</tt> argument specifies the type of dialog, and must be one +of two strings, either <tt>"open"</tt> or <tt>"save"</tt>.<br> +( passing <tt>nil</tt> is the same as <tt>"open"</tt> )<br> +In <tt>"save"</tt> mode the function will issue an overwrite confirmation prompt if the targeted file already exists. +</p><p> +The <tt>path</tt> string argument sets the initial directory for the dialog, or <tt>nil</tt> +to use the current directory.<br> +If the last (rightmost) element of the path is an existing directory, the path will be used as-is, +otherwise the last element is assumed to be a filename (whether it actually exists on disk or not) +and will be parsed off and used as the suggested filename for the dialog. +</p><p> +The <tt>filter</tt> argument controls which files are displayed, +or it can be <tt>nil</tt> to display all files.<br> +It is a string consisting of pairs of substrings, where each substring +is separated by the pipe "<tt>|</tt>" symbol.<br> +The first element in each pair of substrings is the human-readable description of the filetype,<br> +and the second element of the +pair is a set of semicolon-delimited shell wildcards to filter on.<br> +For instance, a filter for web files might look like:<br> +<tt><b> "HTML files|*.html;*.htm|PHP files|*.php;*.php4|Style sheets|*.css"</b></tt> +<br> +( Those familiar with +<a href="http://en.wikipedia.org/wiki/Borland_Delphi">Borland Delphi</a> + might recognize this syntax from the + <a href="http://www.delphibasics.co.uk/RTL.asp?Name=TOpenDialog">TOpenDialog.Filter</a> property. ) +</p> +<p><br> +Note that this function does not actually open or save anything, it merely returns the +full path and filename of the selected file, or <tt>nil</tt> if the user cancels the dialog.</p> +<br><br> +<hr> +<hr> +<h3>Module level variables</h3> +<hr> +<a name="wordchars"></a><hr><h3><tt>geany.wordchars</tt></h3><p> +This variable determines which characters are considered to be part of a word. +</p><p> +It is used by the <tt><b>geany.word()</b></tt> function and may also be reset by that +function if its current value cannot be interpreted as a string.</p><p> +The default value is:<br><tt> + <big> <big> +"_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"</big> </big></tt> +<p> +If you need to modify this string, you may want to save a copy of the original +so you can restore it later. +</p><br><br> + +<a name="rectsel"></a><hr><h3><tt>geany.rectsel</tt></h3><p> +This variable controls and/or returns the "selection mode" of the current document. +</p><p> +It is used by the <tt><b>geany.select()</b></tt> function and is adjusted +when the selection is queried, and examined when the selection is set. <br> +It may also be reset if its current value cannot be interpreted as a boolean.</p> +<p> +A value of <tt><b>true</b></tt> represents a rectangular selection +and <tt><b>false</b></tt> represents the normal linear selection mode. +</p><br><br> + +<a name="banner"></a><hr><h3><tt>geany.banner</tt></h3><p> +This variable controls the window title for dialogs displayed by the current script. +</p><p> +It may be reset by the dialog functions if its value cannot be interpreted as a string. +</p><br><br> + + +<a name="caller"></a><hr><h3><tt>geany.caller</tt></h3><p> +This variable stores the internal index of the document that triggered one of the <a href="./geanylua-intro.html#events">event scripts</a>.</p> +<p> +For example, to print the filename of a file that has just been saved, you could put<br> +this line in your <b>~/.geany/plugins/lua/events/saved.lua</b> script file:</p><p> +<tt> print(geany.documents(geany.caller))</tt> +</p><p> + + + + +This variable is only relevant for the opened, created, activated, and saved event scripts, +for all other scripts it is set to zero.<br> + +</p><br><br> + +<a name="dirsep"></a><hr><h3><tt>geany.dirsep</tt></h3><p> +This variable returns the default filesystem path separator.<br> +( A forward slash <tt><b>/</b></tt> for Unix or + a backslash <tt><b></b></tt> for MS-Windows. ) +</p><br><br> + + +<a name="project"></a><hr><h3><tt>geany.project</tt></h3><p> +This variable provides a reference to the <a href="geanylua-keyfile.html">GKeyFile</a> object +for the project that triggered a + proj-* <a href="./geanylua-intro.html#events">event script</a>.</p> +<p> +The information stored in the object can be manipulated using the <tt>keyfile</tt> module.<br> +For example, to print the description of the project that has just been opened, you could put<br> +this line in your <b>~/.geany/plugins/lua/events/proj-opened.lua</b> script file:</p><p> +<tt> print(keyfile.value(geany.project, "project", "description"))</tt> +</p><p> +This variable is only relevant for the project-based event scripts, for all other scripts it is set to <tt>nil</tt>.<br> + +</p><br><br> + + +<a name="script"></a><hr><h3><tt>geany.script</tt></h3><p> +This variable stores the full path and filename of the active script.</p> +<br><br> +<hr> +<br><br> +<div align="right"><small>© 2007-2008 <i>Jeff Pohlmeyer </i> </small></div> +<br><br> +<br><br><br><br> +<br><br><br><br> +<br><br><br><br> +<br><br><br><br> + +</body> +</html>
Added: www/staging/geanylua/luarefv51.html =================================================================== --- www/staging/geanylua/luarefv51.html (rev 0) +++ www/staging/geanylua/luarefv51.html 2010-07-17 20:48:39 UTC (rev 1477) @@ -0,0 +1,3865 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> +<head> + <meta name="generator" content="HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org"> + <meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> + + <title>Lua 5.1 short reference</title> +<style type="text/css"> +<!-- + body + {margin-left:24px; + margin-bottom:120px; + width:75%} + p.MsoNormal + {margin-top:0cm; + margin-right:0cm; + margin-bottom:0cm; + margin-left:2.85pt; + margin-bottom:.0001pt; + font-size:8.0pt; + font-family:"Times New Roman";} +span.LuaCbold + {font-weight:bold;} +span.LuaCitalic + {font-style:italic;} +p.LuaPHeader2 + {margin-top:32px; + margin-right:0cm; + margin-bottom:8px; + margin-left:0cm; + text-indent:2.85pt; + page-break-after:avoid; + font-size:10.0pt; + font-family:Arial; + color:gray; + font-weight:bold; + font-style:italic;} +p.LuaPHeader1 + {margin-top:48px; + margin-right:4.25pt; + margin-bottom:8px; + margin-left:0px; + width:100%; + page-break-after:avoid; + background:#F3F3F3; + padding:8px; + font-size:12.0pt; + font-family:Arial; + color:gray; + letter-spacing:1.2pt; + font-weight:bold;} +table.LuaTTables + {width:100%;} +td + {padding:4px;} +a.IndexRef + {white-space:nowrap; + padding-right:8px; + text-decoration:none; + } +--> +</style> +</head> + +<body bgcolor="white" style="line-break:strict"> + <p class='LuaPHeader1'><span lang='EN-US'>Contents</span></p> + + <div style='width:100%;font-size:12.0pt;font-weight:bold;text-align:center;line-height: 200%;'> + <p><a class="IndexRef" href="#The_Lua_language">· The Lua language ·</a> <a class="IndexRef" href="#The_base_library">· The base library ·</a> <a class="IndexRef" href="#Modules_and_the_package_library">· Modules and + the package library ·</a> <a class="IndexRef" href="#The_coroutine_library">· The coroutine library ·</a> <a class="IndexRef" href="#The_table_library">· The table library ·</a> <a class="IndexRef" href= + "#The_mathematical_library">· The mathematical library ·</a> <a class="IndexRef" href="#The_string_library">· The string library ·</a> <a class="IndexRef" href="#The_I_O_library">· The I/O library ·</a> + <a class="IndexRef" href="#The_operating_system_library">· The operating system library ·</a> <a class="IndexRef" href="#The_debug_library">· The debug library ·</a> <a class="IndexRef" href= + "#The_stand_alone_interpreter">· The stand-alone interpreter ·</a> <a class="IndexRef" href="#The_compiler">· The compiler ·</a></p> + </div> + + <p class="LuaPHeader1"><a name="The_Lua_language" id="The_Lua_language"><span lang="EN-US">The Lua language (v5.1)</span></a></p> + + <p class="LuaPHeader2"><span lang="EN-US" style="font-size: 9.0pt;font-family:Symbol;font-weight:normal;font-style:normal">· <span style='font:7.0pt "Times New Roman"'> </span></span> <span lang="EN-US">Reserved identifiers and + comments</span></p> + + <table class="LuaTTables" border="1" cellspacing="0" cellpadding="0" width="650" summary="?"> + <tr> + <td width="59" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">and</span></span></p> + </td> + + <td width="59" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">break</span></span></p> + </td> + + <td width="59" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">do</span></span></p> + </td> + + <td width="59" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">else</span></span></p> + </td> + + <td width="59" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">elseif</span></span></p> + </td> + + <td width="59" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">end</span></span></p> + </td> + + <td width="59" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">false</span></span></p> + </td> + + <td width="59" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">for</span></span></p> + </td> + + <td width="59" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">function</span></span></p> + </td> + + <td width="59" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">if</span></span></p> + </td> + + <td width="59" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">in</span></span></p> + </td> + </tr> + + <tr> + <td width="59" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">local</span></span></p> + </td> + + <td width="59" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">nil</span></span></p> + </td> + + <td width="59" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">not</span></span></p> + </td> + + <td width="59" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">or</span></span></p> + </td> + + <td width="59" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">repeat</span></span></p> + </td> + + <td width="59" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">return</span></span></p> + </td> + + <td width="59" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">then</span></span></p> + </td> + + <td width="59" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">true</span></span></p> + </td> + + <td width="59" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">until</span></span></p> + </td> + + <td width="59" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">while</span></span></p> + </td> + + <td width="59" valign="top"> + <p class="MsoNormal"><b><span lang="EN-US"> </span></b></p> + </td> + </tr> + + <tr> + <td width="59" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">-- ...</span></span></p> + </td> + + <td width="236" colspan="4" valign="top"> + <p class="MsoNormal"><span lang="EN-US">comment to end of line</span></p> + </td> + + <td width="59" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">--[=[</span></span> <span lang="EN-US"> <span class="LuaCbold">]=]</span></span></p> + </td> + + <td width="295" colspan="5" valign="top"> + <p class="MsoNormal"><span lang="EN-US">multi line comment (zero or multiple '=' are valid)</span></p> + </td> + </tr> + + <tr> + <td width="295" colspan="5" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">_X</span></span> <span lang="EN-US">is "reserved" (by convention) for constants (with X being any sequence of uppercase letters)</span></p> + </td> + + <td width="59" valign="top"> + <p class="MsoNormal"><span lang="EN-US">#!</span></p> + </td> + + <td width="295" colspan="5" valign="top"> + <p class="MsoNormal"><span lang="EN-US">usual Unix shebang; Lua ignores whole first line if this starts the line.</span></p> + </td> + </tr> + </table> + + <p class="LuaPHeader2"><span lang="EN-US" style="font-size: 9.0pt;font-family:Symbol;font-weight:normal;font-style:normal">· <span style='font:7.0pt "Times New Roman"'> </span></span> <span lang="EN-US">Types (the string values are the + possible results of base library function type())</span></p> + + <table class="LuaTTables" border="1" cellspacing="0" cellpadding="0" summary="?"> + <tr> + <td width="81" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">"nil"</span></span></p> + </td> + + <td width="81" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">"boolean"</span></span></p> + </td> + + <td width="81" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">"number"</span></span></p> + </td> + + <td width="81" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">"string"</span></span></p> + </td> + + <td width="81" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">"table"</span></span></p> + </td> + + <td width="81" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">"function"</span></span></p> + </td> + + <td width="81" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">"thread"</span></span></p> + </td> + + <td width="81" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">"userdata"</span></span></p> + </td> + </tr> + </table> + + <p class="MsoNormal"><span lang="EN-GB">Note: for type boolean,</span> <span class="LuaCbold"><span lang="EN-US">nil</span></span> <span lang="EN-GB">and</span> <span class="LuaCbold"><span lang="EN-US">false</span></span> <span lang="EN-GB">count as + false; everything else is true (including 0 and "").</span></p> + + <p class="LuaPHeader2"><span lang="EN-US" style="font-size: 9.0pt;font-family:Symbol;font-weight:normal;font-style:normal">· <span style='font:7.0pt "Times New Roman"'> </span></span> <span lang="EN-US">Strings and escape + sequences</span></p> + + <table class="LuaTTables" border="1" cellspacing="0" cellpadding="0" summary="?"> + <tr> + <td width="95" colspan="2" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">'...'</span></span> <span lang="EN-US">and</span> <span class="LuaCbold"><span lang="EN-US">"..."</span></span></p> + </td> + + <td width="201" colspan="3" valign="top"> + <p class="MsoNormal"><span lang="EN-US">string delimiters; interpret escapes.</span></p> + </td> + + <td width="71" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">[=[...]=]</span></span></p> + </td> + + <td width="284" colspan="4" valign="top"> + <p class="MsoNormal"><span lang="EN-US">multi line strings; escape sequences are ignored.</span></p> + </td> + </tr> + + <tr> + <td width="93" valign="top"> + <p class="MsoNormal"><span lang="EN-US">\a bell</span></p> + </td> + + <td width="93" colspan="2" valign="top"> + <p class="MsoNormal"><span lang="EN-US">\b backspace</span></p> + </td> + + <td width="93" valign="top"> + <p class="MsoNormal"><span lang="EN-US">\f form feed</span></p> + </td> + + <td width="93" colspan="3" valign="top"> + <p class="MsoNormal"><span lang="EN-US">\n newline</span></p> + </td> + + <td width="93" valign="top"> + <p class="MsoNormal"><span lang="EN-US">\r return</span></p> + </td> + + <td width="93" valign="top"> + <p class="MsoNormal"><span lang="EN-US">\t horiz. tab</span></p> + </td> + + <td width="93" valign="top"> + <p class="MsoNormal"><span lang="EN-US">\v vert. tab</span></p> + </td> + </tr> + + <tr> + <td width="93" valign="top"> + <p class="MsoNormal"><span lang="EN-US">\ backslash</span></p> + </td> + + <td width="93" colspan="2" valign="top"> + <p class="MsoNormal"><span lang="EN-US">" d. quote</span></p> + </td> + + <td width="93" valign="top"> + <p class="MsoNormal"><span lang="EN-US">' quote</span></p> + </td> + + <td width="93" colspan="3" valign="top"> + <p class="MsoNormal"><span lang="EN-US">[ sq. bracket</span></p> + </td> + + <td width="93" valign="top"> + <p class="MsoNormal"><span lang="EN-US">] sq. bracket</span></p> + </td> + + <td width="93" valign="top"> + <p class="MsoNormal"><span lang="EN-US">\ddd decimal</span></p> + </td> + + <td width="93" valign="top"> + <p class="MsoNormal"><span lang="EN-US"> </span></p> + </td> + </tr> + </table> + + <p class="LuaPHeader2"><span lang="EN-US" style="font-size: 9.0pt;font-family:Symbol;font-weight:normal;font-style:normal">· <span style='font:7.0pt "Times New Roman"'> </span></span> <span lang="EN-US">Operators, decreasing + precedence</span></p> + + <table class="LuaTTables" border="1" cellspacing="0" cellpadding="0" summary="?"> + <tr> + <td width="650" colspan="6" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">^</span></span> <span lang="EN-US"> (right associative, math library required)</span></p> + </td> + </tr> + + <tr> + <td width="217" colspan="2" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">not</span></span></p> + </td> + + <td width="217" colspan="2" valign="top"> + <p class="MsoNormal"><span lang="EN-US"># (length of strings and tables)</span></p> + </td> + + <td width="217" colspan="2" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">-</span></span> <span lang="EN-US"> (unary)</span></p> + </td> + </tr> + + <tr> + <td width="217" colspan="2" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">*</span></span></p> + </td> + + <td width="217" colspan="2" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">/</span></span></p> + </td> + + <td width="217" colspan="2" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">%</span></span></p> + </td> + </tr> + + <tr> + <td width="325" colspan="3" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">+</span></span></p> + </td> + + <td width="325" colspan="3" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">-</span></span></p> + </td> + </tr> + + <tr> + <td width="650" colspan="6" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">..</span></span> <span lang="EN-US"> (string concatenation, right associative)</span></p> + </td> + </tr> + + <tr> + <td width="108" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US"><</span></span></p> + </td> + + <td width="108" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">></span></span></p> + </td> + + <td width="108" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US"><=</span></span></p> + </td> + + <td width="108" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">>=</span></span></p> + </td> + + <td width="108" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">~=</span></span></p> + </td> + + <td width="108" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">==</span></span></p> + </td> + </tr> + + <tr> + <td width="650" colspan="6" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">and</span></span> <span lang="EN-US"> (stops on <span class="LuaCbold">false</span> or <span class="LuaCbold">nil</span> , returns last evaluated value)</span></p> + </td> + </tr> + + <tr> + <td width="650" colspan="6" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">or</span></span> <span lang="EN-US"> (stops on <span class="LuaCbold">true</span> (not <span class="LuaCbold">false</span> or <span class="LuaCbold">nil</span> ), returns last + evaluated value)</span></p> + </td> + </tr> + </table> + + <p class="LuaPHeader2"><span lang="EN-US" style="font-size: 9.0pt;font-family:Symbol;font-weight:normal;font-style:normal">· <span style='font:7.0pt "Times New Roman"'> </span></span> <span lang="EN-US">Assignment and + coercion</span></p> + + <table class="LuaTTables" border="1" cellspacing="0" cellpadding="0" summary="?"> + <tr> + <td width="142" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">a = 5 b= "hi"</span></span></p> + + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">local a = a</span></span></p> + </td> + + <td width="508" valign="top"> + <p class="MsoNormal"><span lang="EN-US">simple assignment; variables are not typed and can hold different types. Local variables are lexically scoped; their scope begins after the full declaration (so that local <span class="LuaCbold">a</span> = + 5).</span></p> + </td> + </tr> + + <tr> + <td width="142" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">a, b, c = 1, 2, 3</span></span></p> + </td> + + <td width="508" valign="top"> + <p class="MsoNormal"><span lang="EN-US">multiple assignments are supported</span></p> + </td> + </tr> + + <tr> + <td width="142" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">a, b = b, a</span></span></p> + </td> + + <td width="508" valign="top"> + <p class="MsoNormal"><span lang="EN-US">swap values: right hand side is evaluated before assignment takes place</span></p> + </td> + </tr> + + <tr> + <td width="142" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">a, b = 4, 5, "6"</span></span></p> + </td> + + <td width="508" valign="top"> + <p class="MsoNormal"><span lang="EN-US">excess values on right hand side ("6") are evaluated but discarded</span></p> + </td> + </tr> + + <tr> + <td width="142" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">a, b = "there"</span></span></p> + </td> + + <td width="508" valign="top"> + <p class="MsoNormal"><span lang="EN-US">for missing values</span> <span lang="EN-US">on right hand side <span class="LuaCbold">nil</span> is assumed</span></p> + </td> + </tr> + + <tr> + <td width="142" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">a = nil</span></span></p> + </td> + + <td width="508" valign="top"> + <p class="MsoNormal"><span lang="EN-US">destroys <span class="LuaCbold">a</span> ; its contents are eligible for garbage collection if unreferenced.</span></p> + </td> + </tr> + + <tr> + <td width="142" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">a = z</span></span></p> + </td> + + <td width="508" valign="top"> + <p class="MsoNormal"><span lang="EN-US">if <span class="LuaCbold">z</span> is not defined it is <span class="LuaCbold">nil</span> , so <span class="LuaCbold">nil</span> is assigned to <span class="LuaCbold">a</span> (destroying it)</span></p> + </td> + </tr> + + <tr> + <td width="142" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">a = "3" + "2"</span></span></p> + </td> + + <td width="508" valign="top"> + <p class="MsoNormal"><span lang="EN-US">numbers expected, strings are converted to numbers (a = 5)</span></p> + </td> + </tr> + + <tr> + <td width="142" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">a = 3 .. 2</span></span></p> + </td> + + <td width="508" valign="top"> + <p class="MsoNormal"><span lang="EN-US">strings expected, numbers are converted to strings (a = "32")</span></p> + </td> + </tr> + </table> + + <p class="LuaPHeader2"><span lang="EN-US" style="font-size: 9.0pt;font-family:Symbol;font-weight:normal;font-style:normal">· <span style='font:7.0pt "Times New Roman"'> </span></span> <span lang="EN-US">Control structures</span></p> + + <table class="LuaTTables" border="1" cellspacing="0" cellpadding="0" summary="?"> + <tr> + <td width="331" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">do</span></span> <span class="LuaCitalic"><span lang="EN-US">block</span></span> <span class="LuaCbold"><span lang="EN-US">end</span></span></p> + </td> + + <td width="319" valign="top"> + <p class="MsoNormal"><span lang="EN-US">block; introduces local scope.</span></p> + </td> + </tr> + + <tr> + <td width="331" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">if</span></span> <span class="LuaCitalic"><span lang="EN-US">exp</span></span> <span class="LuaCbold"><span lang="EN-US">then</span></span> <span class="LuaCitalic"><span lang= + "EN-US">block</span></span> <span lang="EN-US">{ <span class="LuaCbold">elseif</span> <span class="LuaCitalic">exp</span> <span class="LuaCbold">then</span> <span class="LuaCitalic">block</span> } [ <span class="LuaCbold">else</span> <span class= + "LuaCitalic">block</span> ] <span class="LuaCbold">end</span></span></p> + </td> + + <td width="319" valign="top"> + <p class="MsoNormal"><span lang="EN-US">conditional execution</span></p> + </td> + </tr> + + <tr> + <td width="331" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">while</span></span> <span class="LuaCitalic"><span lang="EN-US">exp</span></span> <span class="LuaCbold"><span lang="EN-US">do</span></span> <span class="LuaCitalic"><span lang= + "EN-US">block</span></span> <span class="LuaCbold"><span lang="EN-US">end</span></span></p> + </td> + + <td width="319" valign="top"> + <p class="MsoNormal"><span lang="EN-US">loop as long as <span class="LuaCitalic">exp</span> is true</span></p> + </td> + </tr> + + <tr> + <td width="331" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">repeat</span></span> <span class="LuaCitalic"><span lang="EN-US">block</span></span> <span class="LuaCbold"><span lang="EN-US">until</span></span> <span class="LuaCitalic"><span lang= + "EN-US">exp</span></span></p> + </td> + + <td width="319" valign="top"> + <p class="MsoNormal"><span lang="EN-US">exits when <span class="LuaCitalic">exp</span> becomes true; <span class="LuaCitalic">exp</span> is in loop scope.</span></p> + </td> + </tr> + + <tr> + <td width="331" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">for</span></span> <span class="LuaCitalic"><span lang="EN-US">var</span></span> <span lang="EN-US">= <span class="LuaCitalic">start</span> <span class="LuaCbold">,</span> <span class= + "LuaCitalic">end</span> [ <span class="LuaCbold">,</span> <span class="LuaCitalic">step</span> ] <span class="LuaCbold">do</span> <span class="LuaCitalic">block</span> <span class="LuaCbold">end</span></span></p> + </td> + + <td width="319" valign="top"> + <p class="MsoNormal"><span lang="EN-US">numerical for loop; <span class="LuaCitalic">var</span> is local to loop.</span></p> + </td> + </tr> + + <tr> + <td width="331" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">for</span></span> <span class="LuaCitalic"><span lang="EN-US">vars</span></span> <span class="LuaCbold"><span lang="EN-US">in</span></span> <span class="LuaCitalic"><span lang= + "EN-US">iterator</span></span> <span class="LuaCbold"><span lang="EN-US">do</span></span> <span class="LuaCitalic"><span lang="EN-US">block</span></span> <span class="LuaCbold"><span lang="EN-US">end</span></span></p> + </td> + + <td width="319" valign="top"> + <p class="MsoNormal"><span lang="EN-US">iterator based for loop; <span class="LuaCitalic">vars</span> are local to loop.</span></p> + </td> + </tr> + + <tr> + <td width="331" valign="top"> + <p class="MsoNormal"><span class="LuaCbold"><span lang="EN-US">break</span></span></p> + </td> + + <td width="319" valign="top"> + <p class="MsoNormal"><span lang="EN-US">exits loop; must be last statement in block.</span></p> + </td> + </tr> + </table> + + <p class="LuaPHeader2"><span lang="EN-US" style="font-size: 9.0pt;font-family:Symbol;font-weight:normal;font-style:normal">· <span style='font:7.0pt "Times New Roman"'> </span></span> <span lang="EN-US">Table constructors</span></p> + + <table class="LuaTTables" border="1" cellspacing="0" cellpadding="0" summary="?"> + <tr>
@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
plugins-commits@lists.geany.org