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?

Community
  • 1
  • 1
dbr
  • 165,801
  • 69
  • 278
  • 343
  • 1
    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](http://philjackson.github.com/magit/) and [browse-kill-ring](https://github.com/browse-kill-ring/browse-kill-ring) are doing... – gempesaw Oct 09 '12 at 02:44
  • 2
    The O'Reilly book ["Writing GNU Emacs Extensions"](http://shop.oreilly.com/product/9781565922617.do) 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 look – dbr Nov 15 '12 at 11:16

2 Answers2

2

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

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

Oleg Pavliv
  • 20,462
  • 7
  • 59
  • 75
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.

Ryan Tarpine
  • 761
  • 7
  • 9