comp.lang.ada
 help / color / mirror / Atom feed
* Some questions about GPS
@ 2018-07-23 18:26 Ian Douglas
  2018-07-23 19:01 ` Jacob Sparre Andersen
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Ian Douglas @ 2018-07-23 18:26 UTC (permalink / raw)


Hi

Please advise if off topic.

Finally trying to learn Ada, after years of PHP. Did Pascal at varsity back in the 80s.

Using GPS on Linux but some things driving me nuts, so need to determine if "that's the way it is" or is my configuration is flaky. 

1. Line numbers: selected option for "all" but only first few are shown, then they stop. 

2. When selecting text to copy/cut, it reverts to black on white when selected. I'm used to Kate where selected text gets a different background so you can clearly see what you've selected. Is this me or the way the editor works (and IMHO this is sub-optimal for usability).

3. Am trying to read in a file, play with it, and write it out. So started with "Expanded with proper error handling and reporting it reads:" example (2nd one) on https://www.rosettacode.org/wiki/File_input/output#Line_by_line , but the compiler insists that the two "close input" statements are "unreachable code".
Is this normal? If I comment them out, it compiles okay. And runs okay.

Thanks, Ian


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Some questions about GPS
  2018-07-23 18:26 Some questions about GPS Ian Douglas
@ 2018-07-23 19:01 ` Jacob Sparre Andersen
  2018-07-23 20:17   ` Ian Douglas
  2018-07-23 19:02 ` Dmitry A. Kazakov
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Jacob Sparre Andersen @ 2018-07-23 19:01 UTC (permalink / raw)


Ian Douglas <ian@vionia.com> writes:

> Using GPS on Linux but some things driving me nuts, so need to
> determine if "that's the way it is" or is my configuration is flaky. 

Which version of GPS?  The one currently packaged for Debian is indeed a
bit flaky, while the one packaged with GNAT Community Edition, which you
can download from AdaCore works quite well.

> 1. Line numbers: selected option for "all" but only first few are
> shown, then they stop. 

Wierd.

> 2. When selecting text to copy/cut, it reverts to black on white when
> selected. I'm used to Kate where selected text gets a different
> background so you can clearly see what you've selected. Is this me or
> the way the editor works (and IMHO this is sub-optimal for usability).

I'm pretty sure that is a user setting (but I can't remember where/how
you set it).

> 3. Am trying to read in a file, play with it, and write it out. So
> started with "Expanded with proper error handling and reporting it
> reads:" example (2nd one) on
> https://www.rosettacode.org/wiki/File_input/output#Line_by_line , but
> the compiler insists that the two "close input" statements are
> "unreachable code".

The two calls to "Close" just after "end loop" are indeed unreachable,
and shouldn't be there.

Greetings,

Jacob
-- 
"Very small. Go to sleep" -- monster (not drooling)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Some questions about GPS
  2018-07-23 18:26 Some questions about GPS Ian Douglas
  2018-07-23 19:01 ` Jacob Sparre Andersen
@ 2018-07-23 19:02 ` Dmitry A. Kazakov
  2018-07-23 19:09 ` Niklas Holsti
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Dmitry A. Kazakov @ 2018-07-23 19:02 UTC (permalink / raw)


On 2018-07-23 20:26, Ian Douglas wrote:

> Using GPS on Linux but some things driving me nuts, so need to determine if "that's the way it is" or is my configuration is flaky.
> 
> 1. Line numbers: selected option for "all" but only first few are shown, then they stop.

Some older versions had this bug, I remember. Reload the file/project 
and line numbers will reappear.

> 2. When selecting text to copy/cut, it reverts to black on white when selected. I'm used to Kate where selected text gets a different background so you can clearly see what you've selected. Is this me or the way the editor works (and IMHO this is sub-optimal for usability).

It can be changed in Edit->Preferences->Editor->Fonts & Colors.

> 3. Am trying to read in a file, play with it, and write it out. So started with "Expanded with proper error handling and reporting it reads:" example (2nd one) on https://www.rosettacode.org/wiki/File_input/output#Line_by_line , but the compiler insists that the two "close input" statements are "unreachable code".

The compiler is right. The loop is left only upon an exception, e.g. on 
the file end (End_Error) or on any other error.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Some questions about GPS
  2018-07-23 18:26 Some questions about GPS Ian Douglas
  2018-07-23 19:01 ` Jacob Sparre Andersen
  2018-07-23 19:02 ` Dmitry A. Kazakov
@ 2018-07-23 19:09 ` Niklas Holsti
  2018-07-23 21:10 ` Jeffrey R. Carter
  2018-07-24 20:01 ` Ian Douglas
  4 siblings, 0 replies; 9+ messages in thread
