Closed ellerh closed 7 years ago
Using the evalutation version, I get
SwiftForth i386-Linux 3.6.3 29-Jun-2016
include /tmp/x.fs
include /tmp/x.fs Can't read file
If I add some code to /tmp/x.fs
, it works.
There may be another problem that truncates the echoed Forth output to just include /t
. I still have work to do in the forth-interaction-send
function to make it more reliable.
include /tmp/x.fs Can't read file
Actually, I also get this is the file is empty (also outside of Emacs).
A slightly better test case is:
printf ': foo ;' > /tmp/x.fs && emacs -Q -nw -L /scratch/forth/forth-mode/ -l forth-interaction-mode -eval '(progn (setq forth-executable "swiftforth") (setq process-coding-system-alist (quote (("swiftforth" . raw-text-dos)))) (run-forth) (insert "include /tmp/x.fs"))'
When I press Enter in this new test case, the end result is:
SwiftForth i386-Linux 3.6.3 29-Jun-2016
include /tmp/x.fs
include /tmp/x.fs ok
And entering words
indicates that foo
was defined.
I'm guessing SwiftForth turns off terminal echoing, but running in comint mode doesn't honour that.
Found the problem: the width end height argument to set-process-window-size
in run-forth
are in reverse order. And I used an 80x20 xterm and the *forth*
window was then only 11 lines and SwiftForth interpreted that as 11 columns. You can reproduce without Emacs by running SwifthForth in narrow xterm with 10 columns or so.
Looks like a device personality would be very useful to avoid such "surprises".
Yes, reproduced with a narrow xterm. I suppose this is the GET-SIZE
vector being called.
Try this:
:noname 100 100 ; 'get-size !
Hopefully, b69527c fixes this.
So SwiftForth truncates all lines that are longer than the width returned by GET-SIZE
.
I guess forth-interaction-send
should keep that in mind.
An idea would be to temporarily increase the width e.g. with set-process-window-size
.
@ellerh Can you test the swiftforth branch?
swiftforth.el is loaded with require
so it seems that the coding sytem etc. is not initialized when restarting the subprocess.
Right. I'll close this issue and create a new one for that problem.
When I start Emacs like so:
touch /tmp/x.fs
emacs -Q -nw -L /scratch/forth/forth-mode/ -l forth-interaction-mode -eval '(progn (setq forth-executable "swiftforth") (setq process-coding-system-alist (quote (("swiftforth" . raw-text-dos)))) (run-forth))'
then type "include /tmp/x.fs" in the
*forth*
buffer, I get this: