j3rn / inf-elixir Goto Github PK
View Code? Open in Web Editor NEWAn Emacs plugin for interacting with an Elixir REPL
License: GNU General Public License v3.0
An Emacs plugin for interacting with an Elixir REPL
License: GNU General Public License v3.0
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:
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.
I have the following situation:
(get-env "PATH")
and exec-path
include ~/.asdf/shims
inf-elixir
gives me an error because erl is not foundFrom 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.
https://help.github.com/en/github/building-a-strong-community/adding-a-license-to-a-repository
Would suggest to use the MIT license.
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"))
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).
[1]: Yeah, you could also hit the up arrow until you get the block on the prompt, but that's less fun
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)
As a user I have the following setup:
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:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.