[Geany] compile, build, run for custom filetype

spir denis.spir at xxxxx
Tue Feb 7 16:29:42 UTC 2012


On 02/06/2012 09:11 PM, Lex Trotman wrote:
> PS Note there is a wiki entry on configuring the build system at
> http://wiki.geany.org/howtos/configurebuildmenu


First, thank you and bravo for this wiki page on the topic. It is great 
and above all clear. Reading it not only helped but also launched a few 
comments to possibly still ameliorate the system on details, and a 2 
questions on remaining obscure points.
If ever I finally understand things well enough, I'll help and improve 
the wiki page. Also add one on settings for Go, and possibly a general 
one on how to introduce a new language (this badly lacks in geany doc).

*** Questions ***

* toolbar buttons?
The relation between the build menu config (either in files or via GUI) 
and toolbar is unclear for me. I guess --because it seems to work that 
way on my machine-- that
~ If ever, resulting from config, there are "Compile" & "Build" entries 
in the 1st section of the menu, then they map to matching buttons.
~ The Execute button's command is always set by the Execute line of the 
menu, meaning in config the first line of the fourth section.
If true, then I find that difficult to get. I tried both in files and 
through GUI to set an Execute command, like the Compile & Build ones, 
which doubled the predefined one without any effect. Conversely, why is 
there no predefined entries for the Compile & Build like for Execute? 
Sure, they do not apply to interpreted languages, but the entries could 
still be there, no?

* Relation between config files & GUI settings?
What happens to the config after changing settings on the GUI. They 
double the files' role. What kind of relation are there between GUI 
setting and config files, in both relations? Who wins? The page pointed 
above lists the "cascade" of config locations in files, but does not 
include the GUI settings. Conversely, what happens to the GUI settings 
after changing files?
I think we may do without these GUI that double and complicate the 
config system. Simply, the config files would as standard propose 
parameter lines equivalent to the present GUI, and the doc would state 
that it is recommended to stop there. ("With power comes responsability")

*** Comments ***

* Build Menu orga
It may be reorganised so that the 3 configurable sections (out of 5) 
come 1st, 2nd, 3rd. And --is it possible to have a bigger separation 
with the other 2 sections?

* No dealing with system config
The user ideally should not have to deal at all with system-general 
config files, which also deal as geany defaults IIUC.
Possible solution: In the latest versions, there are entries in the 
'Tools' menu to allow editing some config files directly in geany 
itself. One of this entries allows editing filetypes.common; if the user 
version does not yet exist (in the user config folder), it is then 
created by copy (from the system config folder). Add one entry to edit 
user filetype config files. Do the same as for filetypes.common. To 
select the filetype: (1) a submenu like for setting the filetype (2) a 
popup with a rolling list (3) a popup with a text field to type the 
(case-insensitive) filetype name.

* Easy config of new filetype
This would deal as recommended way to create a *new* filetype: open an 
existing one for edition in geany, save it at once as config file for 
the new filetype, edit it. There should be a standard one having the 
structure and entries with common sensible values, for cases when no 
appropriate model filetype exists (present filetypes.Geany.conf seems to 
be configured for Vala). Entries for which no sensible value exist 
should be present anyway, so that the user knows about them.

* No "filetypes.Lang.conf"
Filetype config files should all have the same naming pattern. For a new 
language, instead of filetypes.Lang.conf, why not just filetypes.lang? 
In addition, having the name capitalised only for new filetypes is a 
source of annoying issues.

* Filetype config file names
Better, also solve this: filetype config files are often edited in geany 
(else, other editors also have styling for common languages). Since the 
names of the config files end in the name of the languge, thjey are 
styled as if they were source code of this language, instead of just 
config files.
Solution: reverse the logic, or rather reset it as should be: lang.cfg 
instead of filetypes.lang.

* no tweaking of filetype_extensions.conf
Filetype extensions should be declared in the filetype config file. 
Actually, all the config for a filetype should be in a single file. I 
first thought there could be no filetype_extensions.conf at all, but 
this may force geany to read all filetype confg files at startup. 
Instead, there could a generated one, updated when filetype config files 
are edited in geany, or whenever geany detects a modif (by last edition 
time), or via the menu entry "Tools/Reload Configuration".

* config file doc
Comments in config files may be rewtritten (they have improved, but 
still..).
Some param names can be clearer. (Naming is doc.)

Denis




More information about the Users mailing list