Giter VIP home page Giter VIP logo

inf-elixir's Introduction

Hi there ๐Ÿ‘‹

inf-elixir's People

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  avatar  avatar

inf-elixir's Issues

duplicate display of intermediate prompt, and truncates lines at 4096 characters

We ran into this in inf-ruby (nonsequitur/inf-ruby#172) and I was trying out other repl's to see if they have the same issue. Basically pty on linux has a maximum line length of 4096 characters. python-mode solves this by simply saving the region to a temp file and evaling the temp file, if the length is over comint-max-line-length.

Another minor display issue is it shows extra intermediate prompts, for example:
2023-09-25-174443_1146x262_scrot
It'd be nicer if it didn't show a bunch of duplicate ...(n)> when you eval some region. Some repl like tuareg-mode for ocaml solve this by spawning the repl with a cli option to not display intermediate prompts on multiline input. Some repl like python-mode solve this by sending multiline input as a singleline string with newline escaped and running it with a single eval statement.

It'd be nice if comint mode could somehow solve this in general rather than every language repl running into these two issues and making their own solution, but I'm not really sure what comint could do about it.

Send env variables to subprocess

I have the following situation:

  • Elixir and erlang are installed through asdf
  • (get-env "PATH") and exec-path include ~/.asdf/shims
  • calling inf-elixir gives me an error because erl is not found
  • Using exec-path-from-shell solves my problem

From what I understand the problem is that iex isn't running with the proper PATH in its env. I'm using linux mint and emacs 29.1.50.

No REPL running in

With this configured:

  (use-package elixir-mode)
  ;; https://github.com/tonini/alchemist.el/issues/371 Alchemist is dead for now.
  ;; (use-package alchemist
  ;;   :diminish alchemist-mode)
  (use-package erlang)
  (use-package inf-elixir
    :bind (("C-c i i" . 'inf-elixir)
	   ("C-c i p" . 'inf-elixir-project)
	   ("C-c i l" . 'inf-elixir-send-line)
	   ("C-c i r" . 'inf-elixir-send-region)
	   ("C-c i b" . 'inf-elixir-send-buffer)))

I run inf-elixir, see the iex buffer start, and then inf-elixir-send-line causes error message No REPL running in.

And I'm just starting to learn elixir with https://elixir-lang.org/getting-started/introduction.html so the directory has just one file, scratch.ex, for the tutorial code.

I'm using:

GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu) of 2020-03-26, modified by Debian
;; Author: Jonathan Arnett <[email protected]>
;; URL: https://github.com/J3RN/inf-elixir
;; Package-Version: 20210315.1723
;; Package-Commit: b526ce852886d1863163e054fcbbcbb83c55b32a
;; Keywords: languages, processes, tools
;; Version: 2.0.0
;; Package-Requires: ((emacs "25.1"))

Pop-out buffer editor

I frequently find myself working in IEx and needing to write some code that's longer than a single line (e.g. a module). While you can write multi-line code into IEx (either by submitting each line, the next prompt will be ...(n)>, or in inf-elixir you can hit C-M-j instead of Ret to get a newline without submitting), I think it would be nicer if there was a way to trigger a buffer opening with the current line you're editing that you can keep working in, and then submit your finished code when you're done. Also, you should be able to keep that buffer open in case you need to rewrite/update that block of code you wrote[1]

Firefox's dev tools have this feature for the JavaScript interpreter; it's triggered with C-S-b on Windows/Linux (probably C-s-b on Mac).

Firefox dev code editor

[1]: Yeah, you could also hit the up arrow until you get the block on the prompt, but that's less fun

Tab completion should work

Currently there's a literal tab inserted. I have no clue how either the Emacs or the IEx side work - I'm gonna dig for a bit but will probably never finish so logging this so someone competent hopefully takes a shot :)

Thanks for creating this, it's pretty much exactly what I was looking for! I'm working on making Emacs super nice for Elixir by hooking up something like https://github.com/rustyio/sync and an automated test runner, and an inferior IEx is the starting point I was missing.

(Seems to be a common issue. fsharp/emacs-fsharp-mode#184 for example)

Add an option to do not switch to repl buffer on send command group

As a user I have the following setup:

  • open a elixir code buffer on the left side;
  • open a inf repl buffer on the right side;

Whenever I experiment with a function or a variable I evaluate it by either: inf-elixir-send-buffer once I've switched to file, inf-elixir-send-region or inf-elixir-send-line. That works, but I found tedious to switch back to the source code buffer every time after the evaluation.

Proposal:

  • add a custom variable to make the switch to a repl buffer being optional.

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.