Live data from Hacker News

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

news.ycombinator.com

161–170 of 340 posts

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

#161
post #3

- Use Common Lisp instead of Emacs Lisp. - Design a more modular architecture to make it easier to extend and maintain different components. - Design a more robust plugin system for development and distribution of extensions. - Implement better sandboxing and security measures for extensions. - Better APIs for extension developers. - better multi-threading support baked into the editor.

> - Implement better sandboxing and security measures for extensions.

Why, pray tell, should this be of any concern at all? Sandboxing is used when the host is concerned about running programs that he doesn't trust. There is no reason that an Emacs package would require security measures around it, unless it were knowingly potentially malware. The only reality in which I could see this is if people were using proprietary Emacs extensions, in which case I would entirely understand it, because then people would be willingly running malware inside their editor. Perhaps this the stance VS Code users like to take towards extensions?

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

#162

I have actually done some work on a rewrite of the Emacs core in rust[1], so I have thought a lot about this question. Most of the things you would want to change could be fairly easily added to the existing Emacs. The biggest ones that are hard to do with the current core is concurrency and collaborative editing. My particular core is focused on concurrency[2]. Unlike a lot of commenters here, I am trying to stay ba…

Have never tried it personally, but this talk made me think collaborative editing is a solved or close-to-solved problem in Emacs: https://emacsconf.org/2023/talks/collab/

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

#163
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 use a HHKB because of this. On the Acorn Archimedes I learnt to type on, it wasn't an extra Ctrl, it was the Ctrl.

Caps lock was rightfully relegated to bottom left.

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

#164
post #92

I like emacs for its flexibility and its ability to be a platform for people to build just about any extension. So for this you'd need a solid scripting language. I was never sold on Lisp but it's fine. I'd prefer to see lua; it just makes more sense. The repo-reference stuff works pretty well all things considered. If it were python it would be hell. Crazy side of me would like to see it fully written in a safe(r) l…

> Crazy side of me would like to see it fully written in a safe(r) language like rust, swift or zig. Emacs Lisp is a very safe language. Even though the Emacs core is written in C, that is immaterial and impalpable to Emacs users as they only interact with Emacs Lisp. What benefits would Rust / Swift / Zig bring to an average Emacs user? > Basically your config would be a recompiled subsystem, loaded at runtime, or y…

> elisp -> bytecode compilation in Emacs… predates humanity?

Actually, I believe it was developed by HackerNews hater Jamie Zawinsky.

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

#166
post #143

Earlier quoted context omitted.

Hard agree that these are true ‘fundamental pitfalls’ of Emacs’ design. However I may go further on your third point. I would like to see a dedicated new user/learner mode that in addition to saner defaults would be pretty fully configured and pre-loaded with the most common extensions/plug-ins/etc. This could then lead to development of dedicated documentation/tutorials that assist the new user in becoming proficien…

> in addition to saner defaults Isn't that cua-mode? https://www.gnu.org/software/emacs/manual/html_node/emacs/CU... > would be pretty fully configured and pre-loaded with the most common extensions/plug-ins/etc. Doesn't it already do this? org-mode comes pre-installed for instance.

cua-mode, yes, but the point is it's not the default.

Similarly, recentf-mode exists but is not the default. Or has that changed?

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

#167
post #37

Earlier quoted context omitted.

god yes please. "Will I get a new window? If so, where will it be?" If I could have Emacs with Acme-style window management, that'd be perfect

After years of vim and windows parkour, I started using Emacs, and while the windows management was a bit irritating at first, I made my peace with it and use them in a more focused manner and rely more on the buffer list. I use register if I need a particular configuration. Vim feels like working on a moodboard while Emacs is more a study desk.

I've been using Emacs for 25 years daily and this is still the thing that I think hasn't been really thought through. Yes there are hacks to mitigate that but there are still many rough edges with them.

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

#168

- throw away c language mode and and rewrite it from scratch - make dired more usable like a normal file manager. opening a file with the associated program that would persist after emacs closes should be its primary feature. ideally i want something like a mix of ranger/lf with dired - make it have fully-featured terminal, not dumb terminal. make it easy to open lots of terminal windows. add a way to change terminal…

All of this is possible in the current Emacs. 1. You can already define what program opens a file in dired. You could even use detach it from the Emacs process so it stays open when Emacs closes. 2 we already have vterm, which has all the features you described. 3. There are ways to make this better. I am actually in the process of writing a blog post about working efficiently over tramp.

Thanks for vterm, that's just what I need.

For dired I do have my bindings (one for xdg-open on a single file, another for custom command on a bunch of files).

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

#169
post #66

Earlier quoted context omitted.

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…

> 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. Iam pretty sure you can customzize that if you want. > scroll-preserve-screen-position is a variable defined in ‘C source code’. > Its value is ‘keep’ > Original value was nil > Controls if scroll commands move point to keep its screen position unch…

You’re misunderstanding. In those other apps the behavior is this: you open a document. You put the cursor on line 3 column 3. You use the mouse wheel or trackpad to scroll down to line 600. You hit cursor right. The cursor is now on line 3 column 4.

In emacs the cursor would be somewhere around line 600 instead.

Post reply on HN