This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

kawa binary snapshot with domterm-based console


The latest Kawa snapshot:
  ftp://ftp.gnu.org/pub/gnu/kawa/kawa-2.1.9-20160618.zip
supports a completely new console (REPL) window (as started by -w).

Before, when you created a new REPL window using -w (or no arguments
in an environment with no Console) Kawa would create a Swing-based REPL:
  http://per.bothner.com/blog/2007/ReplPane/
This Swing-based REPL is no longer the default.  Instead, Kawa uses
DomTerm (http://domterm.org/) running in a JavaFX WebView.

One advantage of DomTerm over the Swing console is that it is compatible
with JLine3 (as mentioned in my 06/06 message), so you get Line3's
multi-line editing. history, tab-completion etc.  You can disable JLine3 with
the command-line flag console:use-jline=no, in which case you get DomTerm's
builtin line-editing (based on WebKit's contenteditable support), which
includes basic history support (up/down-arrow but no history search).

The DomTerm+JLine3 combination works out-of-the-box on Windows, using
the binary snapshot.

Another big advantage of DomTerm is you can "print" HTML expressions,
including images and SVG.  See the http://domterm.org for some examples.
For example to print a cat image:

#|kawa:1|# #<img src="http://pics.bothner.com/2013/Cats/06t.jpg"/>

You can also control the appearance of the DomTerm window using a
CSS stylesheet.  The new domterm-load-stylesheet procedure takes a literal
stylesheet (and an optional name, defaulting to "kawa") and loads it.
For example:

#|kawa:2|#  (domterm-load-stylesheet "div.domterm { background-color: yellow }")
To load from a stylesheet file use the '&<' load-whole-file syntax:

(domterm-load-stylesheet &<{foo.css})
or:
(domterm-load-stylesheet &<[filename-expression])

The Swing console is still available, if you specific the command-line
flag console:use-domterm=no or if DomTerm fails to load (if JavaFX
or the domterm.jar are missing).

I've also implemented interrupt handing: If you have an infinite loop,
you can interrupt it with ctrl-c (at least on my Fedora Linux system).
(When jline is enabled, asit is by default, there are glitches in
ctrl-c handling that I haven't worked out yet.)

--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]