How to write an emacs major-mode like dired
Asked Answered
F

2

6

I've found a bunch of information (like this) on writing a major-mode for a language, but... I'd like to write a mode along the lines of dired or tetris - modes that use the buffer as a GUI.

In the "Major Modes" section of the manual, the "Basic Major Modes" page implies it should base the mode on special-mode, but I couldn't find any more useful information

Is there any good tutorials on writing a special-mode derived mode? Any good basic "hello world"-level examples of such a thing?

Flagellum answered 5/10, 2012 at 7:18 Comment(2)
Looking for the same exact thing - happened across the same page in the manual advising deriving such modes from special-mode, but I haven't been able to find anything useful. Bereft of any intentional guidance, I had vaguely planned to follow what magit and browse-kill-ring are doing...Borgerhout
The O'Reilly book "Writing GNU Emacs Extensions" has examples of writing several major modes, one of which is a crossword game mode.. Parts are on Google Books - I don't particularly like how the code is presented (chunks of completed code that all magically works together in the end, rather than a working example that is improved upon), and is pretty old (1997).. but I'll have a lookFlagellum
G
2

Take a look on undo-tree-visualizer-mode in UndoTree.

It's pretty small and is not based on a language.

Guberniya answered 5/10, 2012 at 8:2 Comment(0)
S
1

Zachary Kanfer once gave a talk titled Writing Games with Emacs, where he live-coded a simple tictactoe-mode. You can find it on YouTube here, and he uploaded his code here.

I found it a great introduction to writing my own special mode.

Smiley answered 18/6, 2020 at 7:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.