Live data from Hacker News

Making IELM (Emacs Lisp REPL) More Comfortable

n16f.net

1–10 of 29 posts

Re: Making IELM (Emacs Lisp REPL) More Comfortable

#3
This is a blast to see. I wrote IELM at least 25 years ago, when I was learning eLisp and was frustrated there wasn’t a REPL to help me try commands and learn it. I remember it being quite a thrill when the FSF wrote to me and asked me to assign the copyright so it could be bundled with Emacs. I’m so pleased to see it’s still in use!

I do remember I had to use an awful hack to make it work. Comint expects data from a pipe, but eLisp output is internal to Emacs. The details are hazy now, I but I think I pushed the eval result as stdin to a ‘cat’ process for Comint to ingest the output. I wonder if that ever got cleaned up…

Re: Making IELM (Emacs Lisp REPL) More Comfortable

#4

This is a blast to see. I wrote IELM at least 25 years ago, when I was learning eLisp and was frustrated there wasn’t a REPL to help me try commands and learn it. I remember it being quite a thrill when the FSF wrote to me and asked me to assign the copyright so it could be bundled with Emacs. I’m so pleased to see it’s still in use! I do remember I had to use an awful hack to make it work. Comint expects data from a…

I use IELM regularly, so thanks for writing it!

Looking at ielm.el, it appears it now defaults to hexl, which is part of the Emacs distribution, as cat might not exist on non-Unix platforms. That's wrapped in a condition-case call though, and will still call cat if that fails.

Re: Making IELM (Emacs Lisp REPL) More Comfortable

#6

This is a blast to see. I wrote IELM at least 25 years ago, when I was learning eLisp and was frustrated there wasn’t a REPL to help me try commands and learn it. I remember it being quite a thrill when the FSF wrote to me and asked me to assign the copyright so it could be bundled with Emacs. I’m so pleased to see it’s still in use! I do remember I had to use an awful hack to make it work. Comint expects data from a…

omg this comment is amazing, I am using IELM almost everyday as a REPL for emacs (it's not uncommon for me to open buffers from either eshell or ielm directly). Thanks so much for your work on this.

Re: Making IELM (Emacs Lisp REPL) More Comfortable

#7
I'm loving emacs a lot more now because of chatGPT, being able to ask quickly how to do XYZ in dired mode, or get a some elisp function to combine two common operations, it's been nice being able to just ask and get the answer in 20 seconds rather than reference the emacs manual

Re: Making IELM (Emacs Lisp REPL) More Comfortable

#8
Two alternatives to also know about, if you're new to Emacs Lisp.

* Lisp Interaction mode (like in your `scratch` buffer). Press `C-j` to eval the expression to left of the point, and insert the result in your buffer. Then you can leave the result there, edit it into a new code, undo to hide it, etc.

* Emacs Lisp mode (like when you're editing any `.el` file) can also do a lot of things that people normally do in a REPL. Say, you're working on some code in the file, and it's running, and you want to change one of the functions. Just edit the function in the file, and hit `M-C-x` to evaluate the `defun` that the point is in, and see the value in the echo area. Or evaluate a region, or the entire file. (At one point, I also had a pretty-printer hooked up, so that it could do better transient display of values.) You can also selectively instrument functions for Edebug from here.

This seems simple today, but it used to blow away the development languages and tools most people were using.

Re: Making IELM (Emacs Lisp REPL) More Comfortable

#9

I somehow have been using Emacs for 15 years without knowing such a thing existed. I've been using lisp-interactive-mode for this purpose.

Yeah, it's interesting that Emacs has ended up with lisp-interactive-mode as the primary "REPL" (even though it's not exactly the same thing). Kind of like the type-anywhere interactive input in Commodore BASICs vs using a dedicated line.

Re: Making IELM (Emacs Lisp REPL) More Comfortable

#10

I'm loving emacs a lot more now because of chatGPT, being able to ask quickly how to do XYZ in dired mode, or get a some elisp function to combine two common operations, it's been nice being able to just ask and get the answer in 20 seconds rather than reference the emacs manual

I'll give this a try later. I do recommend learning how to use info mode though, it's very powerful.
Post reply on HN