Can anyone provide me with a hello world example for a major mode in emacs? I guess it's a beginner question, still I really like to write a major mode, both to learn emacs and elisp, as to be able to use customization to the fullest.
What I have done so far (and is working) :
- wrote a file sample-mode.el and put it in a lisp dir
- called in .emacs
(require 'sample-mode)
- wrote some defuns in it, and provided it at the end
(provide 'sample-mode)
But still it doesn't seem to be activated, I cannot call it with M-sample-mode.
So how to do that? And can anyone provide me with a very very simple Hello World like working sample?