Giter VIP home page Giter VIP logo

clj-swingrepl's Introduction

clj-swingrepl

Swing Clojure REPL that uses BeanShell's JConsole component.

Build

Run

You can run lein swank and connect with SLIME via Emacs, or you can build a distributable jar with lein uberjar

To run, use something like java -jar swingrepl-standalone.jar

Todo

  • Completions for things available in the current namespace: JConsole has its own completions mechanism that might be hooked into
  • Bracket, parentheses, quote completion/matching/highlighting
  • Better as-library behavior: provide configurable automatic imports

Notes

  • A Clojure implementation of something like JConsole might be nice

Thanks

Many props to the BeanShell dude for making such a cool REPL.

Copyright 2012 Alan Dipert Distributed under the Eclipse Public License, the same as Clojure.

clj-swingrepl's People

Contributors

akhudek avatar alandipert avatar dakrone avatar ivan avatar phillord-ncl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

clj-swingrepl's Issues

Implement common readline shortcuts (ctrl-a, ctrl-e)

ctrl-a and ctrl-e are handy shortcuts that work in terminal-based REPLs, so they should probably work in clj-swingrepl too. There are more shortcuts in this category (yank?).

ctrl-a conflicts with "Select all" though, so maybe this should be customizable.

Colorize *err* output

It would be nice if clj-swingrepl colored the *err* output red.

I recall SLIME/Swank doing something like this.

Use SystemLookAndFeel by default

clj-swingrepl should use SystemLookAndFeel by default, and there should be a new option to disable this or set the look-and-feel.

Before that is implemented, Linux users can start Java with:
-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel

and Windows users with:
-Dswing.defaultlaf=com.sun.java.swing.plaf.windows.WindowsLookAndFeel

project.clj does not work with Leiningen 2

There are multiple issues.

  1. :hooks [leiningen.hooks.javac] no longer exists?
  2. Something that causes this when lein running:

Exception in thread "main" java.lang.RuntimeException: java.lang.ClassNotFoundException: org.dipert.swingrepl.main

Add user function for setting the window title

If I open several clj-swingrepls, they all have the title "Clojure 1.x.y REPL". It would be nice to provide a function (title "my title") to set the window title after the REPL has already been started.

Backspace/Delete allows modifying REPL history

Backspace and Delete handling is broken in several cases. The characters [ and ] below are used to indicate the beginning and end of the text selection, respectively. The character | is used to indicate the cursor position.

In this state, pressing Backspace or Delete causes the prompt text to be deleted:

[user=> ]|"xyz"

the same happens in this state:

[user=> "xy]|z"

JConsole should not permit deleting the prompt text.

In this state, pressing Backspace or Delete does not delete anything:

us|[er=> "xyz"]

JConsole should instead delete the input text without deleting any of the prompt text.

Slow-motion memory leak causing java.lang.reflect.InvocationTargetException

Keeping a clj-swingrepl open for a day (192MB heap, 64 bit Java 7u3, Windows) sometimes causes a memory leak and subsequent tracebacks:

java.lang.reflect.InvocationTargetException
        at java.awt.EventQueue.invokeAndWait(EventQueue.java:1242)
        at javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1346)
        at bsh.util.JConsole.invokeAndWait(JConsole.java:794)
        at bsh.util.JConsole.print(JConsole.java:545)
        at bsh.util.JConsole.inPipeWatcher(JConsole.java:725)
        at bsh.util.JConsole.run(JConsole.java:734)
        at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.OutOfMemoryError: Java heap space

Ctrl-D sometimes propagates to other windows

Pressing Ctrl-D to close a clj-swingrepl window sometimes propagates the key/close event to another window, closing more than the REPL than you intended to close. This happens even if the other REPL is in another process.

Tested on Windows; might not happen elsewhere.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.