Re: [fpc-devel] Compiler message colour scheme

2020-11-22 Thread Sven Barth via fpc-devel
Am 23.11.2020 um 01:59 schrieb J. Gareth Moreton via fpc-devel: I'm glad there's still interest in pure functions.  It may be a while though, and I'm being tempted with a bounty and Patreon pledges to implement "static single assignment" into the Free Pascal Compiler.  That will take some resea

Re: [fpc-devel] Compiler message colour scheme

2020-11-22 Thread Alexander Grotewohl via fpc-devel
I would probably do something like this: const ansi_colors: array[0..7] of char = ('0', '4', '2', '6', '1', '5', '3', '7'); procedure PrintColor(fg, bg: byte; s: string); var tmp: string; begin tmp:=#27+'[0;3'+ansi_colors[fg]+';4'+ansi_colors[bg]+'m'+s+#27+'[0m'; writeln(tmp); end; begin PrintCo

Re: [fpc-devel] Compiler message colour scheme

2020-11-22 Thread J. Gareth Moreton via fpc-devel
I'm getting there.  I keep getting distracted or lost though! Hardware failures don't help! I'm trying a different approach this time and writing a whitepaper like I've done with my more major changes for Free Pascal, so I can describe its uses and how it works etc.  It can be updated of cours

Re: [fpc-devel] Compiler message colour scheme

2020-11-22 Thread Ryan Joseph via fpc-devel
> On Nov 22, 2020, at 10:09 AM, J. Gareth Moreton via fpc-devel > wrote: > > Personally I'd write the function as something like "function > GenerateColorCode(codes: array of Byte): ansistring;", mostly in anticipation > of pure functions, because then the compiler can just replace the call

Re: [fpc-devel] Compiler message colour scheme

2020-11-22 Thread J. Gareth Moreton via fpc-devel
But to go back to the point I originally raised, Kirinn raised a good point about those who have white rather than black backgrounds, or any colour so long as it's /not/ black! Yellow is very hard to see against a bright white backdrop, while red, medium/dark green and magenta can be seen on mo

Re: [fpc-devel] Compiler message colour scheme

2020-11-22 Thread J. Gareth Moreton via fpc-devel
Personally I'd write the function as something like "function GenerateColorCode(codes: array of Byte): ansistring;", mostly in anticipation of pure functions, because then the compiler can just replace the call with the relevant string at compile time, but that's a long way off! Gareth aka. K

Re: [fpc-devel] Compiler message colour scheme

2020-11-22 Thread Ryan Joseph via fpc-devel
> On Nov 22, 2020, at 9:29 AM, Florian Klämpfl via fpc-devel > wrote: > > Because I have no Mac so I couldn't test it. I see. It's this easy. const ANSI_FORE_BLACK = 30; ANSI_FORE_RED = 31; ANSI_FORE_GREEN = 32; ANSI_FORE_YELLOW = 33; ANSI_

Re: [fpc-devel] Compiler message colour scheme

2020-11-22 Thread J. Gareth Moreton via fpc-devel
That's a fair point. Good call. Gareth aka. Kit On 22/11/2020 15:44, Kirinn via fpc-devel wrote: The feature request was here: https://bugs.freepascal.org/view.php?id=37331 It's magenta because GCC etc use magenta for warnings too. Actually, for those of us with white terminal backgrounds, y

Re: [fpc-devel] Compiler message colour scheme

2020-11-22 Thread Jonas Maebe via fpc-devel
On 22/11/2020 17:42, Sven Barth via fpc-devel wrote: > Am 22.11.2020 um 17:40 schrieb J. Gareth Moreton via fpc-devel: >> Most modern Macs are Unix-based, so the escape sequences should work, >> right? Granted, I think we need someone with a Mac or a Mac virtual >> machine to test it for sure. > >

Re: [fpc-devel] Compiler message colour scheme

2020-11-22 Thread Sven Barth via fpc-devel
Am 22.11.2020 um 17:40 schrieb J. Gareth Moreton via fpc-devel: Most modern Macs are Unix-based, so the escape sequences should work, right? Granted, I think we need someone with a Mac or a Mac virtual machine to test it for sure. Considering that Jonas doesn't support the textmode IDE on macO

Re: [fpc-devel] Compiler message colour scheme

2020-11-22 Thread Sven Barth via fpc-devel
Am 22.11.2020 um 17:19 schrieb J. Gareth Moreton via fpc-devel: I believe that to enable colour on a Windows console, you need to use an API function, which can get a bit clumsy because there isn't an equivalent to \e[0m to reset to default, so you have to retrieve the current console colour

Re: [fpc-devel] Compiler message colour scheme

2020-11-22 Thread J. Gareth Moreton via fpc-devel
Most modern Macs are Unix-based, so the escape sequences should work, right? Granted, I think we need someone with a Mac or a Mac virtual machine to test it for sure. Gareth aka. Kit On 22/11/2020 16:29, Florian Klämpfl via fpc-devel wrote: Am 22.11.2020 um 17:23 schrieb Ryan Joseph via fpc-d

Re: [fpc-devel] Compiler message colour scheme

