Live data from Hacker News

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

github.com

11–20 of 39 posts

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

#11
post #8

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…

EShell in Emacs can preserve point at the prompt that executed the command. You can then hit space to page through the output, or start typing to immediately jump to the end of the buffer (and thus a blank prompt): https://www.masteringemacs.org/article/complete-guide-master... There's also `C-c C-p` to jump to the previous command prompt in the likes of M-x shell. That's not quite what you want, but it's another way…

Also eshell imenu support can be enabled https://xenodium.com/imenu-on-emacs-eshell

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

#12
post #2

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

`org-mode` has the ability to evaluate code blocks and store the output in a following results block[0]. You can configure it to run just about everything in various ways and therefore you can do Literate Programming in nearly the full Knuth sense in it. I find it's a good solution for a local "notebook" similar to IPython/Jupyter Notebooks but for any language in Emacs. [0] https://orgmode.org/manual/Evaluating-Code…

Extending org babel to support other languages is fairly accessible. I had a lot of fun getting SwiftUI to rendering inline https://xenodium.com/previewing-swiftui-layouts-in-emacs-rev...

Also did a little experiment for Objective-C https://xenodium.com/org-babel-objective-c-support

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

#15

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!

More like an all you can eat buffer.

*rimshot*

Thank you, I am here all week.

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

#16

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…

some people made a dom based terminal ui with block based entries, every command is linked to its output

it was very ambitious but I don't know where it's at now

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

#17

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!

Came here to say this. I use org-mode to do what OP's package is doing. But OP provides some features like

> one keystroke executes all specially-marked lines from a buffer and inserts the results inline

Not sure if we can make such specially-marked lines using org-mode. Never needed this feature myself. But for those who want a workflow like this the new package could be useful. But again maybe there is a way to do this without an external package with a little bit of elisp?

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

#18

Earlier quoted context omitted.

`org-mode` has the ability to evaluate code blocks and store the output in a following results block[0]. You can configure it to run just about everything in various ways and therefore you can do Literate Programming in nearly the full Knuth sense in it. I find it's a good solution for a local "notebook" similar to IPython/Jupyter Notebooks but for any language in Emacs. [0] https://orgmode.org/manual/Evaluating-Code…

Extending org babel to support other languages is fairly accessible. I had a lot of fun getting SwiftUI to rendering inline https://xenodium.com/previewing-swiftui-layouts-in-emacs-rev... Also did a little experiment for Objective-C https://xenodium.com/org-babel-objective-c-support

The first link is really impressive. Amazing what can be achieved with so little code/configuration.

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

#19
post #2

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

https://blog.sulami.xyz/posts/literate-calc-mode/ is pretty nice. I always have literate-calc-minor-mode (+org-mode as major) in my scratch buffer for quick calculations.
Post reply on HN