Doing (setq python-indent-levels '(0)) was causing the value of
python-indent-levels to not be initialized correctly on next calls to
python-indent-calculate-indentation. Using (setq python-indent-levels
(list 0)) instead does the trick but I'm not sure why.
For this, four new variables which contain the symbol name of the
function that specifies the behavior of fill-paragraph on certain
conditions were added:
* python-fill-comment-function: For comments
* python-fill-string-function: For strings
* python-fill-decorator-function: For decorators
* python-fill-paren-function: For parens
All of these variables are safe local variables in the case the value
provided is a symbol. Out of the box, they default to these four new
functions respectively:
* python-fill-comment
* python-fill-string
* python-fill-decorator
* python-fill-paren
When point is at beginning-of-defun, end-of-defun moves to the end of
the defun, even if it contains nested defuns. When point is at any
inner defun end-of-defun moves to the end of it, if another inner
defun exists at the same level point is moved to it.
For beginning-of-defun things are funkier, it would move backwards
following nested defuns in order. This will be fixed soon.
Note: Decorators are considered part of defuns.
Removed:
* python-use-beginning-of-innermost-defun
* python-beginning-of-innermost-defun-regexp
Renamed:
* python-beginning-of-defun => python-nav-beginning-of-defun
* python-beginning-of-defun-regexp => python-nav-beginning-of-defun-regexp
Expressions like these are now supported and indented correctly:
Object.objects.exclude(foo=1)\
.filter(bar=2)\
.values_list('baz')
Also added a small fix to python-info-assignment-continuation-line-p
to check the match for the operator is not inside some paren.
Use this function for most syntax-ppss related tasks. While in some
parts code could be longer it makes everything more readable.
This is the first step for a cleaner indentation machinery.
Added python-shell-prompt-output-regexp to match the prompts
added before output in shells like iPython. With the value of
this variable the output generated for
python-shell-send-string-no-ouput is cleaned up.
Moved completion variables and bindings setup for shell to
inferior-python-mode definition.
Renamed python-shell-completion-strings-code to
python-shell-completion-string-code.
improved python-shell-completion--get-completions string
splitting.
Cleaned up some unecessary messages.
Better code sending need test for python-shell-completion-setup
python-ffap-setup and python-eldoc-setup.
Added example for iPython integration in the commentary section.
Removed functions python-shell-clear-latest-output and
python-shell-send-and-clear-output in favor of
python-shell-send-string-no-output.
Also python-shell-send-string now supports multiline string statements
so you won't have to worry calling python-shell-send-file again.
All this changes should make integrations with other Python shells
than standard more robust.
6 basic skeletons are defined: class, def, for, if, try and while.
While these skeletons are strongly based on GNU/Emacs' current
python.el a better definition macro, a generic template for
try/except/finally/else blocks and a cool menu display is included.
python-shell-send-file function now can be called interactively and
will do the right thing.
Also the python code that sent the file was improved so the shell
considers the correct path when evaluating the file.
Removed the inferior-python-mode-current-temp-file variable, after
this update inferior-python-mode-current-file is enough.