[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/forth-mode 9812d1decd 114/153: Use /interperter to setup t
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/forth-mode 9812d1decd 114/153: Use /interperter to setup terminal personalty |
Date: |
Sat, 29 Jan 2022 08:02:24 -0500 (EST) |
branch: elpa/forth-mode
commit 9812d1decd3a2b6b79ba81373c83679a2325ab94
Author: Helmut Eller <eller.helmut@gmail.com>
Commit: Helmut Eller <eller.helmut@gmail.com>
Use /interperter to setup terminal personalty
In SwiftForth /interperter seems to initialize something needed
to stop it from resetting the terminal personality.
* backend/swiftforth.fth (repl): Use a custom REPL. Let's see how that
works.
(accept-no-echo): New.
(winning-personality): Overwrite ACCEPT. Even though echoing is part
of the spec, it makes little sense in a comint buffer.
---
backend/swiftforth.fth | 36 ++++++++++++++++++++++++++++++++++--
1 file changed, 34 insertions(+), 2 deletions(-)
diff --git a/backend/swiftforth.fth b/backend/swiftforth.fth
index e93425de83..62990042ba 100644
--- a/backend/swiftforth.fth
+++ b/backend/swiftforth.fth
@@ -1,6 +1,23 @@
: 2null 0 0 ;
: big-size 200 100 ;
+\ Similar to ACCEPT but doesn't display the received characters.
+\ Reads one line (whithout trailing newline).
+: accept-no-echo ( addr u1 -- u2 )
+ tuck
+ begin ( u1 addr u )
+ dup 0= if 2drop exit then
+ key
+ case
+ \ remove \n and \r
+ 10 of nip - exit endof
+ 13 of endof \ FIXME: should detect \r\n sequences properly
+ 2 pick c!
+ 1 /string
+ 0
+ endcase
+ again ;
+
create winning-personality
4 cells , 19 , 0 , 0 ,
' noop , ' noop , ' noop ,
@@ -19,6 +36,21 @@ create winning-personality
' 2drop , \ at-xy
' 2null , \ get-xy
' big-size , \ get-size
- 'accept @ ,
+ ' accept-no-echo , \ accept
+
+:noname cr ." ok " ; is prompt
+: clearstack ( ... -- ) begin depth 0> while drop repeat ;
+: repl
+ winning-personality open-personality /interpreter
+ \ Could just call QUIT but running our own REPL is cooler.
+ begin
+ state @ 0= if prompt then
+ \ NOTE: refill prints a space (don't ask me why)
+ refill 0= abort" refill failed"
+ source ['] evaluate catch
+ ?dup if cr ." Error: " .catch cr
+ clearstack
+ then
+ again ;
-winning-personality open-personality
+repl
- [nongnu] elpa/forth-mode 6f18e1c20e 011/153: Tweak syntax table., (continued)
- [nongnu] elpa/forth-mode 6f18e1c20e 011/153: Tweak syntax table., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 6efdba0686 029/153: Remove dependency from forth-mode to forth-block-mode., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode b69527cdd2 084/153: SwiftForth shouldn't concern itself with terminal settings., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 90c1ec5293 032/153: GitHub README., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 813620cae9 034/153: Run hooks before starting an interactive Forth session., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 6dcd29382f 015/153: Make the forth-interaction-send callback optional., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 68d740e7ae 042/153: Empty files are not block files., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 745e1d8388 039/153: Document key bindings., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 5df1f95c26 044/153: Speedbar support., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 794c9efd01 021/153: Use require and provide instead of load, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 9812d1decd 114/153: Use /interperter to setup terminal personalty,
ELPA Syncer <=
- [nongnu] elpa/forth-mode 5aa3a700b0 016/153: Improve killing an interactive Forth session., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 2869bc25e4 085/153: Create a terminal personality for SwiftForth., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 8d1d8ea795 099/153: Re-add test for 'syntax-propertize-function., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 55de74bb4f 033/153: Query Forth session about defined words., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 44dd013096 059/153: Remove terminal escape sequences from strings returned from Forth., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 399fd00921 055/153: Fix killing interactive Forth., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 56bbc06a16 079/153: Error out if byte compilation fails in Emacs 23., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 531c9e11e2 023/153: Add autoload cookie to extension configuration, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 847481f866 061/153: Tweak window handling., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 5a08c82adb 111/153: Improve word movement commands inside symbols., ELPA Syncer, 2022/01/29