3 ms·
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
by School-Cotton 1y ago
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.
- adastra22 1y agoAnd now we're talking about something entirely different.
- School-Cotton 1y agoHow? Interacting with the state of emacs software is exactly what the OP was talking about.