Live data from Hacker News

Run programs in Emacs buffer, seeing their output inline, interactively

github.com

21–30 of 39 posts

Re: Run programs in Emacs buffer, seeing their output inline, interactively

#21

Tangentially, has there been any work in having more structured scrollback, say one buffer for every command, which can be collapsed, pinned or copied individually? Presently there's the minor annoyance when (accidentally) running any program with lots of output, which is that all the scrollback above it becomes inaccessible. Yeah, could have run them in different splits or redirected to begin with, but sometimes you…

Is this different from cells in a notebook (eg Jupyter)?

I would guess, that it is running code directly using the interpreter of the respective language and does not require an "IKernel". As such it does not require you to install Jupyter or its many dependencies. I guess you only need the correct configuration of Emacs and the language's interpreter/compiler.

Another difference might be, that the result is just the result, not some structure in a JSON file, like it would be in a Jupyter notebook.

Re: Run programs in Emacs buffer, seeing their output inline, interactively

#25
post #2

This is useful! Are there other packages on MELPA that provide similar functionality?

There is lively.el [1]! It is also on MELPA in a more recent version [2]. It allows to put an elisp expression into any buffer and then replaces that with the output in a time interval or manually. I use that frequently. [1] https://lukego.livejournal.com/23379.html [2] https://github.com/purcell/lively/tree/348675828c6a81bfa1ac3...

Wow this package rocks!

Re: Run programs in Emacs buffer, seeing their output inline, interactively

#26
post #22

kakoune includes this by default with the pipe operator. very useful functionality.

And vim with :term [0] https://vimhelp.org/terminal.txt.html#%3Aterminal

oh excellent, i’ve been using mostly vim recently and didn’t realize this was available

Re: Run programs in Emacs buffer, seeing their output inline, interactively

#27
I looked through all of the example files, and it generally looks cool. I won’t use it for personal reasons: I like to keep my Emacs configuration simple. Really simple, currently 82 lines https://github.com/mark-watson/emacs_setup/blob/main/.emacs using straight.el.

I love seeing projects like this, but I seldom use them. Emacs out of the box, with my really simple configuration, supports all programming languages I use as well as my markdown-based book writing activities.

Re: Run programs in Emacs buffer, seeing their output inline, interactively

#28
in my first exposure to emacs I had used it in high school with “C Shape Edit” as an interface to alpha_1 CAD software at the Utah CS department. Just executing lines in the buffer, and waiting for a rerender on the ultrasparc

https://www.cs.utah.edu/gdc/projects/alpha1/

Re: Run programs in Emacs buffer, seeing their output inline, interactively

#29

Tangentially, has there been any work in having more structured scrollback, say one buffer for every command, which can be collapsed, pinned or copied individually? Presently there's the minor annoyance when (accidentally) running any program with lots of output, which is that all the scrollback above it becomes inaccessible. Yeah, could have run them in different splits or redirected to begin with, but sometimes you…

M-x shell and simple variations (https://github.com/pjj/Emacs-nsh) allow for infinite scrollback, separate histories, comint-based or plain emacs navigation, and ease the manipulation of arbitrary output. Occasionally I close a shell buffer if the output has exceeded a GB or so, but they typically last weeks or months and I never lost info. They are not full terminals, so not everything works and I bind a lot of terminal-only commands (htop, nvtop) to execute in vterm.

Re: Run programs in Emacs buffer, seeing their output inline, interactively

#30

I am loving the latest Emacs Renaissance! All you can eat buffet, but you can take your lunch (and dinner) home :) OTOH, org-mode already does this, without any need for external package and minimal config. It works really well, too!

> I am loving the latest Emacs Renaissance!

This repository hasn't been updated in 6 years, and is over 12 years old.

And as someone pointed out, Org mode could already do this.

Not really part of the Renaissance.

Post reply on HN