Git Product home page Git Product logo

inf-clojure's People

Contributors

adamfrey avatar arichiardi avatar austinhaas avatar ayato-p avatar bbatsov avatar charignon avatar danielcompton avatar doglooksgood avatar dotemacs avatar dpsutton avatar e-a-griffin avatar hlolli avatar inc0n avatar jafingerhut avatar jasonkdarby avatar jjttjj avatar mahinshaw avatar mavbozo avatar mikepjb avatar otijhuis avatar oyvindstegard avatar p4v4n avatar priyatam avatar robertarandolph avatar runswithd6s avatar sashton avatar slipset avatar syohex avatar thblt avatar winterbeardo 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

inf-clojure's Issues

Company: An error occurred in auto-begin

Hii @bbatsov

I'm trying to setup the cljs/clj REPL with the inf-clojure mode on Spacemacs.

After some guidance from ClojureScript wiki , the Planck REPL setup and README.md from inf-clojure repo I've set it up as following

(defun cljs-node-repl ()
  (interactive)
  (let ((default-directory "~/.emacs.d/private/snippets/cljs_repl/"))
    ;(shell-command "ls")
  (run-clojure "lein trampoline run -m clojure.main node_repl.clj")))

So, the basic thing is working fine but I keep getting this error

Search failed. This means there is unmatched expression somewhere or we are at the beginning/end of file.
Company: An error occurred in auto-begin
Company: backend company-capf error "Wrong type argument: listp, WARNING:" with args (candidates de)
Company: An error occurred in auto-begin
Company: backend company-capf error "Wrong type argument: listp, WARNING:" with args (candidates def)

which means the company backend isn't setup correctly, I guess. Could you please tell me how to correct this?

Thanks :)

No such namespace: complete.core in lumo REPL

This happens if the very first operation in the REPL is a completion.
The error:

cljs.user=>              ⬆
WARNING: No such namespace: complete.core, could not locate complete/core.cljs, complete/core.cljc, or Closure namespace "" at line 1 
             ⬆
WARNING: Use of undeclared Var complete.core/completions at line 1 
complete is not defined
	 (evalmachine.<anonymous>:1:1)
	 ContextifyScript.Script.runInThisContext (vm.cljs:44:33)
	 Object.runInThisContext (vm.cljs:116:38)
	 (Object.lumoEval)
	 lumo.repl.caching_node_eval (NO_SOURCE_FILE <embedded>:6133:194)
	 (NO_SOURCE_FILE <embedded>:5372:29)
	 x (NO_SOURCE_FILE <embedded>:5373:13)
	 Object.cljs.js.eval_str_STAR_ (NO_SOURCE_FILE <embedded>:5374:28)
	 Function.cljs.js.eval_str.cljs$core$IFn$_invoke$arity$5 (NO_SOURCE_FILE <embedded>:5377:508)
	 Object.lumo.repl.execute_text (NO_SOURCE_FILE <embedded>:6265:240)

cljs.user=> (redu)

It seems related to the fact that inf-clojure-repl-type has not yet been set.

Expected behavior

It should show completions for (redu.

Actual behavior

It prints out a warning and an error.

Steps to reproduce the problem

Trigger inf-clojure with lumo -d. In the REPL terminal start typing (redu.

This is extremely important! Providing us with a reliable way to reproduce
a problem will expedite its solution.

Environment & Version information

Lumo 1.5.0
ClojureScript 1.9.562
Node.js v8.1.0

inf-clojure version information

master

Emacs version

24.5.1

Operating system

Linux EP-LL-10020 4.4.0-78-generic #99-Ubuntu SMP Thu Apr 27 15:29:09 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

inf-clojure-eval-region always sends a newline to inf-clojure process, even when not needed

Currently inf-clojure-eval-region always sends a newline after sending the region text.

This often leads to showing multiple prompts because in most cases the region already contains a newline at the end. Then you end up with something like this:

{:a 1}
user=>
user=>

Would be nice if it only added a newline when it doesn't have one already. Can create a PR if you like.

Anything special needed for .cljc eval?

I'm trying to eval stuff from this ns which contains some basic cljc stuff.

Now whenever I do that I get the following exception:

clojure.lang.LispReader$ReaderException: java.lang.RuntimeException: Conditional read not allowed
             java.lang.RuntimeException: Conditional read not allowed
clojure.lang.Compiler$CompilerException: java.lang.IllegalArgumentException: No matching ctor found for class org.martinklepsch.cc_set.impl.CustomComparatorSet, compiling:(/var/folders/ss/4qg3hk1d4nv40phg1360ng5w0000gn/T/boot.user1393283433339272685.clj:6:25)
     java.lang.IllegalArgumentException: No matching ctor found for class org.martinklepsch.cc_set.impl.CustomComparatorSet
clojure.lang.LispReader$ReaderException: java.lang.RuntimeException: Unmatched delimiter: )
             java.lang.RuntimeException: Unmatched delimiter: )