From: Niklas Holsti @ 2018-07-23 19:09 UTC (permalink / raw)


On 18-07-23 21:26 , Ian Douglas wrote:
> Hi
>
> Please advise if off topic.
>
> Finally trying to learn Ada, after years of PHP. Did Pascal at
> varsity back in the 80s.
>
> Using GPS on Linux but some things driving me nuts, so need to
> determine if "that's the way it is" or is my configuration is flaky.

  [I'll let someone more knowledgeable about GPS answer Q 1 and 2]

> 3. Am trying to read in a file, play with it, and write it out. So
> started with "Expanded with proper error handling and reporting it
> reads:" example (2nd one) on
> https://www.rosettacode.org/wiki/File_input/output#Line_by_line , but
> the compiler insists that the two "close input" statements are
> "unreachable code". Is this normal?

(The quoted text above seems a little garbled, but the URL is whole, so 
I looked at that.)

The two statements that call Close (one for Input, one for Output) and 
follow the loop, but precede the exception handlers, are indeed 
unreachable, because the loop can terminate only by raising an exception 
(normally End_Error), in which case the exception handler is entered. 
These two Close calls are never executed. This Rosetta-code example 
should be corrected by removing these statements.

> If I comment them out, it
> compiles okay. And runs okay.

This is as expected.

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
       .      @       .


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Some questions about GPS
  2018-07-23 19:01 ` Jacob Sparre Andersen
@ 2018-07-23 20:17   ` Ian Douglas
  0 siblings, 0 replies; 9+ messages in thread
From: Ian Douglas @ 2018-07-23 20:17 UTC (permalink / raw)


hi All

Thanks for the speedy replies :)

On Monday, 23 July 2018 21:01:32 UTC+2, Jacob Sparre Andersen  wrote:


> Which version of GPS?  The one currently packaged for Debian is indeed a
> bit flaky, while the one packaged with GNAT Community Edition, which you
> can download from AdaCore works quite well.

Sorry, should have included that.
GPS 2017 (20170515) hosted on x86_64-pc-linux-gnu
GNAT GPL 2017 (20170515-63)

I'm on Gentoo Linux.

[I] dev-ada/gps
     Available versions:  (~)2017^t ~2018^t {doc PYTHON_TARGETS="python2_7"}
     Installed versions:  2017^t(12:53:03 29/04/2018)(-doc PYTHON_TARGETS="python2_7")

Suppose I could try to get the 2018 version installed.

> 
> > 1. Line numbers: selected option for "all" but only first few are
> > shown, then they stop. 
> 
> Wierd.

I'm using that example from RosettaCode. When cursor is at top of file, I see line numbers up to 4. If I scroll down so that (4) goes up at the top, suddenly 5 to 11 appear. As you say, Weird.

> 
> I'm pretty sure that is a user setting (but I can't remember where/how
> you set it).

I thought as much but there isn't anything marked "selected text colour" or words to that effect... unless this is another bug in the 2017 version. So didn't know if it was just not there, or hiding under some obtuse description. I could not find any mention of it in the online docs (hence asking experts here :- )

Will try to rewrite that code reading the file to do some sort of while-not-end-of-file....

Thanks, Ian

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Some questions about GPS
  2018-07-23 18:26 Some questions about GPS Ian Douglas
                   ` (2 preceding siblings ...)
  2018-07-23 19:09 ` Niklas Holsti
