BlackberryPerfect938 · 2022-12-28 22:36
Compiling in emacs is easy, but i'm getting tired of alt-tabbing to terminal to run my program each time i want to test something, I need a separate emacs command for running commands in eshell, that functions similarly to M-x "compile" and "recompile"
So i wrote mini-script with M-x "eshell-run" and "eshell-rerun" commands.
If anyone is interested i will create github repo and will probably try to turn this into a full package.
[https://pastebin.com/k5SdBH3r](https://pastebin.com/k5SdBH3r)
rwilcox · 2022-12-29 01:11
I do like how - and I think I’m reading the elisp right here - that the results go into a special results buffer?
That’s kinda neat. I have a similar run in eshell thing but it depends on you switching out to the eshell buffer and looking. But that is awkward if you have a lot of eshell buffers open (and I do)
BlackberryPerfect938 · 2022-12-29 05:19
input goes into eshell buffer named *eshell-run*, and also the output. So i guess you are correct.
arthurno1 · 2022-12-29 08:36
> Compiling in emacs is easy, but i'm getting tired of alt-tabbing to terminal to run my program each time i want to test something, I need a separate emacs command for running commands in eshell,
Have you tried M-! or M-&? It will run shell-command (or async-shell-command) from the minibuffer, so you don't need to open terminal at all. To output will be opened in a separate text buffer in case you need to analyze it, search, used in another interactive command etc.
BlackberryPerfect938 · 2022-12-29 10:06
Yes i did try, but it could be faster. The idea is that you can press one shortcut ant it reruns command without any prompt, leaving output in other (eshell) buffer.
I'll try to rewrite my script to use shell-command (M-!) instead of eshell when i have time.
CorysInTheHouse69 · 2022-12-29 10:06
Have you tried `M-x async-shell-command`
deaddyfreddy · 2022-12-29 10:45
There's https://git.sr.ht/~niklaseklund/detached.el
providing substitutes for some popular shell-related commands, see the example from README:
(use-package detached
:init
(detached-init)
:bind (;; Replace `async-shell-command' with `detached-shell-command'
([remap async-shell-command] . detached-shell-command)
;; Replace `compile' with `detached-compile'
([remap compile] . detached-compile)
([remap recompile] . detached-compile-recompile)
;; Replace built in completion of sessions with `consult'
([remap detached-open-session] . detached-consult-session))
:custom ((detached-show-output-on-attach t)
(detached-terminal-data-command system-type)))
And the "arrow" history scrolling is also there.