News for hackers. Stuff that matters.
Re:Ask HN: If you were rewriting Emacs from scratch, what wo... by wging on Saturday October 12, 2024 @07:03PM (#41823500)
For instant startup I recommend daemon mode and emacsclient. Start emacs via emacs --daemon, open windows (in the terminal or otherwise) via `emacsclient` / `emacsclient -nc` (I use aliases for these).
Re:Ask HN: If you were rewriting Emacs from scratch, what wo... by perihelions on Saturday October 12, 2024 @07:24PM (#41823641)
I wrap my slow .emacs loads inside #'run-with-idle-timer so they run when I'm not looking, and not likely to notice.
Re:Ask HN: If you were rewriting Emacs from scratch, what wo... by andbberger on Saturday October 12, 2024 @10:03PM (#41824574)
what is this point of this, when would you not be using emacs?
Re:Ask HN: If you were rewriting Emacs from scratch, what wo... by perihelions on Sunday October 13, 2024 @12:04PM (#41829119)
Only needs a few seconds of idle time to load libraries.
Re:Ask HN: If you were rewriting Emacs from scratch, what wo... by musicale on Saturday October 12, 2024 @07:09PM (#41823531)
Yep, warm start is the only way to go unfortunately. But I want a fast start from cold boot like classic vi.
Re:Ask HN: If you were rewriting Emacs from scratch, what wo... by rbc on Saturday October 12, 2024 @08:28PM (#41824070)
I think running daemon mode has significant advantages. You can have frames running on multiple virtual desktops for different uses. You can also step away from a buffer, and return to it, maybe from some other location on a different computer.
Re:Ask HN: If you were rewriting Emacs from scratch, what wo... by sping on Monday October 14, 2024 @01:22PM (#41839654)
Though trying to run Emacs like vi is a pitfall in itself. Clunking around the terminal summoning Emacs to edit files is really not a particularly effective way to use it. Emacs is not vi, and using Emacs like Emacs makes more sense. Most users explore your filesystem and spawn and monitor processes from within Emacs, rather than from a terminal.

Not that you can't work that way (and using `emacsclient` is the way to do it), but you're losing out by trying to shoe-horn usage patterns familiar from other toolchains onto Emacs. Emacs is not a text editor, it's a text manipulation platform that includes an editor - a number of editors in fact, including a vim clone.

Re:Ask HN: If you were rewriting Emacs from scratch, what wo... by stackghost on Sunday October 13, 2024 @12:29AM (#41825146)
The solution to "this text editor takes too long to start up" is poorly addressed by the solution to "just leave it running in the background all the time".
Re:Ask HN: If you were rewriting Emacs from scratch, what wo... by dokyun on Sunday October 13, 2024 @02:12AM (#41825599)
It really is not poorly addressed, as it's a reasonable solution to the issue which also brings about it's own benefits. If you have your system configured such that the Emacs server starts up when you log in, by the time you actually start Emacs it will long have already loaded completely. If you actually use your Emacs for several things throughout the day, including but not limited to reading and editing text and documents, then it is likely you will have it always running during that time with several files open, and will find it useful to be using Emacs in the same state it was in the last time you opened it.

As an aside, having it running in the background was actually the way the original EMACS that ran on ITS was intended to be used: When you C-x C-c out of it, it does not kill the program, it simply puts it in the background, and the next time you invoke EMACS it brings it back up. This is similar in effect to hitting C-z, then using 'fg' to bring it up again, but this only really works in a terminal. The Emacs server achieves the intended effect better, especially on a graphical display.

Re:Ask HN: If you were rewriting Emacs from scratch, what wo... by iLemming on Monday October 14, 2024 @12:17AM (#41834127)
It's not a "solution"; you still need to solve your undesirably slow startup, but if you're having to kill and restart Emacs multiple times a day, something is wrong with your workflow. Normally, Emacs doesn't require restart - for weeks and months in some cases.

emacsclient is useful on its own. For example, I use it to edit just about any text, in any input box in any app, delegating the task to Emacs, or when I want to open some URL in Emacs, while browsing a web page in my browser, or to send some selected text to Emacs.

Re:Ask HN: If you were rewriting Emacs from scratch, what wo... by stackghost on Monday October 14, 2024 @07:46PM (#41843447)
This has strong "you're holding it wrong" energy.
Re:Ask HN: If you were rewriting Emacs from scratch, what wo... by iLemming on Monday October 14, 2024 @08:53PM (#41843824)
Well, if you see someone launching a browser, visiting website, then quitting it, and then later launching it again to visit another webpage, you'd tell them it ain't right, no?