Project

General

Profile

Feature #352

Should SourceRegion echo the "region"?

Added by Anna Maria Bigatti almost 11 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Low
Category:
Parser/Interpreter
Start date:
21 May 2013
Due date:
% Done:

100%

Estimated time:
4.44 h
Spent time:

Description

I think that it might be useful to "echo" the region that has been sent, so that the user has the history of what has been executed.

I did write the code for emacs so that the sourced lines are printed (commented out), but, of course, this is not satisfactory because the related numer of prompts is then printed, so it is commented out.

Now, I think the best solution is that it is SourceRegion itself to output the lines before executing them, but doing this is not trivial because SourceRegion does not know the output stream.

How important is it? probably not much...


Related issues

Related to CoCoA-5 - Feature #8: source regionClosed2011-10-20

Related to CoCoA-5 - Feature #500: Interpreter: is it possible to avoid useless prompts?Closed2014-03-28

Related to CoCoA-5 - Feature #608: Emacs UI: C-return for send-line and send-regionClosed2014-08-28

Related to CoCoA-5 - Support #242: CoCoA-5 Projects for students (e.g. crediti F and tesi)In Progress2012-09-28

History

#1 Updated by John Abbott over 10 years ago

I have been using SourceRegion for several months now, and definitely appreciate the fact that it does not fill my CoCoA-5 output window with "junk" e.g. if I am trying to refine the implementation of a function, there is no use in seeing all the various old broken definitions of the function.

Right from the start I have favoured not seeing the content of the region, and now that I have direct experience I'd say that my initial preference has been vindicated.

Of course, mine is just one opinion...

#2 Updated by John Abbott about 10 years ago

  • Status changed from New to In Progress
  • Priority changed from Normal to Low
  • % Done changed from 0 to 20

I can see what the students of the upcoming Computer Algebra course say about "send region" not copying the region sent to the CoCoA output window.

If we really want, we could have two separate commands: one which just calls SourceRegion and one which actually copies the lines (perhaps inside a Block...EndBlock to avoid lots of prompts appearing?)

It would be nice to close this issue soon.

#3 Updated by Anna Maria Bigatti about 10 years ago

John Abbott wrote:

I can see what the students of the upcoming Computer Algebra course say about "send region" not copying the region sent to the CoCoA output window.

If we really want, we could have two separate commands: one which just calls SourceRegion and one which actually copies the lines (perhaps inside a Block...EndBlock to avoid lots of prompts appearing?)

no :-( I had already thought of this.
you'd just get (rightly so) lots of Block prompts.

we could make two separate emacs-commands. Name?

#4 Updated by Anna Maria Bigatti about 10 years ago

  • Assignee set to Anna Maria Bigatti
  • % Done changed from 20 to 50

I did write the code for emacs so that the sourced lines are printed (commented out), but, of course, this is not satisfactory because the related numer of propts is then printed, so it is commented out.

I uncommented the code.
It also prints lots of newlines and prompts, looks "clean"
Can be improved, but it works.
[20140226] JAA hates it :-(

There is a flag for it in the CoCoA-5 menu. Default is "do echo".

One thing John suggested some time ago: can the parser recognise whether two lines are sent in rapid succession and avoid printing the prompt twice?

#5 Updated by John Abbott about 10 years ago

  • Target version changed from CoCoA-5.1.0 Easter14 to CoCoA-5.1.1 Seoul14

#6 Updated by John Abbott over 9 years ago

  • % Done changed from 50 to 60

This issue has been idle for 5 months. I think we can close it.

Anna's solution is "ugly" (because it causes many prompts to appear), but is perhaps adequate for those (few?) who want this feature.

Note that default is now no echo for SourceRegion.

I don't think this is important enough to warrant spending any more time on it.

#7 Updated by John Abbott over 9 years ago

  • Target version changed from CoCoA-5.1.1 Seoul14 to CoCoA-5.?.?

#8 Updated by John Abbott almost 9 years ago

  • Target version changed from CoCoA-5.?.? to CoCoA-5.1.2 summer 2015

#9 Updated by John Abbott over 8 years ago

  • Estimated time set to 4.44 h

The current solution (emacs sending a commented copy of the region) is not very pretty, but it does achieve more or less what Anna wants (except for the succession of prompts).

Solving this issue properly probably requires modifying the interpreter (to stop it from printing prompts after receiving each line); this seems like a rather difficult and intrusive change for a mere cosmetic issue.

JAA is inclined to propose that we accept the current behaviour, and not dedicate any more time to this "minor" issue. Can we close this now?

NOTE we could make this a task for a hapless student >-}

#10 Updated by John Abbott over 8 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 60 to 100

Anna agrees with my assessment in comment 9. So closing this issue.

I have also added it to #242: possible tasks for students (poor blighter).

Also available in: Atom PDF