clojure.lang.LispReader$ReaderException: java.lang.RuntimeException: Unmatched delimiter: )
             java.lang.RuntimeException: Unmatched delimiter: )

I guess this is the critical bit:

[...] compiling:(/var/folders/ss/4qg3hk1d4nv40phg1360ng5w0000gn/T/boot.user1393283433339272685.clj:6:25)

It seems that the evaluation saves the relevant form to a file and evaluates this file(?) while assuming .clj file extension. At least that's how it looks to me :o)

I'm using Boot which might also be the culprit here although I couldn't discover any obvious places in the code that writes to-be-evaluated expressions to a file.

If you think it's unlikely this is related to inf-clojure feel free to close this :)

inf-clojure-set-ns hangs Emacs

Expected behavior

Changing inf-clojure repl namespace with inf-clojure-set-ns

Actual behavior

Emacs hangs, and I have to kill it from my process manager. I tested this with different clojure source code projects and both lein repl and boot repl and it made Emacs hang consistently for me.

Steps to reproduce the problem

  • Run inf-clojure
  • Evaluate one clojure buffer with C-c C-k
  • Change to another clojure buffer
  • Run inf-clojure-set-ns

Environment & Version information

inf-clojure version information

20170710.708

Lein/Boot version

Lein 2.7.1
Boot 2.7.2-SNAPSHOT

Emacs version

25.1.1

Operating system

Ubuntu 17.04

Newline in the wrong place on input (lumo)

I have tried this in lumo not in clojure.

Expected behavior

I expect:

