Hacker News new | ask | show | jobs
by msla 1256 days ago
> I think it boils down to having specialized editors which you embed, and to a common interface that you may define over that.

Emacs modes, in other words?

Like how, in Emacs, C-n nearly always does "move to next line" but it could mean "highlight next mail message" and "Enter" nearly always does something with the current line but it could mean "open currently highlighted message" or "newline and indent as per language-specific rules" or "send this line to a subprocess" or whatever.

1 comments

Modes don't do embedding. Try having a fully-seperate mode for a comment section in your code. Try to do that contextually, too.

Modes don't do that. Neither do they let you control the underlying structure, they give you no ability to treat structures as objects. Yes, they do provide a common interface, but that's where the pros end. Ofc its emacs, and there are projects like Multi-Major-Modes that at least try to subdivide a document into editable areas... speaking of ridiculously slow.