Live data from Hacker News

Ask HN: If you were rewriting Emacs from scratch, what would you do differently?

news.ycombinator.com

61–70 of 340 posts

Re: Ask HN: If you were rewriting Emacs from scratch, what would you do differently?

#61
post #26
post #6

Instead of using ctrl and meta modifiers, use a leader key like escape or semicolon or comma or some such thing as the prefix key for key bindings. In fact, this desire for leader-key-based, non-modal text editing led me to write devil-mode for Emacs: https://susam.github.io/devil/ >.

emacs is not its keybindings. you can bind your emacs keyboard to do what you are asking for; as you said, you wrote a mode for emacs that works the way you want, and it wasn't necessary to rewrite Emacs.

> emacs is not its keybindings ... and it wasn't necessary to rewrite Emacs

That's indeed true! But the premise of this question explores the scenario: What if we did rewrite Emacs from scratch?

Re: Ask HN: If you were rewriting Emacs from scratch, what would you do differently?

#62
post #44

Use python instead of lisp.

I agree.

Maybe it's just personal preference, since I think it's easier for me to think in python over lisp (which I've known for longer, but I still fumble through)

I do think python would make emacs more accessible to a wider audience.

Re: Ask HN: If you were rewriting Emacs from scratch, what would you do differently?

#65
Take a look at the Mac editor Alpha. It is arguably emacs-in-tcl and did a very nice job of balancing cua-style keybindings with emacs-style. Better, if I remember correctly, than things like cua-mode. It’s been literally decades since I’ve used it though, and it might be impossible to square that circle in a way that’s really frictionless.

Re: Ask HN: If you were rewriting Emacs from scratch, what would you do differently?

#66
post #47

I'd make cursors be positioned within the document instead of on the screen. Currently, Emacs does not support off-screen cursors. If you attempt to scroll a cursor off screen, it will move within the document to stay on screen. This behavior is contrary to all modern text editors, and there is no good workaround. I once made a serious effort to start using Emacs, but ultimately stopped because of the annoying cursor…

This still annoys me slightly after nearly 20 years of using Emacs.

In response to keypresses, it doesn't bother me too much, as I'm used to the Windows-style behaviour of PgUp/PgDn/etc. moving the caret, much as the Mac behaviour of not doing that is sometimes useful. But for mouse wheel scrolling, which I do a lot - precisely because on Windows this typically does not move the caret! - having point follow along has never felt right.

Re: Ask HN: If you were rewriting Emacs from scratch, what would you do differently?

#67

> If you were rewriting Emacs from scratch, what would you do differently? UI: Electron, of course. Json to represent the edit buffer in RAM. Each utf8 code point base64 encoded, in a json array, it itself, as a blob, base64 encoded. Now, before you complain that that is gonna blow up the data too much, don’t forget that 1. “Ram is cheap” and 2. “gzipped base64 is about the same size as binary”. So, of course, we’ll…

Thanks, I hate it.

Re: Ask HN: If you were rewriting Emacs from scratch, what would you do differently?

#68
post #55

I don't care that much about the implementation, but I would like to see an emacs environment with: - instant startup - blazingly fast scrolling - minimal keypress-to-display latency I have written a lot of elisp (and had to deal with with buffer variables, dynamic scope, etc.), but aligning with modern scheme or lisp (if it can be kept compact and efficient) probably makes sense at this point. (Current emacs should…

I'm confused. On the modern devices I've recently used emacs on (including very low-powered raspberry pi devices), all of your three criteria are already true. What kind of HW are you running emacs on where this isn't the case?

This is from 2015, but emacs still has higher typing latency than vim in 2024.

https://pavelfatin.com/typing-with-pleasure/

If you have better numbers and comparisons for emacs keypress-to-pixel latency, etc. I'd be interested.

Note classic vi started up faster than vim.

Device makes little to no difference: Raspberry Pi 5, MacBook Pro M1, ThinkPad P1, etc. - emacs is clunky on all of them. I like emacs and it's my daily driver. But it isn't fast.

see also:

"Computer latency: 1997-2017" https://danluu.com/input-lag/

"Measuring keyboard-to-photon latency with a light sensor" https://thume.ca/2020/05/20/making-a-latency-tester/

Re: Ask HN: If you were rewriting Emacs from scratch, what would you do differently?

#69
It’s interesting the divide we see here between particular implementation choices, and very general design principles. FWIW I think this exposes some of the tensions in Emacs’ design itself. The fact that everything is customisable is both great and the source of many problems, and it depends on which direction you want to go how you want to move that particular needle.

I’m not totally sure what I’d do. The semantics of multithreaded or async alteration of buffers are not easy and so, even though they would be great in many ways, might make simple customisation just too painful.

Re: Ask HN: If you were rewriting Emacs from scratch, what would you do differently?

#70
post #19

Support prettier typography (if the user is not interacting with Emacs through a terminal, in which case of course the typography is up to the terminal-emulation app). If text in Emacs looked as pretty as text on the web does, it would be less of a struggle for me to stay focused on the Emacs text. (Text on the web was already much above average in pleasantness to look at and to read in the 1990s.) Get rid of any key…

> If text in Emacs looked as pretty as text on the web does Do you have an example of this? I can't tell any difference for the fonts that I use (with emacs-pgtk). I believe Emacs uses Harfbuzz (same as Chrom{e|ium}).

Most of the text on the web for example is in a proportional-pitch typeface.

Does your Emacs usually use a proportional-pitch typeface? If so and you're on Linux, I'll install the font you are using.

I've tried using proportional typefaces in Emacs (on Mac), but there was something off, so I went back to monospaced. I could try again now that I have a Linux machine.

The text in my Emacs looks almost exactly like the text in my Gnome Terminal. (A slight difference in size is the only thing I notice. To be painfully precise, (window-system) evals to 'pgtk on my Emacs.)

The text in Gnome Terminal is not terrible, for sure, but text on the web is a nicer in my experience.

Post reply on HN