2020-11-22 Thread Florian Klämpfl via fpc-devel
Am 22.11.2020 um 17:23 schrieb Ryan Joseph via fpc-devel: On Nov 22, 2020, at 8:57 AM, Jonas Maebe via fpc-devel wrote: It's only enabled on Linux and Windows currently. Why is that? Mac has colors in the terminal also. Because I have no Mac so I couldn't test it. __

Re: [fpc-devel] Compiler message colour scheme

2020-11-22 Thread Ryan Joseph via fpc-devel
> On Nov 22, 2020, at 8:57 AM, Jonas Maebe via fpc-devel > wrote: > > It's only enabled on Linux and Windows currently. Why is that? Mac has colors in the terminal also. Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freep

Re: [fpc-devel] Compiler message colour scheme

2020-11-22 Thread J. Gareth Moreton via fpc-devel
I believe that to enable colour on a Windows console, you need to use an API function, which can get a bit clumsy because there isn't an equivalent to \e[0m to reset to default, so you have to retrieve the current console colour beforehand.  Windows 10 /might/ accept the ANSI escape sequences,

Re: [fpc-devel] Compiler message colour scheme

2020-11-22 Thread J. Gareth Moreton via fpc-devel
Fair enough then!  I always thought yellow was for warnings, red was for errors and white was for notes, but if GCC says otherwise, I can't argue! Gareth aka. Kit On 22/11/2020 16:08, Sven Barth via fpc-devel wrote: Am 22.11.2020 um 15:59 schrieb J. Gareth Moreton via fpc-devel: Hi everyone,

Re: [fpc-devel] Compiler message colour scheme

2020-11-22 Thread Sven Barth via fpc-devel
Am 22.11.2020 um 16:44 schrieb Kirinn via fpc-devel: The feature request was here: https://bugs.freepascal.org/view.php?id=37331 It's magenta because GCC etc use magenta for warnings too. Actually, for those of us with white terminal backgrounds, yellow text would be hard to see, while green,

Re: [fpc-devel] Compiler message colour scheme

2020-11-22 Thread Sven Barth via fpc-devel
Am 22.11.2020 um 15:59 schrieb J. Gareth Moreton via fpc-devel: Hi everyone, This might be me being a little bit picky, but I noticed the new colouring scheme for words like "Warning" and "Error" in the output logs.  Is there any particular reason why "Warning" is in magenta?  Normally the co

Re: [fpc-devel] Compiler message colour scheme

2020-11-22 Thread Kirinn via fpc-devel
The feature request was here: https://bugs.freepascal.org/view.php?id=37331 It's magenta because GCC etc use magenta for warnings too. Actually, for those of us with white terminal backgrounds, yellow text would be hard to see, while green, red, and magenta appear quite well against both a bla

Re: [fpc-devel] Compiler message colour scheme

2020-11-22 Thread Sven Barth via fpc-devel
Michael Van Canneyt via fpc-devel schrieb am So., 22. Nov. 2020, 17:03: > > > On Sun, 22 Nov 2020, Jonas Maebe via fpc-devel wrote: > > > On 22/11/2020 16:03, Ryan Joseph via fpc-devel wrote: > >> What version of the trunk is this in and what's the flag to enable it? > My trunk is maybe 30 days o

Re: [fpc-devel] Compiler message colour scheme

2020-11-22 Thread Michael Van Canneyt via fpc-devel
On Sun, 22 Nov 2020, Jonas Maebe via fpc-devel wrote: On 22/11/2020 16:03, Ryan Joseph via fpc-devel wrote: What version of the trunk is this in and what's the flag to enable it? My trunk is maybe 30 days old and I don't see any way to get the colors. It's only enabled on Linux and Windows

Re: [fpc-devel] Compiler message colour scheme

2020-11-22 Thread Jonas Maebe via fpc-devel
On 22/11/2020 16:03, Ryan Joseph via fpc-devel wrote: > What version of the trunk is this in and what's the flag to enable it? My > trunk is maybe 30 days old and I don't see any way to get the colors. It's only enabled on Linux and Windows currently. Jonas _

Re: [fpc-devel] Compiler message colour scheme

2020-11-22 Thread J. Gareth Moreton via fpc-devel
I'm using the latest trunk on arm-linux.  I'm pretty sure it's in the FPC source and not some quirk with the Raspian OS's terminal because the escape sequences appear in the "Console In/Output" debug window in Lazarus. Gareth aka. Kit On 22/11/2020 15:03, Ryan Joseph via fpc-devel wrote: On

Re: [fpc-devel] Compiler message colour scheme

2020-11-22 Thread Ryan Joseph via fpc-devel
> On Nov 22, 2020, at 7:59 AM, J. Gareth Moreton via fpc-devel > wrote: > > Hi everyone, > > This might be me being a little bit picky, but I noticed the new colouring > scheme for words like "Warning" and "Error" in the output logs. Is there any > particular reason why "Warning" is in mag

[fpc-devel] Compiler message colour scheme

2020-11-22 Thread J. Gareth Moreton via fpc-devel
Hi everyone, This might be me being a little bit picky, but I noticed the new colouring scheme for words like "Warning" and "Error" in the output logs.  Is there any particular reason why "Warning" is in magenta?  Normally the convention is that it's yellow (and "Error" in red).  Granted, it'