Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write an emacs major-mode like dired

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?

like image 804
dbr Avatar asked Oct 05 '12 07:10

dbr


People also ask

How do I make Emacs major mode?

Usually, the major mode is automatically set by Emacs, when you first visit a file or create a buffer (see Choosing File Modes). You can explicitly select a new major mode by using an M-x command.

How do you find the major mode?

The mode of a data set is the number that occurs most frequently in the set. To easily find the mode, put the numbers in order from least to greatest and count how many times each number occurs. The number that occurs the most is the mode!

What are modes in Emacs?

A mode is a set of definitions that customize Emacs behavior in useful ways. There are two varieties of modes: minor modes, which provide features that users can turn on and off while editing; and major modes, which are used for editing or interacting with a particular kind of text.

How do I enable minor mode in Emacs?

If you want to enable/disable minor-modes on the whole session, press [e] or [d] on any minor-mode to keep its status even if you change major-modes, buffers, files. It continues until stopping emacs. This enable/disable list is stored in the global of manage-minor-mode-default .


1 Answers

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

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

like image 197
Oleg Pavliv Avatar answered Oct 23 '22 15:10

Oleg Pavliv