Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
translations translations
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  two minor comment handling changes

Poll

which changes do you like?

both
only #comment fix
only ability to split lines
opt3 but the character needs to be something else (which?)
« previous next »
  • Print
Pages: [1] 2

Author Topic: two minor comment handling changes  (Read 9407 times)

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
two minor comment handling changes
« on: September 09, 2009, 02:00:34 AM »
very simple patch changes 2 skin behaviours... asking you lot whether it should be commited or not...
the first change is to fix bug #9640... What it does it #comments in the middle of lines eats everything but leaves the new line there, #comments at the beginning of a line eats the whole line (line ending included)

so this code:
Code: [Select]
mary # had
# a little
lamb
looks like
Code: [Select]
mary
lamb
(in svn it would be "mary lamb" on one line





the second part of the patch lets you easily split long lines by putting % as the last character of the line, so
Code: [Select]
once apon %
a time
becomes "once apon a time" on one line.



so tell me what you think... I dont actually fiddle with skin code at all so don't know how useful this will all be :)

* comment_changes.txt (1.26 kB - downloaded 249 times.)
« Last Edit: September 09, 2009, 01:42:45 PM by JdGordon »
Logged


Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline audio-i

  • Artist
  • Member
  • *
  • Posts: 266
Re: two minor comment handling changes
« Reply #1 on: September 09, 2009, 07:59:28 AM »
# comment fix: in my opinion nice (but not really that much critical?)

ability to split lines: I think in some cases using % for this could make WPS's hard to follow

Note: not that I would have voted like that, but perhaps the voting option "# comment fix AND opt3 but the character needs to be something else (which?)" should also be there?
« Last Edit: September 09, 2009, 12:51:02 PM by audio-i »
Logged

Offline robin0800

  • Member
  • *
  • Posts: 291
  • Freeman
Re: two minor comment handling changes
« Reply #2 on: September 09, 2009, 11:04:09 AM »
I like opt 3 and would like to see this character used "¬" I have seen this in publications to indicate split lines
Logged

Offline psycho_maniac

  • Member
  • *
  • Posts: 812
    • MyWebPage
Re: two minor comment handling changes
« Reply #3 on: September 09, 2009, 11:34:02 AM »
opt3 but what if we used the + symbol?
Logged
Please SEARCH the wiki | Please read the Forum Guidelines | Please Read the Manual
I Own A Gigabeat F80

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
Re: two minor comment handling changes
« Reply #4 on: September 09, 2009, 11:45:05 AM »
I used % to split lines because that is the standard "escape" character in the skins... the other possibilities I like are \ and just # as the last char, but that could be confusing...
Logged


Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline BdN3504

  • Artist
  • Member
  • *
  • Posts: 323
Re: two minor comment handling changes
« Reply #5 on: September 09, 2009, 01:38:55 PM »
i wouldn't commit the weather. but i'd go with %. good idea to introduce this behaviour (both parts).
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: two minor comment handling changes
« Reply #6 on: September 09, 2009, 02:23:10 PM »
I'd say the symbol needs to be something that appears in common keyboard layouts. Personally I'm fond of "\" as it's used in a lot of other cases. % also works, but as it's the standard escape character I have a few doubts about it. I really don't like using # as a line end (though I guess technically, that's how it works now).

I'm not entirely sure the first part even needs to be fixed (honestly, I'm surprised we allow mid-line comments, but it seems to me the current method of doing it, even if it will catch people by surprise the first time it happens, is actually slightly more flexible overall once you know it exists).
Logged

Online gevaerts

  • Developer
  • Member
  • *
  • Posts: 1076
Re: two minor comment handling changes
« Reply #7 on: September 09, 2009, 02:31:53 PM »
Quote from: Llorean on September 09, 2009, 02:23:10 PM
% also works, but as it's the standard escape character I have a few doubts about it.

It being the standard escape character is what makes this the logical choice. Any other character would need some way of specifying that it shouldn't trigger a continuation line.
Logged

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
Re: two minor comment handling changes
« Reply #8 on: September 09, 2009, 02:33:26 PM »
% is the current escape char is the best reason to use it....

I think there is a flaw in the #comment at the end of the line eating the \n though... I think it shouldnt eat it if the line still ends in % (or whatever char we decide on) so you can still break up long lines, and comment on the same line instead of above or below the code

What are your doubts about %?

I get the impression that alot of people dont put comments in their wps which makes debugging and understanding very hard... I'm trying to make it easier (and so hopefully get more people to add them)
Logged


Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline Angus_NB

  • Member
  • *
  • Posts: 29
Re: two minor comment handling changes
« Reply #9 on: September 09, 2009, 03:37:24 PM »
Some programming languages, Visual Basic, VBA, use the _ character.
My opinion, % is used so much within the WPS code that it would be confusing to also use it within comments.

Over 100 views but only 10 of us voted.
Logged
Sansa e260

Online gevaerts

  • Developer
  • Member
  • *
  • Posts: 1076
Re: two minor comment handling changes
« Reply #10 on: September 09, 2009, 03:51:11 PM »
Quote from: Angus_NB on September 09, 2009, 03:37:24 PM
Some programming languages, Visual Basic, VBA, use the _ character.
And what if you want a literal '_' character at the end of a line?
Logged

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
Re: two minor comment handling changes
« Reply #11 on: September 09, 2009, 03:53:17 PM »
% works so easily because there is already special handling for it... if you want a % symbol on the wps you have to put %% in the code.... so % by itself is already understood to be special
Logged


Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline pixelma

  • Rockbox Expert
  • Member
  • *
  • Posts: 642
Re: two minor comment handling changes
« Reply #12 on: September 09, 2009, 04:48:46 PM »
I just want to point out that the current behaviour of # is there on purpose (I think Llorean was thinking along those lines too).

This way you can add comments on separate lines without adding blank lines - this was needed as long as positioning text was purely line based and still has advantage if you do not position the text using a viewport or want to comment "inside" a viewport. I guess quite a few people will be surprised if their WPS looks differently if you change the behaviour as now every comment line starting with an # would add a blank line.

So a WPS with a code like this:
Code: [Select]
%ia
# show next track info below
%Ia

will then look like this:
Code: [Select]
current track's artist

next track's artist

You can easily avoid the "problem" with inline comment by not using them - I find them harder to read anyways. At the same time the current behaviour of # already offers you a way to break too long lines (without any need for a new marker character) - by using # at the end of your line.
Logged

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
Re: two minor comment handling changes
« Reply #13 on: September 09, 2009, 04:55:26 PM »
That code snippet is what I'd like to discourage... the same could (and imo *should*) be done using blank lines... using comment lines makes it harder to read.

The second bit (using # to break lines) is supposedly a bug... I'm open to not fixing that
Logged


Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
Re: two minor comment handling changes
« Reply #14 on: September 09, 2009, 06:10:19 PM »
ok, after going back and forwards of being confused I've decided the % thing is wrong how I did it.... you shold be using #comment to break those lines....
Logged


Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

  • Print
Pages: [1] 2
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  two minor comment handling changes
 

  • SMF 2.0.19 | SMF © 2021, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.125 seconds with 24 queries.