Thanks for your answers.
I totally agree that a popup dialog for that would be ugly and annoying. However, I think that this issue is quite important, since enabling that feature by default can be strongly distrurbing for PHP development.
After some thinking, I would suggest that :
- the feature "*new line at end of file*" would be a drop-down list instead of a checkbox, with options "*according to file type*" (default), "*always*", "*never*"
- when option "*according to file type*" is selected : - when (for example) a C/C++ file is saved, a new empty line is automatically added if necessary - when a PHP (or Javascript, CSS, HTML, SQL, XML, YML...) file is saved, no new empty line is added
- details about file types requiring a "final empty line" or not, would be available in the manual.
This way, Geany's default behavior would be convenient for all programming languages (but user can "force" the behavior to whatever he prefers), and the user wouldn't be annoyed by any warning message.
Maxime
Enrico Tröger a écrit :
On Sat, 28 Nov 2009 11:01:52 +0100, Frank wrote:
On Thu, 26 Nov 2009 19:02:10 +0100 Maxime Pacary mpacary@winsoft.fr wrote:
A nice colleague knowing better Geany told me that this could simply be disabled in preferences > files ; so please ignore that bug report, sorry. However, it could be nice to warn the user if he works on PHP files while having the feature "new line at end of file" enabled.
I don't see any big reason for adding a warning, maybe a pop-up or something like that. In time this will be more annoying as helpful from my point of view. I recommend just deactivate the feature and ensure to insert empty line manual in case its needed.
Exactly. If you don't want Geany to insert new blank lines at the end of files, deactivate this feature. Adding a warning in whatever way, is just more annoying than helpful.
And to be able to receive further answers and be able to send messages, you first need to subscribe to this mailing list. Thanks.
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
Regards, Enrico
On Tue, 01 Dec 2009 16:04:08 +0100, Maxime wrote:
Thanks for your answers.
I totally agree that a popup dialog for that would be ugly and annoying. However, I think that this issue is quite important, since enabling that feature by default can be strongly distrurbing for PHP development.
After some thinking, I would suggest that :
- the feature "*new line at end of file*" would be a drop-down list
instead of a checkbox, with options "*according to file type*" (default), "*always*", "*never*"
- when option "*according to file type*" is selected :
- when (for example) a C/C++ file is saved, a new empty line is
automatically added if necessary - when a PHP (or Javascript, CSS, HTML, SQL, XML, YML...) file is saved, no new empty line is added
- details about file types requiring a "final empty line" or not,
would be available in the manual.
This way, Geany's default behavior would be convenient for all programming languages (but user can "force" the behavior to whatever he prefers), and the user wouldn't be annoyed by any warning message.
IMO this is too complicated. Also having a hardcoded list of filetypes which use and don't use empty new lines at end of file, isn't much better than the current status.I still don't see what's the problem with simply deactiviting the feature if it causes troubles for you.
A better implementation of your suggested solution would be to read the setting from the filetype definition files so the user can really set it for those filetypes he/she wants and is not limited to a hardcoded list. If anyone finds this important enough, go ahead and write a patch.
Regards, Enrico
I still don't see what's the problem with simply deactiviting the feature if it causes troubles for you.
The problem is the *default value*. Each time a PHP developer installs Geany, he must keep in mind to disable this feature to avoid weird problems when using the *header()* function (frequent).
It would be convenient for PHP developers to have this feature disabled *by default*, but since it is necessary for other languages (http://www.linuxquestions.org/questions/programming-9/no-new-line-at-end-of-...), then other users will complain about it. I hope this helps to better understand the problem...
A better implementation of your suggested solution would be to read the setting from the filetype definition files so the user can really set it for those filetypes he/she wants and is not limited to a hardcoded list.
Yep, hardcoding doesn't sounds good, and I wasn't suggesting that. I agree with your solution (setting the "new line at end of file" option in the filetype definitions), but the default value for each filetype will have to be very accurate in order to avoid headaches to users.
If I have some free time I may propose a patch for that during the next weeks.
Anyway thanks for your attention and reactivity, Maxime
Enrico Tröger a écrit :
On Tue, 01 Dec 2009 16:04:08 +0100, Maxime wrote:
Thanks for your answers.
I totally agree that a popup dialog for that would be ugly and annoying. However, I think that this issue is quite important, since enabling that feature by default can be strongly distrurbing for PHP development.
After some thinking, I would suggest that :
- the feature "*new line at end of file*" would be a drop-down list
instead of a checkbox, with options "*according to file type*" (default), "*always*", "*never*"
- when option "*according to file type*" is selected :
- when (for example) a C/C++ file is saved, a new empty line is
automatically added if necessary - when a PHP (or Javascript, CSS, HTML, SQL, XML, YML...) file is saved, no new empty line is added
- details about file types requiring a "final empty line" or not,
would be available in the manual.
This way, Geany's default behavior would be convenient for all programming languages (but user can "force" the behavior to whatever he prefers), and the user wouldn't be annoyed by any warning message.
IMO this is too complicated. Also having a hardcoded list of filetypes which use and don't use empty new lines at end of file, isn't much better than the current status.I still don't see what's the problem with simply deactiviting the feature if it causes troubles for you.
A better implementation of your suggested solution would be to read the setting from the filetype definition files so the user can really set it for those filetypes he/she wants and is not limited to a hardcoded list. If anyone finds this important enough, go ahead and write a patch.
Regards, Enrico
Hi,
Maxime Pacary a écrit :
I still don't see what's the problem with simply deactiviting the feature if it causes troubles for you.
The problem is the *default value*. Each time a PHP developer installs Geany, he must keep in mind to disable this feature to avoid weird problems when using the *header()* function (frequent).
I don't see the problem in facts: anyway inserting a final PHP closing tag is not required[1] and some (including me) recommends not to insert it[2], for the reason you mention − unwanted headers.
But there may be languages where having a newline cause real trouble, I don't know. Anyway I think having an ending newline is better in most cases (for example, some UNIX commands works better with it). Then, I think adding such an option in the filetypes is somewhat overkill, but of course if anybody adds it − as far as C, Python and Vala keeps the same behaviour ;) − I wouldn't complain.
Regards, Colomban
[1] http://fr.php.net/manual/en/language.basic-syntax.instruction-separation.php [2] http://framework.zend.com/manual/en/coding-standard.php-file-formatting.html for example
I don't see the problem in facts: anyway inserting a final PHP closing tag is not required[1] and some (including me) recommends not to insert it[2], for the reason you mention − unwanted headers.
I know and agree, however this recommendation seems quite recent : a lot of "old" PHP source code, as well as widely used PHP projects based on quite "old" code (e.g. phpMyAdmin, TestLink...), still use that final closing tag. Then for example, just modifying a PHP config file with Geany's default settings, can break things up. WordPress follows the recommendation, but users get confused [1]. As well, the debate about closing tag is still opened [2]... Therefore, I think that despite the recommendations, the problem will remain for a long time.
Anyway, depending on the file type, an automatic new line is sometimes useful, sometimes painful. So the suggested behavior shouldn't be useless, since it would avoid headache to users.
Regards, Maxime
[1] http://wordpress.org/support/topic/287505 [2] http://choosetheforce.blogspot.com/2008/05/should-you-close-that-php-tag.htm...
Colomban Wendling a écrit :
Hi,
Maxime Pacary a écrit :
I still don't see what's the problem with simply deactiviting the feature if it causes troubles for you.
The problem is the *default value*. Each time a PHP developer installs Geany, he must keep in mind to disable this feature to avoid weird problems when using the *header()* function (frequent).
I don't see the problem in facts: anyway inserting a final PHP closing tag is not required[1] and some (including me) recommends not to insert it[2], for the reason you mention − unwanted headers.
But there may be languages where having a newline cause real trouble, I don't know. Anyway I think having an ending newline is better in most cases (for example, some UNIX commands works better with it). Then, I think adding such an option in the filetypes is somewhat overkill, but of course if anybody adds it − as far as C, Python and Vala keeps the same behaviour ;) − I wouldn't complain.
Regards, Colomban
[1] http://fr.php.net/manual/en/language.basic-syntax.instruction-separation.php [2] http://framework.zend.com/manual/en/coding-standard.php-file-formatting.html for example
Geany-devel mailing list Geany-devel@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
On Mon, 14 Dec 2009 14:23:09 +0100 Colomban Wendling ban-ubuntu@club-internet.fr wrote:
I still don't see what's the problem with simply deactiviting the feature if it causes troubles for you.
The problem is the *default value*. Each time a PHP developer installs Geany, he must keep in mind to disable this feature to avoid weird problems when using the *header()* function (frequent).
I don't see the problem in facts: anyway inserting a final PHP closing tag is not required[1] and some (including me) recommends not to insert it[2], for the reason you mention − unwanted headers.
But there may be languages where having a newline cause real trouble, I don't know. Anyway I think having an ending newline is better in most cases (for example, some UNIX commands works better with it). Then, I think adding such an option in the filetypes is somewhat overkill, but of course if anybody adds it − as far as C, Python and Vala keeps the same behaviour ;) − I wouldn't complain.
Perhaps it could be off by default on Windows but on by default on *nix. Not sure if that would fix the PHP issue though.
Regards, Nick