Hi. I'm Tony Rick, and I hit the wrong list for requesting the 'help' response the first time.
I'm in Portland Oregon, where a lot of programmers like me are 'at liberty' and looking for things to do. I'm currently helping teach a Beginning C Programming class at a local computer hardware recycling non-profit organization, FreeGeek. (Maybe you've heard of it, http://www.freegeek.org if not). The class is using Geany v0.14 on Debian Lenny, which will update to 0.17 with a backports repository enabled. One of the questions that came up in class was about the GPL license in the header being a visual irritant. I explained briefly about editing templates, but having them updated requires a Geany restart in that version. I scanned the mailing list archives and features list and template management issues have been raised before.
One of the features requests (2925273, from arquebus), requested a templates file selection item in the Tools menu. I thought I might start there. I haven't figured out yet what the criteria are for deciding what should be psrt of the core and what should be a plugin. I also discovered that custom templates do not appear automatically when saved. The Documentation indicates that this requires a Geany restart also, but the 'Reload Configuration' tool does indeed add them. I'm not sure whether this is a bug (templates and related menus should be updated when files are modified, like configuration files), or a serendipitous feature that simply 'came along with' Reload Configuration, or should be mentioned in the Templates section of the documentation (which it currently does not, IIRC).
My original thought was to use GIO and monitor the templates directory for changes, but I saw several posts about problems with GIO and detecting remote file changes and the use of the GIO compiler conditional, and so assumed that the Reload Configuration method had been chosen as an interrim solution, and that GIO file change detection was on hold until the remote file issue had been resolved.
- tony
Hi,
I am assuming that you are talking about file templates.
On 19 February 2010 06:58, Tony Rick tonyr@hevanet.com wrote:
Hi. I'm Tony Rick, and I hit the wrong list for requesting the 'help' response the first time.
I'm in Portland Oregon, where a lot of programmers like me are 'at liberty' and looking for things to do. I'm currently helping teach a Beginning C Programming class at a local computer hardware recycling non-profit organization, FreeGeek. (Maybe you've heard of it, http://www.freegeek.org if not). The class is using Geany v0.14 on Debian Lenny, which will update to 0.17 with a backports repository enabled. One of the questions that came up in class was about the GPL license in the header being a visual irritant. I explained briefly about editing templates,
Hope you mentioned about not removing them from existing code :-)
but having them updated requires a Geany restart in that version. I scanned the mailing list archives and features list and template management issues have been raised before.
AFAIK the directories are only scanned & the menu created at startup, so thats why restart is needed. Because its only needed if you add or remove a template, not when editing an existing one, no one has been irritated enough to do anything about it :-)
One of the features requests (2925273, from arquebus), requested a templates file selection item in the Tools menu. I thought I might start there. I haven't figured out yet what the criteria are for deciding what should be psrt of the core and what should be a plugin. I also discovered that custom templates do not appear automatically when saved. The Documentation indicates that this requires a Geany restart also, but the 'Reload Configuration' tool does indeed add them. I'm not sure whether this is a bug (templates and related menus should be updated when files are modified, like configuration files), or a serendipitous feature that simply 'came along with' Reload Configuration, or should be mentioned in the Templates section of the documentation (which it currently does not, IIRC).
I suggest that the simplest start point would be to add a re-scan menu item to the templates menu itself. It would just need to destroy and re-create the menu. As I said its not needed very often so the effort for automatic update probably isn't worth it.
My original thought was to use GIO and monitor the templates directory for changes, but I saw several posts about problems with GIO and detecting remote file changes and the use of the GIO compiler conditional, and so assumed that the Reload Configuration method had been chosen as an interrim solution, and that GIO file change detection was on hold until the remote file issue had been resolved.
- tony
Cheers Lex
Geany-devel mailing list Geany-devel@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
On 02/18/2010 02:15 PM, Lex Trotman wrote:
Hi,
I am assuming that you are talking about file templates.
You assume correctly. ...
AFAIK the directories are only scanned & the menu created at startup, so thats why restart is needed. Because its only needed if you add or remove a template, not when editing an existing one, no one has been irritated enough to do anything about it :-)
(see below) ...
I suggest that the simplest start point would be to add a re-scan menu item to the templates menu itself. It would just need to destroy and re-create the menu. As I said its not needed very often so the effort for automatic update probably isn't worth it.
Already exists, to wit:
In v0.17 and v0.18, the template file list available in 'File->New (with Template)' is updated by when Tools->Reload Configuration is selected. The same is true for modified existing template files. Geany does not need to be restarted to update the menus and re-populate the internal templates list. The documentation does not reflect this new behavior, and in fact still says that Geany must be restarted to become aware of new custom templates. It just ain't so. (I'm looking at revision 4674, v0.17 source, and v0.18 source; revision 4674 seems leaner and cleaner.)
The feature request, if I interpret it correctly, was for a new menu under Tools that listed all template files so that they could be selected for editing, rather than climbing down through the directory browser to find them. That is what I was proposing to work on.
- tony
On 19 February 2010 16:51, Tony Rick tonyr@hevanet.com wrote:
On 02/18/2010 02:15 PM, Lex Trotman wrote:
Hi,
I am assuming that you are talking about file templates.
You assume correctly.
...
AFAIK the directories are only scanned & the menu created at startup, so thats why restart is needed. Because its only needed if you add or remove a template, not when editing an existing one, no one has been irritated enough to do anything about it :-)
(see below)
...
I suggest that the simplest start point would be to add a re-scan menu item to the templates menu itself. It would just need to destroy and re-create the menu. As I said its not needed very often so the effort for automatic update probably isn't worth it.
Already exists, to wit:
In v0.17 and v0.18, the template file list available in 'File->New (with Template)' is updated by when Tools->Reload Configuration is selected. The same is true for modified existing template files. Geany does not need to be restarted to update the menus and re-populate the internal templates list. The documentation does not reflect this new behavior, and in fact still says that Geany must be restarted to become aware of new custom templates. It just ain't so. (I'm looking at revision 4674, v0.17 source, and v0.18 source; revision 4674 seems leaner and cleaner.)
You are right about that, I didn't look deep enough, and the manual in SVN still says restart needed, feel free to submit a patch to fix the manual, or even just some words in an email to this ml.
The feature request, if I interpret it correctly, was for a new menu under Tools that listed all template files so that they could be selected for editing, rather than climbing down through the directory browser to find them. That is what I was proposing to work on.
Looking at it again, yes I agree with your interpretation. Since the tools menu is often extended by plugins maybe the templates need to be a sub-menu rather than populating the top level tools menu with all the standard and (unknown number of) user defined templates. What do others think?
Cheers Lex
- tony
Geany-devel mailing list Geany-devel@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
Hi, all.
My name is Dimitar Zhekov (http://www.is-vn.bg/hamster), a computer programmer for the last 15 years, and I would like to add a plugin or two to Geany.
First, a plugin that inserts/replaces rectangular selection with integer numbers, using start, step etc. It's ready, but I wanted to ask: do you think that adding a mode to insert plain string a good idea? The vertical edit is good, but starts lagging after a few thousand lines, and UltraEdit/NPP have these functions combined IIRC.
-- E-gards: Jimmy
Hi Dimitar,
On Sat, 20 Feb 2010 12:38:06 +0300 Dimitar Zhekov hamster@mbox.contact.bg wrote:
It's ready, but I wanted to ask: do you think that adding a mode to insert plain string a good idea? The vertical edit is good, but starts lagging after a few thousand lines, and UltraEdit/NPP have these functions combined IIRC.
Can you please go into more detail, as I'm not sure waht this 'mode' is special for.
Thanks, Frank
On Sat, 20 Feb 2010 13:28:16 +0100 Frank Lanitz frank@frank.uvena.de wrote:
It's ready, but I wanted to ask: do you think that adding a mode to insert plain string a good idea? The vertical edit is good, but starts lagging after a few thousand lines, and UltraEdit/NPP have these functions combined IIRC.
Can you please go into more detail, as I'm not sure waht this 'mode' is special for.
Just an option to insert/replace the rectangle selection with a user-typed string instead of numbers. The result is the same as if you simply type the text in a rectangle selection, only faster for a large number of lines, and can be undone with a single undo. This duplicates existing functionality, so I'm not sure about putting it in the plugin.
-- E-gards: Jimmy
On Fri, 19 Feb 2010 17:49:14 +1100, Lex wrote:
I suggest that the simplest start point would be to add a re-scan menu item to the templates menu itself. It would just need to destroy and re-create the menu. As I said its not needed very often so the effort for automatic update probably isn't worth it.
Already exists, to wit:
In v0.17 and v0.18, the template file list available in 'File->New (with Template)' is updated by when Tools->Reload Configuration is selected. The same is true for modified existing template files. Geany does not need to be restarted to update the menus and re-populate the internal templates list. The documentation does not reflect this new behavior, and in fact still says that Geany must be restarted to become aware of new custom templates. It just ain't so. (I'm looking at revision 4674, v0.17 source, and v0.18 source; revision 4674 seems leaner and cleaner.)
You are right about that, I didn't look deep enough, and the manual in SVN still says restart needed, feel free to submit a patch to fix the manual, or even just some words in an email to this ml.
That would be much appreciated :)
The feature request, if I interpret it correctly, was for a new menu under Tools that listed all template files so that they could be selected for editing, rather than climbing down through the directory browser to find them. That is what I was proposing to work on.
Looking at it again, yes I agree with your interpretation. Since the tools menu is often extended by plugins maybe the templates need to be a sub-menu rather than populating the top level tools menu with all the standard and (unknown number of) user defined templates. What do others think?
I think that would be cool, IMO should be realised as a plugin (which we could ship with Geany itself, though this is another topic). I'd say it the plugin should add a submenu to Tools->Configuration Files or directly into the Tools menu, I don't mind much.
Regards, Enrico
On Sun, 21 Feb 2010 15:26:23 +0100, Enrico wrote:
On Fri, 19 Feb 2010 17:49:14 +1100, Lex wrote:
I suggest that the simplest start point would be to add a re-scan menu item to the templates menu itself. It would just need to destroy and re-create the menu. As I said its not needed very often so the effort for automatic update probably isn't worth it.
Already exists, to wit:
In v0.17 and v0.18, the template file list available in 'File->New (with Template)' is updated by when Tools->Reload Configuration is selected. The same is true for modified existing template files. Geany does not need to be restarted to update the menus and re-populate the internal templates list. The documentation does not reflect this new behavior, and in fact still says that Geany must be restarted to become aware of new custom templates. It just ain't so. (I'm looking at revision 4674, v0.17 source, and v0.18 source; revision 4674 seems leaner and cleaner.)
You are right about that, I didn't look deep enough, and the manual in SVN still says restart needed, feel free to submit a patch to fix the manual, or even just some words in an email to this ml.
That would be much appreciated :)
Shame on me. I should read first all mails and then start replying. Thanks for your patch and Dominic for committing :).
Regards, Enrico
Hi,
On Sat, 20 Feb 2010 15:57:46 +0300 Dimitar Zhekov hamster@mbox.contact.bg wrote:
On Sat, 20 Feb 2010 13:28:16 +0100 Frank Lanitz frank@frank.uvena.de wrote:
It's ready, but I wanted to ask: do you think that adding a mode to insert plain string a good idea? The vertical edit is good, but starts lagging after a few thousand lines, and UltraEdit/NPP have these functions combined IIRC.
Can you please go into more detail, as I'm not sure waht this 'mode' is special for.
Just an option to insert/replace the rectangle selection with a user-typed string instead of numbers. The result is the same as if you simply type the text in a rectangle selection, only faster for a large number of lines, and can be undone with a single undo.
Sounds nice, even I don't have any valid usage for at the moment ;)
This duplicates existing functionality, so I'm not sure about putting it in the plugin.
The only plugin I think this is duplicating some feature is the shiftcolumn one. As this is some complete different plugin, I don't mind to start a complete new one.
Thanks, Frank
BTW: For doing the undo stuff you could use sci_start_undo_action () and sci_end_undo_action() from plugin API.
On Sun, 21 Feb 2010 20:58:14 +0100 Frank Lanitz frank@frank.uvena.de wrote:
This duplicates existing functionality, so I'm not sure about putting it in the plugin.
The only plugin I think this is duplicating some feature is the shiftcolumn one. As this is some complete different plugin, I don't mind to start a complete new one.
Perhaps I should have been more specific. If you mark a rectangle in Geany, without any plugins, and start typing, the characters will be inserted in each marked line. That's the function my plugin will duplicate if I add an option to insert/replace rectangular selection with a plain string.
BTW: For doing the undo stuff you could use sci_start_undo_action () and sci_end_undo_action() from plugin API.
I do; Geany's typing text into a vertical selection is undone character by character. The single start/end undo pair is what makes the plugin faster (well, and the single screen refresh too).
IMHO, it's time to change the subject, and mail the plugin's main .c file, so anyone interested can take a look and send remarks, suggestions etc. Thanks in advance.
-- E-gards: Jimmy
Hi, Sorry for the late reply (the thread subject wasn't too specific ;-))
On Sun, 21 Feb 2010 15:26:23 +0100 Enrico Tröger enrico.troeger@uvena.de wrote:
The feature request, if I interpret it correctly, was for a new menu under Tools that listed all template files so that they could be selected for editing, rather than climbing down through the directory browser to find them. That is what I was proposing to work on.
Looking at it again, yes I agree with your interpretation. Since the tools menu is often extended by plugins maybe the templates need to be a sub-menu rather than populating the top level tools menu with all the standard and (unknown number of) user defined templates. What do others think?
I think that would be cool, IMO should be realised as a plugin (which we could ship with Geany itself, though this is another topic). I'd say it the plugin should add a submenu to Tools->Configuration Files or directly into the Tools menu, I don't mind much.
I'm not sure if any work was started on this.
I've just made templates reload automatically when saving a document in the user template path.
I think for opening template files (and other config files e.g. filetypes) we could add a 'Tools->Configuration Files->Open' item that just shows a file dialog starting in the user config directory.
Showing submenus with items for each file is OK IMO, but the file dialog might be a simple solution and flexible.
Regards, Nick