Hi everybody !
Please, take a look to my patch concerning the feature request #683.
Let me know if you see how I can improve my code :)
Cheers !
On Sat, 1 Mar 2014 11:28:13 +0100 Steven VALSESIA steven.valsesia@gmail.com wrote:
Hi everybody !
Hi.
Please, take a look to my patch concerning the feature request #683.
A disclaimer first: I'm not using the autosave actions plugin. The code seems to match autosave closely, with no obvious errors.
Let me know if you see how I can improve my code :)
First, the "editor-notify" signal is a tight spot, all Scintilla events go there. Blocking them while saving may not be a good idea, especially considering that a file save error may display a modal dialog IIRC. You can do a plugin_idle_add(func) instead, and make func() return FALSE.
Second, mentioning -lgthread-2.0 twice may be required, depending on the libraries and linker, and won't do any harm otherwise.
First, the "editor-notify" signal is a tight spot, all Scintilla events go there. Blocking them while saving may not be a good idea, especially considering that a file save error may display a modal dialog IIRC. You can do a plugin_idle_add(func) instead, and make func() return FALSE.
I think I don't understand, where do I block these signals ? My implementation of editor-notify() return FALSE, so it doesn't block anything, no ? :)
Second, mentioning -lgthread-2.0 twice may be required, depending on the libraries and linker, and won't do any harm otherwise.
Ok, roger that !
2014-03-01 12:01 GMT+01:00 Dimitar Zhekov dimitar.zhekov@gmail.com:
On Sat, 1 Mar 2014 11:28:13 +0100 Steven VALSESIA steven.valsesia@gmail.com wrote:
Hi everybody !
Hi.
Please, take a look to my patch concerning the feature request #683.
A disclaimer first: I'm not using the autosave actions plugin. The code seems to match autosave closely, with no obvious errors.
Let me know if you see how I can improve my code :)
First, the "editor-notify" signal is a tight spot, all Scintilla events go there. Blocking them while saving may not be a good idea, especially considering that a file save error may display a modal dialog IIRC. You can do a plugin_idle_add(func) instead, and make func() return FALSE.
Second, mentioning -lgthread-2.0 twice may be required, depending on the libraries and linker, and won't do any harm otherwise.
-- E-gards: Jimmy _______________________________________________ Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
On 1 March 2014 22:16, Steven VALSESIA steven.valsesia@gmail.com wrote:
First, the "editor-notify" signal is a tight spot, all Scintilla events go there. Blocking them while saving may not be a good idea, especially considering that a file save error may display a modal dialog IIRC. You can do a plugin_idle_add(func) instead, and make func() return FALSE.
I think I don't understand, where do I block these signals ? My implementation of editor-notify() return FALSE, so it doesn't block anything, no ? :)
What Dimitar is referring to is that saving a file is a slow operation, and it will block the UI while it happens since your handler calls the save operation synchronously. And since this is a "save on unfocus" that means the user moved the cursor somewhere unrelated and that is now possibly being blocked. Some people insist on editing large files over slow remote links :( and so we can't always assume that file saving is instantaneous.
The method suggested by Dimitar will still block, but not until the UI has become idle, so hopefully it will be less apparent to users.
Cheers Lex
Second, mentioning -lgthread-2.0 twice may be required, depending on the libraries and linker, and won't do any harm otherwise.
Ok, roger that !
2014-03-01 12:01 GMT+01:00 Dimitar Zhekov dimitar.zhekov@gmail.com:
On Sat, 1 Mar 2014 11:28:13 +0100 Steven VALSESIA steven.valsesia@gmail.com wrote:
Hi everybody !
Hi.
Please, take a look to my patch concerning the feature request #683.
A disclaimer first: I'm not using the autosave actions plugin. The code seems to match autosave closely, with no obvious errors.
Let me know if you see how I can improve my code :)
First, the "editor-notify" signal is a tight spot, all Scintilla events go there. Blocking them while saving may not be a good idea, especially considering that a file save error may display a modal dialog IIRC. You can do a plugin_idle_add(func) instead, and make func() return FALSE.
Second, mentioning -lgthread-2.0 twice may be required, depending on the libraries and linker, and won't do any harm otherwise.
-- E-gards: Jimmy _______________________________________________ Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
- is it necessary to remove the reference to gthread-2.0 in the
makefile for your changes? If not then make that a separate change with its justification. Never hide unrelated changes inside other changes.
Ok, I'll take care of that in the future.
- Since you have added a preference setting it needs to be documented.
I'll check the doc to know how to doc the doc, because I don't know what you're talking about :)
The method suggested by Dimitar will still block, but not until the UI has become idle, so hopefully it will be less apparent to users.
A plugin_idle_add(func) won't create latency ? Maybe I can create a gtk_thread ?
See you soon :)
2014-03-01 12:24 GMT+01:00 Lex Trotman elextr@gmail.com:
On 1 March 2014 22:16, Steven VALSESIA steven.valsesia@gmail.com wrote:
First, the "editor-notify" signal is a tight spot, all Scintilla events go there. Blocking them while saving may not be a good idea, especially considering that a file save error may display a modal dialog IIRC. You can do a plugin_idle_add(func) instead, and make func() return FALSE.
I think I don't understand, where do I block these signals ? My implementation of editor-notify() return FALSE, so it doesn't block anything, no ? :)
What Dimitar is referring to is that saving a file is a slow operation, and it will block the UI while it happens since your handler calls the save operation synchronously. And since this is a "save on unfocus" that means the user moved the cursor somewhere unrelated and that is now possibly being blocked. Some people insist on editing large files over slow remote links :( and so we can't always assume that file saving is instantaneous.
The method suggested by Dimitar will still block, but not until the UI has become idle, so hopefully it will be less apparent to users.
Cheers Lex
Second, mentioning -lgthread-2.0 twice may be required, depending on the libraries and linker, and won't do any harm otherwise.
Ok, roger that !
2014-03-01 12:01 GMT+01:00 Dimitar Zhekov dimitar.zhekov@gmail.com:
On Sat, 1 Mar 2014 11:28:13 +0100 Steven VALSESIA steven.valsesia@gmail.com wrote:
Hi everybody !
Hi.
Please, take a look to my patch concerning the feature request #683.
A disclaimer first: I'm not using the autosave actions plugin. The code seems to match autosave closely, with no obvious errors.
Let me know if you see how I can improve my code :)
First, the "editor-notify" signal is a tight spot, all Scintilla events go there. Blocking them while saving may not be a good idea, especially considering that a file save error may display a modal dialog IIRC. You can do a plugin_idle_add(func) instead, and make func() return FALSE.
Second, mentioning -lgthread-2.0 twice may be required, depending on the libraries and linker, and won't do any harm otherwise.
-- E-gards: Jimmy _______________________________________________ Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
On 2 March 2014 01:00, Steven VALSESIA steven.valsesia@gmail.com wrote:
- is it necessary to remove the reference to gthread-2.0 in the
makefile for your changes? If not then make that a separate change with its justification. Never hide unrelated changes inside other changes.
Ok, I'll take care of that in the future.
- Since you have added a preference setting it needs to be documented.
I'll check the doc to know how to doc the doc, because I don't know what you're talking about :)
http://www.geany.org/manual/current/index.html#save-actions note the source is rest in doc/geany.txt
The method suggested by Dimitar will still block, but not until the UI has become idle, so hopefully it will be less apparent to users.
A plugin_idle_add(func) won't create latency ?
Not in the UI, which is what the user sees, because it waits until the UI is idle to do the potentially slow thing.
Maybe I can create a gtk_thread ?
Access to the Scintilla buffer is not thread safe, so you can't simply run the existing save code in a separate thread. If it was that simple we would have done it ages ago :)
See you soon :)
[...]
On 1 March 2014 21:28, Steven VALSESIA steven.valsesia@gmail.com wrote:
Hi everybody !
Please, take a look to my patch concerning the feature request #683.
Couple of quick comments:
1. is it necessary to remove the reference to gthread-2.0 in the makefile for your changes? If not then make that a separate change with its justification. Never hide unrelated changes inside other changes.
2. Since you have added a preference setting it needs to be documented.
Cheers Lex
Let me know if you see how I can improve my code :)
PS now you are getting the hang of git you can try making the changes in a branch and making a pull request on github, they have reasonable (though not brilliant) documentation of the process and it makes it easier for you to publish your changes and request they be checked and pulled into the master repository. And as Colomban said on IRC, don't worry, you can't commit anything to the master repository, only to your own stuff, even on github :)
Cheers !
Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel