Improve the documentation for prelude-python

This commit is contained in:
Bozhidar Batsov 2020-10-07 10:35:27 +03:00
parent efddd76ae5
commit 1553ae6a92

View file

@ -11,6 +11,14 @@ Emacs comes with Python programming support through the built-in
look at the Python mode key bindings. Alternatively look at the look at the Python mode key bindings. Alternatively look at the
menu bar entries under Python. To toggle the menu bar press `F12`. menu bar entries under Python. To toggle the menu bar press `F12`.
## Anaconda Mode
Prelude bundles the powerful
[anaconda-mode](https://github.com/pythonic-emacs/anaconda-mode),
which provides code navigation, documentation lookup and completion for Python.
Anaconda has integration with popular modes like `company` and `eldoc`.
## Syntax checking ## Syntax checking
Prelude ships with [Flycheck](https://github.com/flycheck/flycheck), Prelude ships with [Flycheck](https://github.com/flycheck/flycheck),
@ -21,15 +29,19 @@ order to have Flycheck support on the fly syntax checking for
Python you need to have either of these installed and accessible to Python you need to have either of these installed and accessible to
Emacs. In order to manually choose a checker run `C-c ! s`. Emacs. In order to manually choose a checker run `C-c ! s`.
## Automatic insertion of file encoding comments
## Automatic insertion of # coding: utf-8 You can have Prelude auto-detect the encoding of a source buffer and
insert the appropriate `# coding:` comments. If you wish to enable
Previously `prelude-python` had this feature enabled by default, but this, add the following to your configuration:
that is only necessary on Python2, because Python3 already use utf-8
as default encoding. In 2020, python2 becames deprecated, so that
functionallity becames a annoying side-effect for some users. If you
wish to enable this, add this to your config file:
```emacs-lisp ```emacs-lisp
(setq prelude-python-mode-set-encoding-automatically t) (setq prelude-python-mode-set-encoding-automatically t)
``` ```
!!! Note
Previously `prelude-python` had this feature enabled by default (up to Prelude 1.1), but
it is only necessary on Python 2, because Python 3 uses utf-8
as the default file encoding. In 2020 Python 2 became deprecated, so that
functionality became mostly obsolete.