Live data from Hacker News

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

news.ycombinator.com

51–60 of 340 posts

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

#52

> 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…

LGTM: Ship it!

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

#53
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…

Vim has the same problem: https://github.com/neovim/neovim/issues/989

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

#54
post #12
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/ >.

Make CapsLock an additional Ctrl. On many old keyboards that is where the Ctrl key was positioned [1]. [1] https://en.m.wikipedia.org/wiki/Caps_Lock#Placement

I was very disappointed that Apple gave up that fight.

They also at some point joined the PC world in moving the nubs on their keyboard from "d" and "k", where you were more likely to notice if your fingers are not in their proper place on the home row. Now if your right hand is offset slightly to the right, you won't feel anything, which is less immediately noticeable than if the nub were under the wrong finger.

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

#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?

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

#56
I'd start with the core TECO editor I've written in Free Pascal[1].

Free Pascal does gigabyte strings you don't even have to allocate. Then I'd read the Emacs manual, and start writing code and tweaking TECO to make it all impedance match better.

But I'm old and weird, so maybe not the best way to get there.

[1] https://github.com/mikewarot/teco

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

#57
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…

I'll try to use the more common Windows/MacOS terms for it, but in emacs I often have the same file opened in two different panes within one window or two separate windows. I do this when I want to be looking at one part of a file while editing another.

Markers are used to mark a different point in the file and one can pop their location to a previous mark.

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

#58
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?

Emacs pauses are almost always due to some operation blocking in the main thread. It's pretty annoying and is mostly a consequence to a lot of things effectively being single-threaded. Stock emacs doesn't do this very often, but third party packages that might do expensive tasks often do

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

#59
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…

I'll try to use the more common Windows/MacOS terms for it, but in emacs I often have the same file opened in two different panes within one window or two separate windows. I do this when I want to be looking at one part of a file while editing another. Markers are used to mark a different point in the file and one can pop their location to a previous mark.

Putting cursors within the document does not preclude supporting different cursors for different windows.

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

#60
post #55

Earlier quoted context omitted.

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?

Emacs pauses are almost always due to some operation blocking in the main thread. It's pretty annoying and is mostly a consequence to a lot of things effectively being single-threaded. Stock emacs doesn't do this very often, but third party packages that might do expensive tasks often do

Ah. A case of "don't do that, then".
Post reply on HN