News for hackers. Stuff that matters.
Re:Emacs standing alone on a Linux Kernel by bigdict on Thursday April 20, 2023 @10:40AM (#35640791)
I don't get it. It's Emacs installed on Linux. So what?
Re:Emacs standing alone on a Linux Kernel by photonbeam on Thursday April 20, 2023 @10:48AM (#35640929)
People joke about emacs being an operating system, here emacs is the whole userland
Re:Emacs standing alone on a Linux Kernel by ihatepython on Thursday April 20, 2023 @10:53AM (#35641031)
Wouldn't that be kind of bloated?
Re:Emacs standing alone on a Linux Kernel by HopenHeyHi on Thursday April 20, 2023 @10:56AM (#35641083)
Re:Emacs standing alone on a Linux Kernel by anthk on Thursday April 20, 2023 @11:24AM (#35641546)
Uhm. On the 2.4 era, you could boot a Linux floppy to play Nethack on it: NeHaBoDi.

https://nehabodi.sourceforge.net/

I wonder if I could do the same with Slashem.

Re:Emacs standing alone on a Linux Kernel by JadedEngineer on Thursday April 20, 2023 @12:22PM (#35642374)
IIRC a single-thread, slow userland that is. Emacs is the only CLI program I've ever run that would take a second or two to render when quickly switching tmux panes. I'll never get the "use emacs for everything" mantra.
Re:Emacs standing alone on a Linux Kernel by dingosity on Thursday April 20, 2023 @12:50PM (#35642750)
because it does what i want my computer to do.

sure, VI would be faster, but i would have to use vi.

Re:Emacs standing alone on a Linux Kernel by q7xvh97o2pDhNrh on Thursday April 20, 2023 @01:09PM (#35643024)
vim is also pretty slow these days.

Even after I did the usual toil of analyzing startup times and trimming my vimrc, its speed/responsiveness correlates inversely with the size of the text file that's open. And we're not talking about some artifically-constructed benchmark — just an extra-long ordinary text file (or log file, or code file) sitting around will be enough to make vim start to feel slow.

Maybe we're all just getting old, and the dream of "one text editor for everything" is becoming one of those quaint old notions of yesteryear.

Re:Emacs standing alone on a Linux Kernel by JadedEngineer on Thursday April 20, 2023 @01:24PM (#35643237)
> Maybe we're all just getting old, and the dream of "one text editor for everything" is becoming one of those quaint old notions of yesteryear.

I mean, that's only ever been a dream in the emacs community. Vim might have toy plugins for other stuff, but by and large people use it to edit period. As it should be, isn't the whole UNIX philosophy to do one thing well? If I want email or a text browser in the CLI I'll use dedicated, better, faster programs, each on a tmux pane that I can use instantly with a keyboard shortcut, rather than wait for slow emacs buffer to load.

Re:Emacs standing alone on a Linux Kernel by ParetoOptimal on Friday April 21, 2023 @10:13AM (#35654058)
> I mean, that's only ever been a dream in the emacs community.

That's not true and not something you could really accurately guess at.

I have exclusively used one text editor for everything (emacs) for many years.

I also know others that have done the same.

Re:Emacs standing alone on a Linux Kernel by User23 on Thursday April 20, 2023 @09:58PM (#35648962)
The problem is one of context. When editing a programming language buffer, the editor needs to be aware of the entire buffer, because a { on the first line could match to a } on the 1235987th line and affect hilighting as well as editing commands like indentation, or sexp navigation. Meanwhile, ideally, in a log buffer the only information needed to nicely render a single line is contained on that line. Or perhaps the log unit is multiline, but still somehow boundable. In that case the editor should be able to do presentation in constant time based on the segment of the buffer that's visible.

Unfortunately, what with logging in JSON and so on, these two cases aren't really distinct anymore. But if I did want to use one editor for both log viewing and coding, I'd pick the one that was the most easily and interactively customizable.

Re:Emacs standing alone on a Linux Kernel by forty on Thursday April 20, 2023 @06:49PM (#35647573)
Weird, I haven't used Emacs for that long and I really feel why I'd want to use Emacs for everything. I don't mostly because it seems annoying to setup the slack integration + SSO and that kind of thing. But I'd definitely want to write all my texts in (evil) Emacs, have all my to-do/Gitlab task/slack reminder /etc in org mode and review Gitlab PRs without ever opening a browser, etc
Re:Emacs standing alone on a Linux Kernel by JadedEngineer on Thursday April 20, 2023 @07:58PM (#35648161)
I absolutely get not wanting to leave the terminal, I'm the same. And I wanted to like Emacs for that. But it's just really slow, and the moment you have a number of buffers with lots of content it's hardly usable. And don't get me started on its terminal emulators, anything with lots of outputs will show on screen at x0.5 speed. I compare with tmux for changing context and it's night and day.
Re:Emacs standing alone on a Linux Kernel by pama on Thursday April 20, 2023 @09:29PM (#35648812)
I use the latest versions with native compilation and gave up on terminals and curses codes in favor of plain M-x shells. I tend to accumulate hundreds of buffers, some of them GB size, and all is super snappy. I am very sensitive to latency and can’t stand slow pings, avoid wireless for that reason, and have tuned my keyboards over the years to reduce input latency and errors. Emacs out of the box is super fast. The plain text input loop is in microseconds so not perceptible. And there is hardly ever a need for terminal emulators but when there absolutely is (say htop) then you can use vterm.
Re:Emacs standing alone on a Linux Kernel by pmoriarty on Friday April 21, 2023 @12:52AM (#35649925)
On the terminal emulator front, emacs-eat[1] is also worth mentioning.

[1] - https://codeberg.org/akib/emacs-eat

Re:Emacs standing alone on a Linux Kernel by ParetoOptimal on Friday April 21, 2023 @06:14PM (#35660954)
With eat I can even run htop. This means I have the typical char, semi-char, emacs-mode while the terminal application is active but as soon as I exit it I'm returned to normal eshell where I can treat it as a mostly normal buffer and evaluate elisp.

It really feels like the best of all worlds.

Re:Emacs standing alone on a Linux Kernel by ParetoOptimal on Friday April 21, 2023 @10:11AM (#35654040)
> And I wanted to like Emacs for that. But it's just really slow, and the moment you have a number of buffers with lots of content it's hardly usable.

Do you mean vanilla emacs or a bespoke configuration?

Number of buffers should not slow emacs down and never has across many versions and platforms for me on vanilla emacs.

I would find it hard to believe vanilla emacs was slow switching between lots of buffers. Perhaps if you had 6 windows (as emacs refers to panes) evenly split of minified javascript on a single line it would be slow?

However an issue in my bespoke configurations that has caused the buffer switching issue you mention before is adding a call to the modeline and not debouncing.

Re:Emacs standing alone on a Linux Kernel by m463 on Thursday April 20, 2023 @07:56PM (#35648143)
I'll tell you I would love if emacs could take over text box input for firefox.

This goes double for crufty enterprise apps that use editor-in-the-browser panes that get in the way or lose data.

Re:Emacs standing alone on a Linux Kernel by bloopernova on Thursday April 20, 2023 @11:29PM (#35649537)
Have you tried anything from this page? https://www.emacswiki.org/emacs/Mozilla
Re:Emacs standing alone on a Linux Kernel by ParetoOptimal on Friday April 21, 2023 @10:00AM (#35653863)
> Emacs is the only CLI program I've ever run that would take a second or two to render when quickly switching tmux panes. I'll never get the "use emacs for everything" mantra.

If you were using tmux, you weren't using emacs for everything!

Emacs for everything also includes replacing terminal with eshell/eat and eventually even frequently curses applications with emacs variations.

Re:Emacs standing alone on a Linux Kernel by pama on Thursday April 20, 2023 @11:03AM (#35641216)
Other than emacs, the only available command on that Linux system is mount. Not even a shell.
Re:Emacs standing alone on a Linux Kernel by bigdict on Thursday April 20, 2023 @12:06PM (#35642155)
Then how are the commands in the code listings executed?
Re:Emacs standing alone on a Linux Kernel by samus on Thursday April 20, 2023 @12:39PM (#35642609)
Emacs' `dired` mode might or might not be able to produce a directory listing by itself. However, the author admits that

> Of course, quite a number of syscalls are missing from emacs (not available as elisp primitives), so as it is, it would be hard enough to do EVERYTHING with emacs, but this is a starting point.

Re:Emacs standing alone on a Linux Kernel by ertian on Thursday April 20, 2023 @12:44PM (#35642675)
eshell (emacs' shell) has it's own versions of common shell commands, written in elisp.
Re:Emacs standing alone on a Linux Kernel by bigdict on Thursday April 20, 2023 @07:00PM (#35647685)
eshell only makes an appearance in step 5, the rest are regular sh/bash commands.
Re:Emacs standing alone on a Linux Kernel by pama on Thursday April 20, 2023 @09:09PM (#35648659)
The commands before that step are used to build the Linux system.
Re:Emacs standing alone on a Linux Kernel by bigdict on Friday April 21, 2023 @02:04AM (#35650239)
Oh I see, thanks.
Re:Emacs standing alone on a Linux Kernel by pama on Friday April 21, 2023 @05:05PM (#35660144)
You are welcome.
Re:Emacs standing alone on a Linux Kernel by tenebrisalietum on Thursday April 20, 2023 @12:19PM (#35642344)
The Linux kernel, when it boots, will perform all its setup, then launch a program.

That program has traditionally been `/sbin/init` which launches all background things that need to be running, including your `getty`'s for console login, your `sshd` for SSH login, and your `gdm`'s or what not for GUI login.

Lately it's `systemd` which does the same in a less simple but more flexible/featureful manner.

Here, there is literally no other process running but Emacs - it's your "login shell."

This is the first step in replacing `systemd` with `emacs`, and it will take less space and be easier to use. /s

Re:Emacs standing alone on a Linux Kernel by HeckFeck on Thursday April 20, 2023 @12:33PM (#35642513)
Finally, I get to write my init scripts in Emacs Lisp!
Re:Emacs standing alone on a Linux Kernel by samus on Thursday April 20, 2023 @12:45PM (#35642692)
You know, .emacs bankruptcy is a thing...

https://www.emacswiki.org/emacs/DotEmacsBankruptcy

Re:Emacs standing alone on a Linux Kernel by throwanem on Thursday April 20, 2023 @10:39PM (#35649197)
"Build one to throw away. You will anyway."
Re:Emacs standing alone on a Linux Kernel by samus on Friday April 21, 2023 @01:49PM (#35657471)
As in software engineering, the art is to build a solution that can be easily taken apart for spare parts when it becomes time to change or refactor it.
Re:Emacs standing alone on a Linux Kernel by bigdict on Thursday April 20, 2023 @07:01PM (#35647699)
This is the only actually helpful comment, thank you.