!! Polymode required Emacs version 25.1 or higher!!
You can install Polymode, or more commonly a specific polymode, interactively
M-x package-install [RET] polymode [RET]
M-x package-install [RET] poly-markdown [RET]
In order to see all available polymodes do M-x list-packages [RET]
and search for
To automatically install relevant polymodes put the following lines into
.emacs for each polymode that you use:
(unless (package-installed-p 'polymode) (package-install 'poly-markdown))
You can pin packages to always install from MELPA stable like follows:
(add-to-list 'package-pinned-packages '(poly-markdown . "melpa-stable") t)
use-package can also be used to install Polymode via the
(use-package poly-markdown :ensure t)
Or from MELPA stable:
(use-package poly-markdown :ensure t :pin melpa-stable)
For further configuration options with
use-package see the official
use-package repository or C-h v
cd path/to/vc/dir git clone https://github.com/polymode/polymode git clone https://github.com/polymode/poly-markdown ...
.emacs add "polymode" directory and "polymode/modes" to the load path:
(setq load-path (append '("path/to/vc/dir/polymode/" "path/to/vc/dir/poly-markdown/") load-path))
Require any polymode bundles that you are interested in. For example:
Activation of Polymodes
Polymodes are functions and can be used just like ordinary emacs modes.
Particularly, activate them in files by either registering a file extension in
(add-to-list 'auto-mode-alist '("\\.md" . poly-markdown-mode))
or by setting local major mode variable in the header of the file:
// -*- mode: poly-noweb -*-
Normally you won't need to setup modes yourself as polymode packages register their polymodes with the common extensions automatically. See the documentation of each polymode package.