The module completer wants e.g. 'from xxx' as input, not just 'xxx'.
This change also causes all modules to be offered as completions to
'from ', whereas previously this was regarded as empty input.
The comint prompt retrieval logic was failing on
`python-shell-completion--do-completion-at-point' when calls to it
happened from outside the process buffer.
Calling `end-of-defun' on a python file will now do the correct thing,
even for cases like this:
def fib(n):
if n < 2:
# base cases
return n
else:
return fib(n - 2) + fib(n - 1)
Backslashed continuations with parens in the middle are now handled
correctly. Things like this are now indented properly:
objects = Thing.objects.all() \
.filter(
type="toy",
status="bought"
subtype="car"
) \
.aggregate(
Sum('amount')
) \
.values_list()
New Functions:
* `python-info-beginning-of-backlash' returns the point where a
backslashed line start.
This commit includes:
* A more robust implementation of `python-indent-calculate-indentation'.
* enhancements on `python-indent-context' when dealing with backslashes
and blocks.
* Many changes, comments and enhancements to
`python-indent-calculate-indentation'. Many of them especially focused
to match pep8 guidelines, being this one the most important new one:
http://mail.python.org/pipermail/python-dev/2011-June/111760.html
* Better `python-info-line-ends-backslash-p' that would work as intended
on narrowed buffers.
* `python-info-continuation-line-p' now does what's supposed to do.
* Enhanced implementation of `python-info-continuation-line-p',
`python-info-block-continuation-line-p' and
`python-info-assignment-continuation-line-p'
New Functions:
* `python-util-forward-comment' a simple replacement `forward-comment'
with some necessary enhancements.
`python-shell-completion--do-completion-at-point' has been modified in
order to support different completion contexts easily.
New vars:
+ python-shell-completion-pdb-string-code
The internal python shell now takes into account more shell settings
in order to generate the unique hash for its name.
Also `python-shell-setup-codes' has been simplified and is not allowed
to be a list of cons anymore.
pdbtrack now handles correctly the case where the stacktrace
information is on the second line.
All python buffers not opened by the user and used for tracking are
closed automatically when tracking process finishes.
Simplified code for keeping the tracked buffer.
Removed vars:
+ python-pdbtrack-tracking-buffers
Removed functions:
+ python-pdbtrack-get-or-add-tracking-buffers
New vars:
+ python-pdbtrack-tracked-buffer
+ python-pdbtrack-buffers-to-kill
New functions:
+ python-pdbtrack-set-tracked-buffer
pdbtracking now autodetects the filename being tracked from the prompt
and not from the `inferior-python-mode-current-file' variable.
Removed vars:
+ `inferior-python-mode-current-file'
Available when using ipython v0.11. Completions on lines starting with
"from " or "import " are supplied by
IPython.core.completerlib.module_completion
ipython v0.11 configuration:
(setq python-shell-interpreter "ipython"
python-shell-completion-setup-code
"from IPython.core.completerlib import module_completion\n"
python-shell-module-completion-string-code
"';'.join(module_completion('''%s'''))\n"
python-shell-completion-string-code
"';'.join(get_ipython().Completer.all_completions('''%s'''))\n")
This avoids a "No completions for ..." message being issued when a
completion has been made. Also, reduces redundancy between the
inferior-python-mode and python-mode completion code.
The new `python-nav-jump-to-defun' function allows a user to jump fast
and easy to a function or class definition in the current buffer. For
this a entry in the menu and the C-c C-j keybinding have been
introduced.
New functions:
+ `python-nav-list-defun-positions'
+ `python-nav-read-defun'
+ `python-nav-jump-to-defun'
The new function `python-nav-list-defun-positions' does the same as a
relevant part of the `python-imenu-create-index' so the latter has
been refactored to use it.
python-shell-make-comint now passes all parent buffer variables to the
comint buffer created ensuring local variables work as intended. Also,
this function now receives a third optional argument called POP that
establishes if the created comint buffer should be displayed or not
after its creation.