public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Per Bothner <per@bothner.com>
To: kawa@sourceware.org
Subject: kawa binary snapshot with domterm-based console
Date: Sat, 18 Jun 2016 16:29:00 -0000	[thread overview]
Message-ID: <81a7a345-da39-eb5e-98fd-775f0a1d9103@bothner.com> (raw)
In-Reply-To: <0f5f97f6-e993-f6e0-d20d-8305c33bb542@bothner.com>

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/

      parent reply	other threads:[~2016-06-18 16:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-06 16:04 kawa binary snapshot Per Bothner
2016-06-06 20:44 ` Jamison Hope
2016-06-18 17:26   ` Per Bothner
2016-06-18 16:29 ` Per Bothner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=81a7a345-da39-eb5e-98fd-775f0a1d9103@bothner.com \
    --to=per@bothner.com \
    --cc=kawa@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).