Live data from Hacker News

Making IELM (Emacs Lisp REPL) More Comfortable

n16f.net

11–20 of 29 posts

Re: Making IELM (Emacs Lisp REPL) More Comfortable

#11

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

Forgot to add, also checkout Rash, made in racket, you can combine bash commands with racket

https://rash-lang.org/

Re: Making IELM (Emacs Lisp REPL) More Comfortable

#12
post #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…

If we're in the business of listing alternative ways to evaluate elisp (not to diminish IELM or the elisp modes of course), I can think of two other common ways to evaluate elisp.

* Eshell (launched with M-x eshell) is a shell in Emacs which uses a language that has elements from elisp. In particular, expressions in parentheses are evaluated as elisp forms [1]. Eshell is a shell (like e.g. bash), so it also has syntax to conveniently evaluate external commands, though it lacks some common shell functionality such as job control [2] and some types of redirection [3].

* Org Babel elisp source blocks [4,5]: In Org mode, use "#+begin_src elisp" and "#+end_src" to delimit lines with elisp and evaluate using C-c C-c, which will, by default, insert the result of the evaluation below the source block. This can be useful, if you want to keep a more organized record of the evaluated commands and their results in comparison to a REPL.

[1] https://www.gnu.org/software/emacs/manual/html_mono/eshell.h...

[2] https://www.gnu.org/software/emacs/manual/html_mono/eshell.h...

[3] https://www.gnu.org/software/emacs/manual/html_mono/eshell.h...

[4] https://orgmode.org/manual/Working-with-Source-Code.html

[5] https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-...

Re: Making IELM (Emacs Lisp REPL) More Comfortable

#13

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.

I've written about all the different methods here:

https://www.masteringemacs.org/article/evaluating-elisp-emac...

Re: Making IELM (Emacs Lisp REPL) More Comfortable

#14

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

Same here. Been struggling to remember idiomatic ways to write Elisp. But now with ChatGPT as a tutor I am writing a ton of Elisp to do all sorts of non trivial text transformation stuff, things I‘d have used Python for.

Re: Making IELM (Emacs Lisp REPL) More Comfortable

#15

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…

Author of the blog post here. Not only is it still in use, but I rely on it all the time because I find inline evaluation (M-:) unusable for anything but the simplest command. At the very least I want to visualize the output of the command without it being replaced in the echo area by the next message, and I may want to copy it.

And of course now I have a persistent history of all commands.

Thank you!

Re: Making IELM (Emacs Lisp REPL) More Comfortable

#16

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.

"I somehow have been using Emacs for 15 years without knowing existed"

could be the emacs manual title (or any large system tbh)

Re: Making IELM (Emacs Lisp REPL) More Comfortable

#17

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 always M-x ielm every time I want to modify something in my Emacs or try out a new package before modifying my init.el.

Such a useful tool even if elisp has limited debugging capabilities :)

Re: Making IELM (Emacs Lisp REPL) More Comfortable

#18

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 discovered ielm last year and it is a great tool. so much so that i wish emacs started with it opened. if you want to do exploration of emacs via elisp extensions ielm is an essential tool i think. thank you sir for your work!

Re: Making IELM (Emacs Lisp REPL) More Comfortable

#19

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.

I've been using Emacs for over 30 years without ever needing such a thing. Just evaluate in scratch, keep what you want, delete the rest.

Re: Making IELM (Emacs Lisp REPL) More Comfortable

#20

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.

I have been using Emacs ~50 years, and I have always hoped all of the history would be visible as lisp-expressions which you could view and modify in interactive mode.

It is somewhere there because undo knows it. Typical example is that you fumble something splendid/stupid with fat fingers and then cant figure out what you just did.

Post reply on HN