Live data from Hacker News

Making IELM (Emacs Lisp REPL) More Comfortable

n16f.net

21–29 of 29 posts

Re: Making IELM (Emacs Lisp REPL) More Comfortable

#21

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.

Googled it and there is already

    (global-undo-tree-mode)
    (setq undo-tree-auto-save-history t)
    (setq undo-tree-history-directory-alist '(("." . "~/.emacs.d/undo")))
I did not know that.

Re: Making IELM (Emacs Lisp REPL) More Comfortable

#22
post #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...

This is a great guide!

Re: Making IELM (Emacs Lisp REPL) More Comfortable

#23
post #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!

There’s also C-h e for those times when you want to review what was displayed in the echo area. Very handy.

Re: Making IELM (Emacs Lisp REPL) More Comfortable

#24

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’m so pleased to see it’s still in use!

I feel it’s pretty essential to using emacs.

Re: Making IELM (Emacs Lisp REPL) More Comfortable

#25

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 used chapGPT to figure out how to get the same information that appears in *buffer-list* - it was a pretty quick session.

Re: Making IELM (Emacs Lisp REPL) More Comfortable

#26

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.

I think C-h l (lossage) shows the keys and function names.

Re: Making IELM (Emacs Lisp REPL) More Comfortable

#27
post #26

Earlier quoted context omitted.

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.

I think C-h l (lossage) shows the keys and function names.

Yes it does.

Why did not I know that?

-- Because (view-lossage) is weird name for this.

Re: Making IELM (Emacs Lisp REPL) More Comfortable

#28
post #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!

On M-: -- My typical approach is to use the scratch buffer, where I can evaluate multiple things and remember the outcomes, macroexpand etc. So, M-: isn't the only alternative to IELM, but there are also things that scratch doesn't work well with, especially when it comes to figuring out what current buffer is, saving point position, debugging, probably more. So, yeah, for more serious stuff, IELM is better.

Re: Making IELM (Emacs Lisp REPL) More Comfortable

#29
post #26

Earlier quoted context omitted.

I think C-h l (lossage) shows the keys and function names.

Yes it does. Why did not I know that? -- Because (view-lossage) is weird name for this.

Agree ... I don't know where the name comes from, but I've become used to it since I use C-h l frequently.

I asked chat gpt about it, and what it said seemed to match what I found when I googled it:

> In Emacs, “Lossage” refers to a section in the GNU Emacs Manual that describes how to recognize and deal with situations in which Emacs does not work as expected1. For example, it covers issues such as keyboard code mixups, garbled displays, running out of memory, and crashes and hangs1.

> There is also a command called view-lossage that displays the last 300 input keystrokes2. You can use open-dribble-file to record all your input on a file2.

Post reply on HN