Project

General

Profile

Feature #1358

Emacs UI: should active input line be cleared before sending line from CoCoA-5 file?

Added by John Abbott over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
EmacsUI
Target version:
Start date:
30 Oct 2019
Due date:
% Done:

100%

Estimated time:
1.88 h
Spent time:

Description

When using the Emacs UI, possibly confusing problems can arise if the user has started to type some input in the executing cocoa5 window, but does not press enter, then switches to a cocoa5 source file and chooses send-line or source-region or source-file

Do we want to clear the active input line when send-line or source-region or source-file are called?

Discuss, decide, implement.


Related issues

Related to CoCoA-5 - Support #1387: John's visit Feb 2020Closed2020-01-07

Related to CoCoA-5 - Bug #1412: Emacs UI: font sizeClosed2020-02-05

History

#1 Updated by John Abbott over 4 years ago

I think it is probably a good idea to clear the last line (assuming this can be done reasonably easily in emacs).

I have occasionally myself typed something accidentally into the interactive CoCoA-5 buffer (but without hitting return), then switched to another buffer with CoCoA-5 source code, and finally been puzzled as to why a "source" command did not work.

It would be harder to "protect against" a mistake where the user typed in a line with return (but without semicolon); the interpreter will already have received the line, and will be awaiting the end of the command. If we want, we could get some mild protection by sending a semicolon immediately before the source command (not sure if this is really a good idea).

#2 Updated by John Abbott over 4 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 30

I have a first version which seems to work: after (goto (point-max)) I have inserted (move-beginning-of-line nil) and then (if (not (eq (point) (point-max))) (kill-line)). Note that (kill-line) alone does not work well because it triggers a bell (i.e. error signal) if the line is empty.

A quick test suggests that it works OK. I'll use it for a few days before checking in.

I have not implemented the idea of inserting a semicolon at the start of the line.

NOTE my changes can be found by looking for (goto (point-max)).

#3 Updated by John Abbott over 4 years ago

I noticed quite a lot of "almost duplication" in the cocoa5.el file. We should try to reduce that: more work for no visible progress :-/

#4 Updated by Anna Maria Bigatti over 4 years ago

Tried on two (oldish) version of emacs.
Both work.

#5 Updated by John Abbott over 4 years ago

  • Assignee set to John Abbott
  • % Done changed from 30 to 60

Checked into CVS.
I had added a fn for sending a string to the running cocoa5 buffer; I have not yet altered any functions to use it.

#6 Updated by John Abbott about 4 years ago

  • Target version changed from CoCoA-5.4.0 to CoCoA-5.3.0

I think the function that I added is the following...
(defun cocoa5-send-string (cocoa5-input-line)...)

I prefer to consider using this when in Genoa.

#7 Updated by John Abbott about 4 years ago

#8 Updated by John Abbott about 4 years ago

  • Related to Bug #1412: Emacs UI: font size added

#9 Updated by John Abbott about 4 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 60 to 100
  • Estimated time set to 1.88 h

This has been working trouble-free for 3 months. Closing.

Also available in: Atom PDF