@ 2018-07-23 21:10 ` Jeffrey R. Carter
  2018-07-24 20:01 ` Ian Douglas
  4 siblings, 0 replies; 9+ messages in thread
From: Jeffrey R. Carter @ 2018-07-23 21:10 UTC (permalink / raw)


On 07/23/2018 08:26 PM, Ian Douglas wrote:
> 
> 2. When selecting text to copy/cut, it reverts to black on white when selected. I'm used to Kate where selected text gets a different background so you can clearly see what you've selected. Is this me or the way the editor works (and IMHO this is sub-optimal for usability).

This is a problem with the version of GPS packaged with many Linux distros. It 
shows up, for example, in GPS 6.1.2016 (20160515) that comes with Ubuntu. I have 
downloaded and use GPS 2018 (20180528) from the Community Edition primarily to 
get around this problem.

-- 
Jeff Carter
"I did not rob a bank. If I'd robbed a bank, everything
would be great. I tried to rob a bank, is what happened,
and they got me. I misspelled the note."
Take the Money and Run
140


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Some questions about GPS
  2018-07-23 18:26 Some questions about GPS Ian Douglas
                   ` (3 preceding siblings ...)
  2018-07-23 21:10 ` Jeffrey R. Carter
@ 2018-07-24 20:01 ` Ian Douglas
  2018-07-26 13:33   ` Patrick Noffke
  4 siblings, 1 reply; 9+ messages in thread
From: Ian Douglas @ 2018-07-24 20:01 UTC (permalink / raw)


FWIW, I tried to update to 2018 version of GPS but it fails to compile. (It is marked "unstable" in Gentoo, despite being "recommended" version".)

So tried updating other bits of Ada to 2018, some worked, some still wanted 2017 stuff, so gave up and tried to undo. Not sure how well :)

End result is that somehow it dropped me back to 2015 version of GPS, which does not have the line number or "select highlight" issues that the 2017 version has. Does have slightly dated interface but I can live with that.

Have mailed the package maintainer for an ETA on when 2018 version will be working properly.

Thanks again for the help.

Cheers, Ian

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Some questions about GPS
  2018-07-24 20:01 ` Ian Douglas
@ 2018-07-26 13:33   ` Patrick Noffke
  2018-07-27 10:03     ` Ian Douglas
  0 siblings, 1 reply; 9+ messages in thread
From: Patrick Noffke @ 2018-07-26 13:33 UTC (permalink / raw)


On Tuesday, July 24, 2018 at 3:01:10 PM UTC-5, Ian Douglas wrote:
> FWIW, I tried to update to 2018 version of GPS but it fails to compile. (It is marked "unstable" in Gentoo, despite being "recommended" version".)
> 

You can download prebuilt binaries of the 2018 Community Edition from here:
https://www.adacore.com/download

The gnat-community-2018-20180528-x86_64-linux-bin installer includes GPS.

Regards,
Patrick


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Some questions about GPS
  2018-07-26 13:33   ` Patrick Noffke
@ 2018-07-27 10:03     ` Ian Douglas
  0 siblings, 0 replies; 9+ messages in thread
From: Ian Douglas @ 2018-07-27 10:03 UTC (permalink / raw)


On Thursday, 26 July 2018 15:33:10 UTC+2, Patrick Noffke  wrote:
> 
> You can download prebuilt binaries of the 2018 Community Edition from here:
> https://www.adacore.com/download
> 
> The gnat-community-2018-20180528-x86_64-linux-bin installer includes GPS.

Thanks, will take a look :-)

Cheers, Ian

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-07-27 10:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-23 18:26 Some questions about GPS Ian Douglas
2018-07-23 19:01 ` Jacob Sparre Andersen
2018-07-23 20:17   ` Ian Douglas
2018-07-23 19:02 ` Dmitry A. Kazakov
2018-07-23 19:09 ` Niklas Holsti
2018-07-23 21:10 ` Jeffrey R. Carter
2018-07-24 20:01 ` Ian Douglas
2018-07-26 13:33   ` Patrick Noffke
2018-07-27 10:03     ` Ian Douglas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox