←back to thread

538 points todsacerdoti | 2 comments | | HN request time: 0.001s | source
Show context
klntsky ◴[] No.44358290[source]
It is sad that we have to know how to configure tens of small utilities just to be productive. I ended up using emacs with some packages that I configure minimally, after spending a few hundreds of hours on ricing the shell, file managers, tmux, etc
replies(3): >>44358353 #>>44358366 #>>44358801 #
agentultra ◴[] No.44358353[source]
Emacs is why I can't go back to terminals.
replies(2): >>44358546 #>>44358955 #
iLemming ◴[] No.44358955[source]
With Emacs one can do some shit in terminal that otherwise would just sound absurd. Like

- in Emacs' Eshell, one can pipe results in and out of buffers, e.g., you can run a command, then pipe it to grep/ripgrep, then pipe the results into a buffer (without any intermediate files).

- Conversely, you can read a buffer content and pipe it into a command.

- Or you can do simple calculations, you just need to use prefix notation e.g. `* 3 42` or `(* 2 pi)`.

- You can run regular emacs functions, like `dired .` or `magit-status`, `find-file ~/foo` or `(calendar)`.

- Or you can use Emacs vars and functions directly, e.g., `cd $org-directory`, or `cd (projectile-project-root)`, or `mkdir (format-time-string "backup-%Y%m%d")`

- You can absolutely delegate some (potentially long running) tasks to run in an outside terminal. I wrote this command eshell-send-detached-input-to-kitty¹, it uses Kitty Terminal's socket control feature.

There are integrations that you can only dream about, one recent example is John Wiegley (creator of Eshell) and Karthik (author of gptel package) having to experiment with piping things in and out of LLMs.

Sure, the backwards is also possible - you can emacs from a terminal, but terminaling from inside emacs is way more cooler.

___

¹ https://github.com/agzam/.doom.d/blob/main/modules/custom/sh...

replies(2): >>44361105 #>>44363453 #
adastra22 ◴[] No.44363453[source]
Why is any of that absurd? That seems like typical terminal stuff.
replies(1): >>44367452 #
umanwizard ◴[] No.44367452[source]
Not really. The point is you're interacting with the full-blown Lisp development environment that is emacs and all the software it contains. A normal terminal doesn't let you reach into the internals of the software you're running in it, it just lets you chain that software together in predetermined ways.
replies(1): >>44371482 #
adastra22 ◴[] No.44371482[source]
All the thugs you listed could be done within the shell. Shells are very programmable.
replies(2): >>44371548 #>>44378460 #
umanwizard ◴[] No.44371548{3}[source]
Imagine I launch an email client like Thunderbird from the shell. In a separate window I want to write a script that takes the currently displayed mail message in that client and runs "grep" on it. I can't do that, unless the authors of the email client have gone out of their way to expose an API that allows you to manipulate its state programmatically.

In emacs, you can do this, because your email client is a package written in Lisp and running in the globally shared context of the emacs interpreter, so you can directly query its state. And if you don't know the names of the variables to query, you can trivially jump into the source code and start figuring it out. Furthermore, there is a 99.9% chance the state is implemented using well-known emacs primitives like buffers, whereas for general programs launched from the shell there is no standard set of UI and text manipulation libraries.

There isn't functionality in bash to magically jump to the C++ source code of Thunderbird or read variables from its internal state, which is the key difference.

replies(1): >>44372602 #
1. adastra22 ◴[] No.44372602{4}[source]
And now we're talking about something entirely different.
replies(1): >>44372889 #
2. umanwizard ◴[] No.44372889[source]
How? Interacting with the state of emacs software is exactly what the OP was talking about.