speed-of-light.core=> (clojure.core/in-ns 'speed-of-light.aws)
...result...

Actual behavior

Now we see:

speed-of-light.core=>
(
clojure.core/in-ns 'speed-of-light.aws)
...result...

Steps to reproduce the problem

Execute any command except like in-ns, doc, ... in a lumo repl.

Environment & Version information

inf-clojure version information

latest master

Lein/Boot/Lumo version

Lumo 1.2.0

(add-hook 'clojure-mode-hook #'inf-clojure-minor-mode) yields cryptic error

Hello, the evaluation of the form
(add-hook 'clojure-mode-hook #'inf-clojure-minor-mode)

leads to the error message
(inf-clojure-minor-mode clojure--check-wrong-major-mode)

Here is my code to load the minor mode via a hook:

(setq dldir "c:/Users/xyz/Downloads/")

(setq clj-mode (concat dldir "clojure-mode-master/clojure-mode-master"))
(add-to-list 'load-path clj-mode)
(require 'clojure-mode)

(setq inf-clj (concat dldir "inf-clojure-master/inf-clojure-master"))
(add-to-list 'load-path inf-clj)
(require 'inf-clojure)
(add-hook 'clojure-mode-hook #'inf-clojure-minor-mode)

And here is my emacs configuration:

GNU Emacs 25.0.94.2 (x86_64-w64-mingw32)
of 2016-05-26 built on KAEL
Windowing system distributor 'Microsoft Corp.', version 6.1.7601
Configured using:
'configure --prefix=/tmp/emacs --without-imagemagick 'CFLAGS=-O2
-fomit-frame-pointer -g0''

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND DBUS NOTIFY ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS

Important settings:
value of $LANG: ENU
locale-coding-system: cp1252

Major mode: Fundamental

Minor modes in effect:
recentf-mode: t
tooltip-mode: t
global-eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
buffer-read-only: t
line-number-mode: t
transient-mark-mode: t

Recent messages:
Directory has changed on disk; type g to update Dired
Quit
Inf-Clojure minor mode enabled in current buffer
or: No Clojure subprocess; see variable ‘inf-clojure-buffer’
(inf-clojure-minor-mode clojure--check-wrong-major-mode) [2 times]
Undo!
C-x C-g is undefined
Quit
(inf-clojure-minor-mode clojure--check-wrong-major-mode)
Mark set [5 times]
Quit [2 times]

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message format-spec rfc822 mml mml-sec
epg epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mail-utils inf-clojure easy-mmode comint ansi-color ring misearch
multi-isearch ffap thingatpt url-parse auth-source cl-seq eieio byte-opt
bytecomp byte-compile cl-extra cconv eieio-core gnus-util mm-util
help-fns help-mode mail-prsvr password-cache url-vars recentf
tree-widget wid-edit dired clojure-mode cl-macs gv rx derived edmacro
kmacro easymenu align imenu cl-loaddefs pcase cl-lib time-date mule-util
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel dos-w32 ls-lisp disp-table w32-win w32-vars term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment
elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan
thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
slovak czech european ethiopic indian cyrillic chinese charscript
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote w32notify dbusbind w32
multi-tty make-network-process emacs)

Memory information:
((conses 16 143227 6144)
(symbols 56 22806 0)
(miscs 48 246 170)
(strings 32 26531 4779)
(string-bytes 1 758578)
(vectors 16 15800)
(vector-slots 8 483980 9868)
(floats 8 227 217)
(intervals 56 3750 1413)
(buffers 976 24))

Error: custom-declare-variable: Doc string is missing

Upon upgrading inf-clojure, this error shows up when running inf-clojure:

custom-declare-variable: Doc string is missing

I believe this is due to the latest commit here.

The offending lines are here, where inf-clojure-macroexpand-command and inf-clojure-macroexpand-1-command require docstrings.

Would be happy to do a PR, but I'm not sure what to name docstring to give them.

comint-output-filter: (wrong-type-argument markerp nil)

Debugger entered--Lisp error: (wrong-type-argument markerp nil)
  comint-output-filter(#<process inf-clojure> "nREPL server started on port 4001 on host 0.0.0.0 - nrepl://0.0.0.0:4001\n")

I tried this in various projects and with various inf-clojure-program settings, but always end up there.
(I tried boot repl, boot repl -c, lein repl.) I set those via (setq inf-clojure-program "...").

I learned that the error indicates that the process evaluates to nil but since it seems to have started properly I don't understand how this is possible. Also when I kill the *inf-clojure* buffer it tells me that there's a process attached to it and I have to type yes to actually kill it.

Any guidance on how to debug that further would be greatly appreciated :)

Namespaced maps not fully supported

When I introduce a newline in a namespaced map, it seems to break the reader:

kb.views=> #::mb{:a 1 :b 2}
#:kb.models.messagebox{:a 1, :b 2}
kb.views=> #::mb{:a 1
                 :b 2}

RuntimeException EOF while reading, starting at line 1  clojure.lang.Util.runtimeException (Util.java:221)

Eldoc support

Figure out if it's possible to turn this into proper eldoc support. Unfortunately for some reason it works super slow (unlike the completion code).

with boot

I tried to use it with a REPL provided by boot
(setq inf-clojure-program "boot repl --client")

and it won't work

        clojure.lang.ExceptionInfo: java.lang.AssertionError: Assert failed: host and/or port not specified for REPL client
                                     (and h p)
data: {:file "/tmp/boot.user4441562975407246733.clj", :line 15}

java.util.concurrent.ExecutionException: java.lang.AssertionError: Assert failed: host and/or port not specified for REPL client
(and h p)
java.lang.AssertionError: Assert failed: host and/or port not specified for REPL client
(and h p)
boot.repl-client/client repl_client.clj: 10

             clojure.core/apply                          core.clj:  624
          boot.pod/eval-fn-call                           pod.clj:  174
               boot.pod/call-in                           pod.clj:  181

               boot.pod/call-in                           pod.clj:  184
           boot.pod/call-worker                           pod.clj:  189
    boot.task.built-in/fn/fn/fn                      built_in.clj:  204

             clojure.core/deref                          core.clj: 2200
 boot.task.built-in/fn/fn/fn/fn                      built_in.clj:  206
 boot.task.built-in/fn/fn/fn/fn                      built_in.clj:  205
            boot.core/run-tasks                          core.clj:  327
            boot.user/eval52/fn  boot.user4441562975407246733.clj:   17

clojure.core/binding-conveyor-fn/fn core.clj: 1910

Process inf-clojure exited abnormally with code 1
...
This also happens with the vanilla inferior lisp

Jacking into A Figwheel REPL ?

Hi Guys,

Is it possible to tell inf-clojure which process to launch? I need to launch it with "lein figwheel' so I can jack into a figwheel REPL.

Thank you,

Properly shut down processes

After debugging #40 I noticed that I still have lots of processes in the run state when looking at the *Process List* buffer. It does not seem to matter what/if any dependencies or code is loaded.

Probably my fault but is there a way to properly kill processes? Checked in M-x but couldn't find anything... (I'm using CMD + K now.)

Lumo mode

Hello @bbatsov,

I have a brand new minor mode that I would like to put somewhere 😄

It is a customization of a few vars of inf-clojure and I need some to see what is the right approach for sharing it. I could of course putting it under my name, but it won't be that visible. So I was wondering if clojure-emacs is a good idea for it or you have a better one 💡

Given that there is no way to distinguish automatically cljs files for self hosted from normal ones, I guess this mode could be manually enabled or we can expose some defcustom.

Let me know!

Warnings upon install

Installed inf-clojure and received some warnings upon install. This is on Debian Testing, Emacs 24.5.1, lein 2.7.1 on OpenJDK 1.8. Looks like I'm using clojure-mode version 3.1.0-snapshot (20141101.1?).

Here are the warnings:


Compiling file /home/john/.emacs.d/elpa/inf-clojure-20170507.233/inf-clojure-pkg.el at Mon May  8 14:05:45 2017
Entering directory `/home/john/.emacs.d/elpa/inf-clojure-20170507.233/'

Compiling file /home/john/.emacs.d/elpa/inf-clojure-20170507.233/inf-clojure.el at Mon May  8 14:05:45 2017

In inf-clojure-results-from-process:
inf-clojure.el:943:79:Warning: Use `with-current-buffer' rather than
    save-excursion+set-buffer

In end of data:
inf-clojure.el:1275:1:Warning: the function `clojure-mode-variables' is not
    known to be defined.

Show eval results using overlays

I might be a good idea to copy CIDER's behaviour for showing eval results. Right now we show them only in the minibuffer, but CIDER can show results in the minibuffer, inline using overlays, or at both places at the same time, which is pretty cool (and more consistent with "modern editors").

inf-clojure gets into a bad state after some time

I don't have precise reproduction steps, but after some time evaluating buffers and defuns, the output from these commands stops appearing in the *inf-clojure* buffer, failing with this error:

recursive-edit: Wrong type argument: markerp, nil

Bouncing the REPL (by deleting the process attached to the inf-clojure buffer and killing the buffer) doesn't restore inf-clojure to a good state. I need to restart Emacs to do that.

I haven't been able to produce a precise stack trace -- the debugger doesn't activate even after toggling debug-on-error. However, after putting some print statements in the code, I notice that even when inf-clojure is in a bad state, starting the REPL does result in inf-clojure-preoutput-filter being called with the correct output from lein repl, but the output never makes it into the *inf-clojure* buffer.

I'm using inf-clojure from melpa stable.

REPL hangs after sending long strings

(str "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")

Evaluating the above via inf-clojure results in a single (colored/purple) ^G being printed and the REPL becoming unresponsive. The string is 1016 characters long. Remove one character and it works just fine. The number of ^Gs being printed depends on how much you "overshoot" the 1015 limitation.

I think I noticed this behavior with different Emacs for Mac builds/versions but if you cannot reproduce let me know.

GNU Emacs 25.1.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 10.9.5 (Build 13F1911)) of 2016-09-21

Issues regarding emacs 24

This is not a bug per se, but a particularly annoying issue with emacs 24.

subr-x on emacs 24 does not have when-let, which means that inf-clojure does not work on emacs 24. It so happens that I suspect many installations out there are still emacs 24. When you install inf-clojure on emacs 24 it seems that it might work (the first suspicion is a configuration problem) when really it will not work at all.

So, I have a few suggestions

  1. Support emacs 24 ;) . OK this might be asking too much, but quite a few users are still on 24 and update is not always trivial OR
  2. Put a clear warning on the README that 25 is required AND
  3. Tell people to delete their elpa caches if they upgrade from 24 to 25

Thanks

Make variables safe

Expected behavior

Emacs should not complain for unsafety when configuring inf-clojure-boot-cmd, for instance, in .dir-locals.el.

Actual behavior

It does.

Steps to reproduce the problem

Use this .dir-locals.el in your project and try to load a file, then change inf-clojure-boot-cmd and try to revert-buffer. It should not always ask for confirmation:

((nil . ((inf-clojure-boot-cmd . ("localhost" . 5555)))))

Errors with figwheel repl

I've been working with Figwheel REPL by following the docs here. After the upgrade to v2.0, I've been getting these errors. I ran M-x toggle-debug-on-error but can't seem to get more information.

eldoc error: (args-out-of-range 9561)

The REPL hangs and I cannot type any more expressions. The errors do not appear with the regular inf-clojure REPL.

Downgrading to v1.4.0 makes the errors go away.

Steps to reproduce the problem

  • Use the lein-figwheel plugin and configure Emacs following this guide.
  • Type any ClojureScript expression in the REPL

Environment & Version information

inf-clojure version information

v2.0

Lein/Boot version

Lein v2.7.1
Lein Figwheel v0.5.10

Emacs version

Tested with v24.5 and v25.1

Operating system

Debian Sid

Add special handling for planck REPLs

Basically we need to extend what was done in #44 to cover planck as well, so all the inf-clojure functionality would work with planck properly.

This should be pretty easy and I would have done it myself if I knew the first thing about planck. :-)

Eval buffer?

There is inf-clojure-load-file but I can't find something along the lines of eval-buffer. Maybe that would be a good addition?

Spurious output when first opened in lumo

Expected behavior

When first opening the repl and cursor is on code buffer, only cljs.user => should appear.

Actual behavior

The output of a command (for me it is arglists because the cursor was after fn symbol, but this varies) is printed in the *inf-clojure* buffer.

Steps to reproduce the problem

C-c C-z with popup window enabled and move the cursor around in the code buffer.

or in ielm:

ELISP> (setq inf-clojure-repl-type nil)
nil
ELISP> (inf-clojure-arglist 'defn)
nil

Environment & Version information

inf-clojure version information

Latest master

Lein/Boot version

Lumo latest master

Reminder to self 😓 😬 😀

Rename inf-clojure-mode

I am learning inf-clojure thanks to the really nice video on Lambda Island. I started an inf-clojure subprocess with (inf-clojure "lein figwheel") and this booted up a buffer with a repl. Then I went into my source buffer and of course, like most things, i put it into inf-clojure-mode. This is a mistake however, but not one that is obvious. This mode is used for the process buffer, not the source buffer. The correct thing is to use the minor mode, of course. But this goes against standard convention I think.

I see that inf-clojure-mode is marked interactive but I don't see why this would ever be called by a human. It seems like you invoke a start inf-clojure function and this should put the repl into inf-clojure-repl-mode and then the minor mode would be obvious for the cljs buffer.

So my suggestion would be to make inf-clojure-mode non-interactive and to rename it to indicate that it is for a repl or process buffer rather than source buffer. It should be noted that I've only used it for a few minutes now but just wanted to point out a beginners impression. But its very nice!

Provide or explain how to get completion in Clojure socket REPLs

It looks like what inf-clojure currently uses for completions has been abandoned (aka feature complete?).

Cider uses the wonderful https://github.com/alexander-yakushev/compliment and we probably should as well. It gives you more completion power as well because it accepts a context in input, which it then uses to complete locals, for instance.

It also returns more metadata together with the actual completion and we could feed that to company-mode.

End of File during Parsing: inf-clojure-completions

inf-clojure-completions returns "end of file during parsing" for me:

~/Code/tob/src/tob $ inf-clojure-completions foo
End of file during parsing

I can confirm that the completion command works in the REPL however:

boot.user=> (complete.core/completions "hi")
("hiccup.compiler" "hiccup.core" "hiccup.def" "hiccup.page" "hiccup.util")

Optionally create new buffer on inf-clojure

I started to use this a bit more again 😀 The usual thanks @bbatsov and contributors for your work.

I would like to have inf-clojure create a buffer that is different from the one I am launching it from. Like cider basically.

I understand this of course might be optional and I am already checking switching-buffers. Any hint is super appreciated.

Add a command to connect to a remote REPL

inf-clojure already supports connecting to remote REPLs but the support is pretty lame as it involves setting the host and port in the command inf-clojure uses to start the REPL. It'd be way nicer if there was just an interactive command prompting you for a host and port and connecting to them. This bit of functionality should be pretty easy to implement.

Prompt ghosts: it duplicates and moves!

Expected behavior

I expect the prompt not to appear at all when it displays a result

Actual behavior

2017-03-03-161431_585x142_scrot

Steps to reproduce the problem

I don't have a consistent way yet, working on it

Environment & Version information

-

inf-clojure version information

latest master

Lein/Boot version

Lumo repl

Emacs version

24.5.1

Operating system

Ubuntu

Can and will debug sooner or later, not blocking for now, which is good 😉

Figure out how to handle subprompts

When you pass a multi-line command to the REPL the output gets littered with #_> subprompts. Some possible ways to handle this include converting all REPL input to a single line before sending it to the REPL or adding to code to filter out the REPL subprompts.

Slow response from inf-clojure (completions, arglists, ...)

Don't want to solution here, but it seems like inf-clojure got slower at responding in completions and eldoc/arglists.

It takes a while to see the completion even if it is very minimal, this must have been introduced with the comint buffer redirection. Probably an alternative implementation of inf-clojure--process-response can be attempted.

Eldoc error when running boot repl

Expected behavior

Creates a usable inf-clojure repl using boot repl

Actual behavior

An eldoc error is thrown constantly while typing in the repl

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("\\Ca*true\\Ca*" nil nil)
  #[257 "\301�\302\303�\304���#)\207" [inhibit-changing-match-data "\\Ca*true\\Ca*" nil t string-match] 8 "\n\n(fn STRING)"](nil)
  inf-clojure--response-match-p("(js/global.hasOwnProperty \"$$LUMO_GLOBALS\")" #[257 "\301�\302\303�\304���#)\207" [inhibit-changing-match-data "\\Ca*true\\Ca*" nil t string-match] 8 "\n\n(fn STRING)"] #<process inf-clojure<1>>)
  apply(inf-clojure--response-match-p ("(js/global.hasOwnProperty \"$$LUMO_GLOBALS\")" #[257 "\301�\302\303�\304���#)\207" [inhibit-changing-match-data "\\Ca*true\\Ca*" nil t string-match] 8 "\n\n(fn STRING)"] #<process inf-clojure<1>>))
  inf-clojure--lumo-p(#<process inf-clojure<1>>)
  inf-clojure--detect-repl-type(#<process inf-clojure<1>>)
  inf-clojure--set-repl-type(#<process inf-clojure<1>>)
  inf-clojure-arglists-form()
  inf-clojure-arglists("nREPL")
  inf-clojure-eldoc-arglists(#("nREPL" 0 5 (fontified t face clojure-interop-method-face front-sticky (field inhibit-line-move-field-capture) rear-nonsticky t field output inhibit-line-move-field-capture t)))
  inf-clojure-eldoc()
  eldoc-print-current-symbol-info()
  #[0 "�\204�    \205�\n\303>?\205�\304 \207" [eldoc-mode global-eldoc-mode eldoc-documentation-function (nil ignore) eldoc-print-current-symbol-info] 2]()
  apply(#[0 "�\204�    \205�\n\303>?\205�\304 \207" [eldoc-mode global-eldoc-mode eldoc-documentation-function (nil ignore) eldoc-print-current-symbol-info] 2] nil)
  timer-event-handler([t 0 0 500000 nil #[0 "�\204�    \205�\n\303>?\205�\304 \207" [eldoc-mode global-eldoc-mode eldoc-documentation-function (nil ignore) eldoc-print-current-symbol-info] 2] nil idle 0])

Steps to reproduce the problem

Create an inf-clojure repl buffer with boot repl

inf-clojure version information

20170520.914

Lein/Boot version

2.7.1

Emacs version

25.5.1

Operating system

Ubuntu 17.04

Make it possible to turn off completions in clojure-mode buffers

If the REPL is "busy" inf-clojure will interrupt text entry when editing text in clojure-mode buffers. Some users might not mind, some do. Would be good to be able to disable this via configuration.

Please separate this config from disabling completions in the *inf-clojure* buffer, which you probably always want to have turned on.

Avoid prompting on doc, source, argument inspection

Hi Bozhidar,

I would like to add an option that disables prompting at every inf-clojure-show-* function.
Cider's workflow is way more fluid. I was wondering whether we should have a defcustom for each and every command or a global one. Probably the latter.

Thanks a lot!

Implement ANSI filtering in process responses

Just so that we don't lose information from previous discussions, inf-clojure at the moments does not properly parses or filters out ansi coming from the repl process. This is one of the caveats, we should start our repls with no coloring for it to work properly. Of course socket repl is always the best and most reliable way here.

If folks think it is worth having colors, we can take some inspiration from sbt-mode-comint, or some SO answer.

Introduce a inf-clojure-override-cmd

This is more of a feature than a bug.

Sometimes you are working on some project that has the normal lein or boot structure, but then for instance you have a lumo script.

One thing I do is to override inf-clojure-lein-cmd or inf-clojure-boot-cmd in .dir-locals.el with the lumo command, but it feels hacky and it is probably not very good either for inf-clojure beginners (I know that it was introduced recently, but I liked it better when we did not have any project detection).

This issue is here for discussing either a way to override the mechanism here (if inf-clojure-override-cmd is non-nil we use that and skip the rest for instance), or a way to disable project detection - Emacs users are hackers, so given the function that detects the project, that could be used in .dir-locals.el for choosing the right command.

In any case, humbly asking for suggestions /cc @bbatsov.

Thank you folks ;)

Completion

@dgutov I've tried to implement completion for inf-clojure in a manner similar to what you did for inf-ruby, but I can't get it work. Can you please have a look at the existing code and give me a hint or two?

etags navigation

I've been using etags (via projectile) to do source-code navigation in with M-. and M-*.

Would be nice to add docs how to do this, like configuring exuberant tags to scan .clj files

There are also some code changes to do for handling ns prefixes when finding tags and cycle through results.

Compilation warnings

I got these compilation warnings:

Compiling file /home/guerry/.emacs.d/elpa/inf-clojure-20141204.820/inf-clojure.el at Thu Dec  4 22:44:03 2014
inf-clojure.el:279:1:Warning: Unused lexical argument `do-string'
inf-clojure.el:463:1:Warning: Unused lexical argument `proc'
inf-clojure.el:463:1:Warning: Unused lexical variable `line'

In end of data:
inf-clojure.el:520:1:Warning: the function `clojure-mode-variables' is not
    known to be defined.

Add an interactive command to bounce the REPL

Having a command to bounce a REPL would be helpful, since it's a common thing to do during clojure development.

Related: add a command to kill a REPL. Without this, it won't be clear to most users how to kill the underlying JVM that inf-clojure starts -- I don't believe killing the *inf-clojure* buffer does it.

This interactive command (or one of its helper functions) should take as a parameter the buffer who's REPL should be stopped/restarted, for ease of scripting multi-REPL workflows.

REPL prompt is stored as current input when navigating input history

This applies at least to Emacs 25, I do not know about earlier versions.
0. Start clean Emacs instance with emacs -Q, load up required libs, inf-clojure, clojure-mode...

  1. Start REPL with M-x inf-clojure
  2. Input something and evaluate with RET
  3. Describe variable comint-stored-incomplete-input, which should have the value nil, all OK so far.
  4. Without inputting anything new, navigate to previous history item with M-p
  5. Describe variable comint-stored-incomplete-input again, and now it contains the actual prompt with fontification and all:
    #("user=> " 0 7 ....)
  6. Try going back to current input with M-n, and the prompt gets inserted as actual "restored incomplete input", which is clearly wrong. So you end up with "user=> user=> ". This causes even bigger problems when using the default read-only-prompt setting (navigating history stops working properly).

inf-clojure-load-file default behavior not to switch to repl

Hi,
I found myself using this fn a lot more and do not wan to to switch to repl by default, which takes over one of my windows that has a file I am looking at. And I do not see any way to disable it. Can we make it optional? I would be happy to do a PR. Thanks

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.