6 ms·
Run programs in Emacs buffer, seeing their output inline, interactively
- kaiwen1 4y agoThis is useful! Are there other packages on MELPA that provide similar functionality?
- findingaway 4y agoOrg mode provides a supercharged version of this functionality that will work for any language as long as you can point it to an appropriate runtime. It's definitely a little more verbose, since you have to declare the language and stuff inside the org mode syntax, but I'm sure that you could get it to work ad-hoc with a little hacking. https://orgmode.org/worg/org-contrib/babel/ https://orgmode.org/worg/org-contrib/babel/
- merlincorey 4y ago`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-Blocks.html https://orgmode.org/manual/Evaluating-Code-Blocks.html
- aesyondu 4y agoOrg+babel is probably my favorite thing about emacs, magit being a close second. I tried doing Literate Programming using this blog as my guide http://fgiasson.com/blog/index.php/2016/06/21/optimal-emacs-settings-for-org-mode-for-literate-programming/ http://fgiasson.com/blog/index.php/2016/06/21/optimal-emacs-..., but I got burned out pretty quickly. I think my problem was I put literally everything in a single README.org file, and it was so taxing scrolling up and down. I might try again but with multiple org files.
- xenodium 4y agoExtending 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-revisited 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 https://xenodium.com/org-babel-objective-c-support
- ghosty141 4y agoThe first link is really impressive. Amazing what can be achieved with so little code/configuration.
- robertkrahn01 4y agoThere 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 https://lukego.livejournal.com/23379.html [2] https://github.com/purcell/lively/tree/348675828c6a81bfa1ac311ca465aad813542c1b https://github.com/purcell/lively/tree/348675828c6a81bfa1ac3...
- hajovonta 4y agoWow this package rocks!
- unhammer 4y agohttps://blog.sulami.xyz/posts/literate-calc-mode/ 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.
- edrx 4y agoRelated: http://angg.twu.net/eepitch.html#test-blocks http://angg.twu.net/eepitch.html#test-blocks
- sen_armstrong 4y agoTangentially, 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 don't know beforehand. And being able to reuse the output of a slow command after the fact would be handy too. I was thinking that this'd be a feature of the terminal, but on second thought the terminal doesn't know where one command begins or ends, so it'd have to be the shell that saves the output.
- wilsongoode 4y agoIs this different from cells in a notebook (eg Jupyter)?
- zelphirkalt 4y agoI would guess, that it is running code directly using the interpreter of the respective language and does not require an "I<language>Kernel". 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.
- mickeyp 4y agoEShell 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-mastering-eshell 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 to jump back up.
- xenodium 4y ago
- BeetleB 4y agoWould love to see a comparison with Org's Babel.
- BaculumMeumEst 4y agokakoune includes this by default with the pipe operator. very useful functionality.
- elteto 4y agoAnd vim with :term <cmd> [0] https://vimhelp.org/terminal.txt.html#%3Aterminal https://vimhelp.org/terminal.txt.html#%3Aterminal
- BaculumMeumEst 4y agooh excellent, i’ve been using mostly vim recently and didn’t realize this was available
- mmsnberbar66 4y agooh cooool thanks!!! do you know how to make the output in the terminal cleaner? for example `:term ls -lah /` isn't well formatted
- elteto 4y agoInteresting. Looks “ok” to me. What’s broken for you?
- e3bc54b2 4y agoI 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!
- EFreethought 4y agoMore like an all you can eat buffer. *rimshot* Thank you, I am here all week.
- importgravity 4y agoCame 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?
- BeetleB 4y ago> 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.
- pjmlp 4y agoLisp Machines say hi! https://www.youtube.com/watch?v=o4-YnLpLgtk https://www.youtube.com/watch?v=o4-YnLpLgtk
- meken 4y agoWould love if there was a gif in the README, so I could get a feel for this (even more important because the whole selling point is interactivity).
- masukomi 4y agoi have this thought for SO MANY TOOLS. gif, screenshot, anything to make me not install it and run it just to find out it wasn't what i wanted / needed.
- Rediscover 4y agoAs a slightly sight-impaired user (no colors, and I never could learn/figure-out icons (fsck they bother me!)), I really enjoy "screen-shots" but I really wish there was a text alt-image that would render in lynx or emacs-w3m through emacspeak. For the exact same reasons You are mentioning. Thanks.
- hajovonta 4y agoI tried with Python and it didn't work, possibly because the helper is written in Python 2.x and the repo is rather old (at least in Python terms) Might work for elisp though.
- mark_l_watson 4y agoI 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 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.
- prpl 4y agoin 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/ https://www.cs.utah.edu/gdc/projects/alpha1/
- ltbarcly3 4y agoThis is known as a shell.