Skip to content

Commit

Permalink
Merge pull request #653 from Skif-off/geanylua-reloadconf
Browse files Browse the repository at this point in the history
GeanyLua: Add function geany.reloadconf()
  • Loading branch information
frlan committed Jan 28, 2018
2 parents f812c60 + c59952d commit 7039620
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 18 deletions.
27 changes: 24 additions & 3 deletions geanylua/docs/geanylua-ref.html
Expand Up @@ -267,18 +267,22 @@
<td class="desc">-- Run a script without the debug hook.</td>
</tr>
<tr class="odd">
<td>&nbsp; function <a href="#reloadconf"><b>reloadconf</b></a> ()<br></td>
<td class="desc">-- Reload Configuration.</td>
</tr>
<tr class="even">
<td>&nbsp; function <a href="#rescan"><b>rescan</b></a> ()<br></td>
<td class="desc">-- Regenerate the scripts menu.</td>
</tr>
<tr class="even">
<tr class="odd">
<td>&nbsp; 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">
<tr class="even">
<td>&nbsp; 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">
<tr class="odd">
<td>&nbsp; function <a href="#wkdir"><b>wkdir</b></a> ( [folder] )<br></td>
<td class="desc">-- Get or set the current working directory.</td>
</tr>
Expand Down Expand Up @@ -816,6 +820,23 @@
<br><br>


<a name="reloadconf"></a><hr><h3><tt>geany.reloadconf ()</tt></h3>
<p>This function will cause Geany to reload most of it's configuration files without restarting
(as menu item <b><i>Tools-><u>R</u>eload Configuration</i></b>).</p>
<!-- The list was copied from https://geanypy.readthedocs.io/en/latest/api.html#geany.reload_configuration -->
<p>Currently the following files are reloaded:</p>
<ul>
<li>all template files;</li>
<li>new file templates;</li>
<li>the New (with template) menus will be updated;</li>
<li>Snippets (snippets.conf);</li>
<li>filetype extensions (filetype_extensions.conf);</li>
<li><i>setting</i>s and <i>build_settings</i> sections of the filetype definition files.</li>
</ul>
<p>This function which can be used if you updated one of these configuration files, or modified or added template files.</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.
Expand Down
36 changes: 22 additions & 14 deletions geanylua/glspi_app.c
Expand Up @@ -604,22 +604,30 @@ static gint glspi_keygrab(lua_State* L)
}


static gint glspi_reloadconf(lua_State* L)
{
main_reload_configuration();
return 0;
}



static const struct luaL_reg glspi_app_funcs[] = {
{"pluginver", glspi_pluginver},
{"appinfo", glspi_appinfo},
{"xsel", glspi_xsel},
{"signal", glspi_signal},
{"stat", glspi_stat},
{"status", glspi_status},
{"basename", glspi_basename},
{"dirname", glspi_dirname},
{"fullpath", glspi_fullpath},
{"dirlist", glspi_dirlist},
{"wkdir", glspi_wkdir},
{"keycmd", glspi_keycmd},
{"launch", glspi_launch},
{"keygrab", glspi_keygrab},
{"pluginver", glspi_pluginver},
{"appinfo", glspi_appinfo},
{"xsel", glspi_xsel},
{"signal", glspi_signal},
{"stat", glspi_stat},
{"status", glspi_status},
{"basename", glspi_basename},
{"dirname", glspi_dirname},
{"fullpath", glspi_fullpath},
{"dirlist", glspi_dirlist},
{"wkdir", glspi_wkdir},
{"keycmd", glspi_keycmd},
{"launch", glspi_launch},
{"keygrab", glspi_keygrab},
{"reloadconf", glspi_reloadconf},
{NULL,NULL}
};

Expand Down
2 changes: 1 addition & 1 deletion geanylua/keywords.list
Expand Up @@ -7,4 +7,4 @@
word5=0xf0a000;0xffffff;false;false

## Put this in the [keywords] section:
user1=geany.activate geany.appinfo geany.banner geany.basename geany.batch geany.byte geany.caller geany.caret geany.choose geany.close geany.confirm geany.copy geany.count geany.cut geany.dirlist geany.dirname geany.dirsep geany.documents geany.fileinfo geany.filename geany.find geany.fullpath geany.height geany.input geany.keycmd geany.keygrab geany.launch geany.length geany.lines geany.match geany.message geany.navigate geany.newfile geany.open geany.optimize geany.paste geany.pickfile geany.pluginver geany.rectsel geany.rescan geany.rowcol geany.save geany.scintilla geany.script geany.select geany.selection geany.signal geany.stat geany.status geany.text geany.timeout geany.wkdir geany.word geany.wordchars geany.xsel geany.yield dialog.checkbox dialog.color dialog.file dialog.font dialog.group dialog.heading dialog.hr dialog.label dialog.new dialog.option dialog.password dialog.radio dialog.run dialog.select dialog.text dialog.textarea keyfile.comment keyfile.data keyfile.groups keyfile.has keyfile.keys keyfile.new keyfile.remove keyfile.value
user1=geany.activate geany.appinfo geany.banner geany.basename geany.batch geany.byte geany.caller geany.caret geany.choose geany.close geany.confirm geany.copy geany.count geany.cut geany.dirlist geany.dirname geany.dirsep geany.documents geany.fileinfo geany.filename geany.find geany.fullpath geany.height geany.input geany.keycmd geany.keygrab geany.launch geany.length geany.lines geany.match geany.message geany.navigate geany.newfile geany.open geany.optimize geany.paste geany.pickfile geany.pluginver geany.rectsel geany.reloadconf geany.rescan geany.rowcol geany.save geany.scintilla geany.script geany.select geany.selection geany.signal geany.stat geany.status geany.text geany.timeout geany.wkdir geany.word geany.wordchars geany.xsel geany.yield dialog.checkbox dialog.color dialog.file dialog.font dialog.group dialog.heading dialog.hr dialog.label dialog.new dialog.option dialog.password dialog.radio dialog.run dialog.select dialog.text dialog.textarea keyfile.comment keyfile.data keyfile.groups keyfile.has keyfile.keys keyfile.new keyfile.remove keyfile.value

0 comments on commit 7039620

Please sign in to comment.