by Zobat · 1y ago · 0 comments
n.b. I'm a C# developer that has accepted my fate and use Visual Studio to earn a living, though I've made sure I know my tool, flaws and merits, better than most developers I've met/worked with. My first job as a programmer was writing C++ code in Emacs and can't remember anything negative about that experience (other than getting used to ctrl+x, ctrl+s for saving and, by reflex, doing the same in Excel, and losing a big part of the document that I had just selected to move, because Excel couldn't undo past last save).
Reading the (at the time I'm writing this) 13 comments on this post I see mentions of at least three lightweight programs that does this. What other than "the mountain is there" makes someone think Emacs would be the tool for this? As a Resolve user I know what tool I'd reach for even if using a multi GB, Hollywood grade, non linear editor, compositor and color grader for trimming a short video clip is about as ridiculously overpowered as using a sledge hammer to press a key (and I did exactly that just a few days ago).
Like I said, I'm most likely not "getting it", on multiple levels. Please educate me, why would I use Emacs for this or any of the page upon page of "strange" use cases you find if you search for "Emacs" here on HN. I know Emacs is a powerful editor but I can't for the life of me understand why I would use it to trim video clips.
In Emacs, I have all the tools I need for dealing with text - thesaurus, spell-checking, definition and etymology lookup, search engines, translation, LLMs, etc. Why, oh why, wouldn't I ever try typing anything longer than two words in anything else?
Like, for example, while typing this very comment, I may come across a thought: "I think I already made a similar comment some time ago, let me find it..." What would a regular user do? They'd switch to the browser, navigate to HN, scroll to the bottom, type search query, lookup on the page, jump to the next, keep paging until they find it, copy, switch back, paste... What would an experienced Emacs user do? They'd search for it without ever leaving their editor, grab the stuff from the buffer and paste it - all within just a few keystrokes. Or if I need to find a url in my browser history - I'd just search for it and insert in-place - two keystrokes+search query.
It's not just faster - it is profoundly satisfying and liberating. It gives you the feeling of being in control. You don't have to deal with the quirks of specialized apps; you don't need to memorize tons of their specific keybindings; it gives you a straight path to extracting or injecting plain text.
That's why those who never made a wholehearted attempt to use Emacs just never get it. And those who have, never can understand why others don't even try to recognize the value.
One's personal transformation, changed perspectives, or new capabilities are real empirical evidence - just not the kind that satisfies scientific methodology's requirements for generalizability.
I never even hinted at attempting to prove it to be universally paradigm-shifting for everybody, but I can certainly vouch for its profound impact on thousands of users based on their direct experience.
It isn't a hobby, because Vim and Emacs allow me to perform in a way that I consider far more enjoyable, productive and satisfactory than I ever had before them. That is of course on a personal empirical basis - I cannot promise them having the same effect on anyone else.
In my opinion, after many years using many different tools, techniques, ideas and methodologies, frameworks, approaches, systems, platforms, workflows, philosophies, paradigms, strategies, practices, concepts, models, theories, and experiments, I personally find these two to be exactly the paradigm shift — in comparison to my prior experience when I didn't have them.
But let me be more specific - the paradigm shift I see is not in Emacs or Neovim as tools themselves. The paradigm shift I sense is in the grand ideas behind these tools - modal navigation and Lisp.
I honestly don't know why more people don't gravitate towards these ideas. Perhaps, because these ideas are kind of like 'meditation' - people say one can only experience the mind shift after practicing it for some time. I wouldn't know - I never practiced mediation for long. And that time required to see the shift can differ for every person - some may grok it quickly, for some, it may take decades without ever even clicking.
Also, you're wrong about "upgrading one's workshop" - it's a misconception that longtime Emacs users constantly have to tweak their configs. My config for example is pretty stable; I often make changes to it not because I have no choice, but because the task at hand calls for it. I write a lot of Lisp because it's an instrument for achieving specific goals and solving specific puzzles - work for which I get paid real amounts of real money. I get paid to use Emacs, not the opposite. So, no: definitely not a hobby.
They would if there was a bit more GUI introduction. Seriously functional menus and visual indication of modes. With hints from graphical to the faster keyboard sequences.
> I honestly don't know why more people don't gravitate towards these ideas. Perhaps, because these ideas are kind of like 'meditation' - people say one can only experience the mind shift after practicing it for some time.
idk this reads a lot like tl;dr: it's a hobby.
I guess the path to Emacs was more of a possibility/probability earlier in my career and I might find it later but for now I'll alt+tab to the browser and/or open a new tab when I need to look up any etymology and stick to navigating around Visual Studio like a pro while they still pay me to do it.
Like you, though, I work in orgs that are very Windows heavy, so I tend to use it more for my personal stuff rather than in my day job
Well, just like I said - you're not getting it, we're talking past each other. It isn't about a "single interface" - not about cramming everything into one window, it's rather about seamless workflow integration. It's like having a command center that orchestrates your existing tools, rather than replacing them. The power isn't in the interface - it's in the programmable glue between your tools.
You say: "I'd open a new tab if I need etymology..." Sure, on the surface it feels like a fair point. However, when you have the ability to request something from any tool or service "at-point", right in the middle of typing a sentence or solving a specific task - it simplifes so many things, and you tend to use those tools more. It's basic psychological phenomenon called 'convenience effect'.
But that's the only half story of it. Here's the practical example I often use as an evidence. I use Google Translate, alright? On its own there's nothing special about it - other editors and IDEs, also probably have integrations like that if not even nicer with GTranslate or some other translating service, right? Yet check this out. I'm learning Spanish, and when I want to translate something like "Colonel was born in 1968", what would GTranslate do? It would translate the text leaving the numbers intact, and that's totally expected. But guess what? I am trying to gain better familiarity with numbers in Spanish, I really do need to see them in their written form.
How long do you think it took me to solve that little personal discomfort? No longer than fifteen minutes. First, I needed to find out what actually was sending the payload to GTtranslate endpoints. I launched Emacs' built-in profiler and performed a task of translation. I found the function. Then I advised it. Advising is an Emacs Lisp mechanism to prepend, append or override the behavior of any given function - built-in or third-party. So, I figured that if I convert the numbers to text first, then send the payload with that text instead of numbers, it will work exactly as I wanted.
I couldn't even find an implementation of numbers-to-word in Elisp, and I didn't want to spend any time trying to write one. So I delegated the task to an npm package. Now, my advising function adjusts the behavior of 'translate' function (that sends the payload) by detecting the numbers in the text and then runs nodejs, changing the payload, so GTranslate spits out: "Coronel nació en mil novecientos sesenta y ocho"
Did I have to write my own browser extension for that? Nope. Did I have to figure out how GTranslate endpoints work? Nope - I didn't even have to open their documentation page. Did I have to re-implement the entire command that sends the payload? Nope - I just needed to tweak one, specific aspect of it, with extreme granularity - the body of the function is ten lines long. If that's not some blackmagickfuckery, I don't know what that is. Maaaan, I wish someone has showed me some shit like that when I was much younger.
> Perhaps I'm just a little too lazy to learn that stuff
Here's a thing about ideas - and don't consider Emacs as a concrete tool, a mere editor, but think of the fundamental idea behind it. You don't need to "learn" ideas. You just have to cultivate some level of curiosity about them. Sure, you may later have to spend considerable time learning the concrete tools behind those ideas, but absorbing the idea is the first step.
And grokking basic fundamentals about the idea of Lisp is pretty trivial - one just needs to learn mainly two things - structural editing and REPL-driven development. Some may argue that even those are not specifically necessary to begin the journey.
You know how the "do" in Taekwondo, Judo, Aikido, Karate-do stands for "path" or "way"? There's no truly "learning" Aikido, you either practice it or you don't. It's a lifelong practice rather than something you "master" or "complete." The idea of Lisp is similar - it's not really something you "learn" in the traditional sense and then move on from. You practice thinking in Lisp.
The fundamental principles of Lisp - code as data, the power of the REPL, recursive thinking, functional approaches - these aren't just techniques you acquire. They become a way of approaching problems, a mindset you cultivate through practice. The practice never really ends - it just deepens.
I haven't done any martial arts, so I'm just spitting words here, but I bet, if I ask anyone who practiced Aikido for a long time if it makes their lives any better, I bet they'd tell me some koans about zen master pouring tea or some other shit that I'd immediately dismiss as complete bullshit, so I wouldn't blame you if you take my words the same way.
> I guess the path to Emacs was more of a possibility/probability earlier in my career
Just like Aikido welcomes practitioners at any age or stage of life, Lisp is always ready for new practitioners. The fundamental principles align here in more ways than one could imagine - "the journey is the destination", "wisdom over athleticism", etc. Many people discover their deepest appreciation for Lisp (or Aikido) later in life, when they have the patience and perspective to appreciate the subtleties. The best time to start is always now.
FWIW, Org Mode is what a native Emacs user might reach for as alternative to Jupyter notebooks: https://michaelneuper.com/posts/replace-jupyter-notebook-wit... That doesn’t imply that you should both try Emacs and replace Jupyter! Just be aware that if either you are using Jupyter for your own reasons or working with like-minded team there is an alternative which may be preferable for your use-case.
You could probably get it working locally for yourself but in corporate environments it can be annoyingly hard.
org-mode is a better choice, but note that it's not specialised for Python (which is good and bad) so you may need to wire up some stuff (I mostly use R for personal stuff and that works very well).
I haven't used terra.bio, but this works for any text box, so should just work.
Of course, emacs has modes for Jupiter and other notebooks, as well a Org Mode and a way to run code from Org Mode to function similarly to such notebooks, just you can execute code in any language, not just python, and can then immediately use the results in the rest of your file, including tables. You can even reference tables in your code blocks.
https://www.youtube.com/watch?v=ud3Gmxg5UZg - Browsing Reddit and HackerNews In Emacs (7 minutes).
If you don't want to watch it:
https://github.com/thanhvg/emacs-hnreader - for browsing HN.
https://github.com/thanhvg/emacs-reddigg - for browsing Reddit.
https://github.com/agzam/consult-hn - for searching through HN.
https://github.com/agzam/browser-hist.el - for browser history.
It saddens me how people of Emacs often reject vim navigation outright, just as the broader programming community tends to dismiss the fundamental ideas that drive Emacs.
Neither represents a dogmatic religion, nor do they embody fundamental, conflicting truths about computing. No one needs to choose one and commit to it exclusively - they are simply tools, built upon some brilliant foundational concepts. Understanding and utilizing the ideas behind them may literally transform your life in mind-blowingly positive ways. I wish more people contemplated this profound truth, instead of thinking they have to stick with one, particular way of things.
For example, I use the Verb package for making HTTP requests. So with Emacs as my HTTP client, I can do bulk HTTP request calls with keyboard macros. The HTTP requests can be stored in org-mode. I can write custom Elisp for special authentication scenarios. I can create new commands if I need them.
For this example, I can imagine (haven't used this myself) scenarios like creating a keyboard macro to shave off the first X seconds of a video usable with dired.
Some non-text-editing things in Emacs that are actually extremely useful:
- Git via Magit
- Managing files with Dired
- Media player with Emms
- RSS feeds with elfeed
and the list goes on and on...
Using a well thought-out Emacs interface for anything is one of the biggest sources of joy in my technical life.Something in your comment made me remember a DOS based file "explorer". Screen split down the middle with a folder-tree and file list on both sides. I remember hardly ever turning on the computer without starting that for one task or another. That was some serious UI pleasure, at least for the time. Ha, found it:
https://handwiki.org/wiki/Software:File_Commander
Ah, the nostalgia!
https://www.gnu.org/software/emacs/manual/html_node/emacs/Di...
For your consideration, I built a keyboard-driven menu interface for Dired called Casual to help with discovery. https://kickingvegas.github.io/casual/Dired.html
Looking at the code for this solution (https://github.com/xenodium/dotsies/blob/main/emacs/ar/video...), it's under 400 lines (excluding the require of three very common libraries and an ffmpeg dependency). I'm not actually sure I could pull off this feature in 400 lines of JavaScript (and the binding logic for going from node to ffmpeg isn't going to come to my fingertips nearly as fast as the logic for emacs LISP, although I know that varies from person-to-person).
Plus, once it's in emacs it can glue to other things. If I want to grab video from an email and trim it, I have tools in emacs to fetch particular emails, etc.
I think the most reasonable way to think about emacs hacks like this is "I could do this in a shell script... But why would I when emacs gives me interactivity, a REPL, and the advantages of buffer manipulation as a metaphor?"
It won’t require switching to a browser. It won’t require creating an account. No going to the app store. No license consent. No dangerous program warning. No turn on notifications. No unlock premium features. No an update is available. No marketing emails. No cookies.
It’s just gonna STFU and do what it says it does in a way that makes sense. And if it is good enough, it’s good enough. It won’t add bullshit to your day.
[0] recent example from here: a proto social network that runs via org-files-over-http (as if we didn't have a markup language designed for http already) https://news.ycombinator.com/item?id=44889354
Org-mode is far more than just a markup. It is executable - you can have executable code-blocks (in different languages) that interact with one another. It is interactive - there are TODO items, agendas, and scheduling that integrate with your workflow. It has built-in calendar, deadlines, and habit tracking. It has spreadsheets with calculations, like in Excel. It is insanely programmable. I use it for various things, even some unexpected like managing my dotfiles - simpler and more predictable than Nix or Stowed, org-mode creates an 'immutable' version of my system.
Sure, it is also a markup, but the markup is just the interface to a much richer computational document model.
So, what you're finding to be weird is only because you are unfamiliar with it. It is in fact highly pragmatic, and there's nothing weird about it; you just have not experienced that firsthand, and that's alright.
I think Emacs is basically an elisp runtime that happens to have primitives like buffers, windows, etc upon which a text editor happened to be implemented.
It's more like a programming environment than a text editor. Sort of like Pharo Smalltalk, for example.
You can implement an HTTP server in elisp. You can render SVG, HTML, PDF. All kinds of things.
Emacs isn't an editor. It has an editor. And a bunch of other stuff. The core is written in C, but that's mostly a Lisp runtime and a display system. Everything else is written in elisp. If the runtime doesn't give you what you need, you can load dynamic libraries to extend its functionality.
I found for me that the epiphany came when I realised three things:
1. Key bindings are just calling Emacs functions in the current runtime, which you yourself can call from Elisp
2. Holy shit, you mean every keystroke is ALSO just a function that you can call yourself meaning you can automate everything with Elisp?!!
3. Wait. Emacs is just an Elisp runtime where some of the functions can edit text buffers!!!!
Why is this cool? Because it means that Emacs is NOT an editor - it’s a virtual machine holding libraries of functions that do useful things, which YOU then customise into YOUR editor.
In other words - Emacs is a toolkit that allows you creator your own editor/environment, customised to your specific workflow. And if you don’t like it, you have the power to fix it yourself, which is in contrast to every other editor I know of which was built by the editor developers with their own idea of how you should edit text
If only that ease of hood-popping were more common.
The operations you can do on a buffer include not just the usual string primitives like insertion and deletion of text, but _any_ editing command that you could use as a user as well. For example, if you want to move the cursor to the beginning of the line, call `beginning-of-line`. This is exactly the same function that is bound to `C-a`. Want to move to the next line? That’s `next-line`, which is bound to the `down` key by default. Want to drop the mark at the cursor position? Call `set-mark`. Want to search for something? `re-search-forward`. Now that you’ve found what you were looking for, you want to remove it from the buffer? Call `kill-region`, same as if you had typed `C-w`.
And commands build on other, more primitive, commands to give you complex behaviors. There are commands for creating, parsing, and sending emails, making HTTP requests and parsing HTTP responses, creating and parsing JSON, XML or HTML, etc, etc. You can create some JSON in the current buffer, send it off to the server via HTTP, and when the response comes back it swaps you over to a new buffer with the response. Or you can ask it to parse the response and just give you the body, etc. Basically any command you could interactively use as an Emacs user will work as part of a new Elisp program simply by virtue of the fact that it works on the current buffer. And the new Elisp programs you write can be used as commands by the user, and as parts of the user’s next Elisp program.
And switching buffers it not slow; all the buffers are in memory at the same time and the “current” buffer is just a pointer. The only quirk is that the pointer is stored in a variable instead of being passed as an argument to every single command you run. And that’s a good thing, because you would soon get tired of passing the current buffer to every single function you call!
... What a nightmare. Everything is an object. A header is an object. A paragraph is an object. There's a three-deep hierarchy to start talking about the current document. Yes, it's nice and namespaced and in that sense is well-defined, but the "hello world" of inserting text at the current cursor position is an absolute nightmare. And if you want to insert something more complex, like a couple headers and a paragraph and maybe a table? Get ready to build a factory function that creates a bunch of stuff and glues it together like you're writing a UI in Java AWT. And then it's not even in the doc yet, you have to go find your cursor, find the doc element the cursor is in, and only then can you insert content via a reparenting operation.
In emacs, you could do all of that with repeated "insert" calls, nearly literally touching the same keys you'd use to do it in the editor. It's an almost 1-to-1 metaphor mapping. If you know how to write text in emacs you know half of what you need to script emacs.
I also believe that buffer as an abstraction strictly makes many harder things easier, to the point I often wonder about creating a native library based on elisp buffer manipulation APIs alone that could be embedded in other runtimes instead. So the without touching buffer is a premise/constraint I don't quite understand to begin with.
"But that's like opening a document every time I want to glue two strings together!"
Not at all. A buffer is just a fancy blob of RAM. It's not file-backed unless you make it file-backed. They do take up RAM, but you're programming on a modern computer, not a PDP-11; if you're comfortable with Python using a whole in-memory object to represent an integer, you're comfortable with buffers.
"But it's messy to leave them lying around."
It's a feature. Yes, buffers aren't well-encapsulated and if your program crashes mid-run they get left open. That's by design. You don't need encapsulation because you're not doing multithreading here (and if you are, there are primitives for that and they take a bit more work to use); emacs is for editing and there's only one you, so if the current program is creating buffers and has no way to run two copies of itself at once, who cares. And your program crashing leaving buffers around is a feature; you can inspect the buffer and see what it looked like at crash-time, or set up the buffers the way you want them before firing off the program to get the desired effect (try those tricks with most languages without slapping on a debugger). And there are scripting blocks to create temp buffers and clean up your buffers for you anyway.
"But it's weird to have two ways to talk about strings in the language!"
That's true; it's a bit weird to have the string primitives and also buffers. But that's a pretty common flavor of weird; Java has strings and also has StringBuilder. My rule of thumb is "any time I'd reach for StringBuilder in Java, I should probably consider using a buffer in elisp."
Buffers are quite good as a primitive: almost every kind of information snapshot can fit in a buffer. It’s kind of a blackboard in a math room.
Well, because it ain't. it isn't a general-purpose language. It serves a single, specific purpose and excels at that function remarkably well.
> if you want to do anything complicated
Then you'd delegate the task to more specialized tools, possibly written in general-purpose PLs. Which Elisp is not.
A well-tuned emacs install is comfortable. I have my keybindings that do what I want them to do. I can visually organize my emacs frame (what is now called a GUI window) exactly how I want, with files taking up the parts of the screen that I want. I can be reading the README of some project I checked out and be curious about some terms, then just select it and send it off to my LLM. It's trivial to switch between Claude, OpenAI/ChatGPT, and Gemini depending on how much context I need to give.
It's like having personal space organized to your tastes. For some, their personal space can seem on the outside as a warzone of stuff, for others it's meticulously organized and labelled, but the key commonality is that it's personal space and that the owner of the space is comfortable in it. That's what emacs is. I don't need to learn a new set of keybindings or mouse clicks to unlock new functionality, I can just bring it into emacs.
That is, it isn't like emacs is the thing that is doing the trimming. It is just providing convenient access to ffmpeg to do that. That it is able to do this using roughly 300 lines of code is quite impressive and largely speaks to why people love doing things in emacs.
It would be one thing if this was code golfed to get to a working state. Reading the code, it is remarkably straight forward interactions with ffmpeg.
Is it an REPL? use comint.
Is it a tool that act on text files (lint, test,...)? Use compile
Do you need input with completion? Use the minibuffer.
Do you need multichoice selection? Use a buffer and mark stuff (there's a mode that you can extend from if you need to display tabulated data).
Do you need to define flags on the fly? Use transient.
Network request? Calling shell command? A combination of all the above? Emacs got your back.
And because it's a live programming environment, you can start quickly with a prototype (or just altering stuff) and then tweak things until you have a proper package.
What do you mean by "non-text things"? You are dealing with the computer, it's all about text and mostly text. Sure, it might be encoded and digitized, but even structured binary - is all just text. Even when you give a computer voice commands - they are just synthesized audio form of fucking text. Even with "turtles all the way down" - it's all turtles made of text.
Have you seen the gif in the blogpost? With the transient that has "Move Forward/Backward", "Increase", etc. commands? The commands that you'd have to send to the specialized app anyway - Emacs or not. In what form? Fucking text, of course.
Emacs users typically have a whole pile of customizations, macros, and workflow automations they've written up over the years.
And for things that are text oriented, the ability to work the buffers emacs-style between emacs windows is a joy.
There's a lot of advantages to keeping everything inside emacs.
you can't do it >:( that reddit post is so annoying to me, the only bit of that which was "pregnancy test" was the plastic shell, everything else was replaced, but everyone keeps going "hey did you know they ran doom on a pregnancy test?"
(and breathe...)
You can, see the command subed-crop-media-file.
https://github.com/sachac/subed/blob/main/subed/subed-common...
They don't work in isolation, though, and I bet you can easily think up a bunch of usecases for either. They're scriptable and they compose well, after all, so the tradeoff is worth it. You put up with the headache to automate that batch job of changing the intro sequence of the thousand video files and generate new thumbnails and put the new subtitles in one go.
In emacs, everything tends to be composable and scriptable. You are in GUI land but things feel powerful like in CLI land, except discoverable. It's the "vim is the text editor of the unix IDE" idea, except they put the whole unix into your editor. When people jokingly claim it's an OS they're only half joking. It's malleable. You are already running it. You are already familiar with the way it works, with the way you discover features, get help etc. Why start another program for a task like this?