I love it too.
There's a lisp variable, auto-mode-alist which has pairs of file extensions and mode functions that should be executed when you start editing a file with that extension. You can see it in emacs by typing C-h v auto-mode-alist.
There's a lisp function available in emacs named python-mode, which should already be in that list to be executed when you execute a file ending in .py. It's a different function than c++-mode, which is executed for various c-plus-plus file extensions.
Two different mode functions are used for two different sets of behavior.
|