Commit graph

440 commits

Author SHA1 Message Date
Fabián Ezequiel Gallina
65e4f7642e Fixed weird cornercase behavior in python-indent-calculate-indentation.
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.
2012-05-17 00:03:17 -03:00
Fabián Ezequiel Gallina
589cefd766 increased forward-comment COUNT variable value in all calls 2012-05-17 00:03:16 -03:00
Fabián Ezequiel Gallina
4cafacb52a docstring enhancements 2012-05-17 00:03:16 -03:00
Fabián Ezequiel Gallina
107c2439fa indentation fixes on after backslash 2012-05-17 00:03:16 -03:00
Fabián Ezequiel Gallina
9fff18585a Implemented python-nav-backward-sentence, python-nav-forward-sentence
Also small fixes to python-nav-sentence-start and
python-nav-sentence-end were added.
2012-05-17 00:03:15 -03:00
Fabián Ezequiel Gallina
3697b5314a Added python-nav-sentence-start and python-nav-sentence-end functions 2012-05-17 00:03:15 -03:00
Fabián Ezequiel Gallina
c942de99c0 fixed CL related bytecompilation errors and set make-tree for imenu default 2012-05-17 00:03:14 -03:00
Fabián Ezequiel Gallina
fc2dc7df02 Implemented imenu support.
New variables:
 + python-imenu-include-defun-type
 + python-imenu-make-tree
 + python-imenu-subtree-root-label
 + python-imenu-index-alist

New Functions:
 + python-imenu-tree-assoc
 + python-imenu-make-element-tree
 + python-imenu-make-tree
 + python-imenu-create-index

API changes:
 + python-info-current-defun now supports an optional argument called
 INCLUDE-TYPE.
2012-05-17 00:03:14 -03:00
Fabián Ezequiel Gallina
2d63ad564d Documentation enhancements with regards to code checking. (thanks schickm) 2012-05-17 00:03:14 -03:00
Fabián Ezequiel Gallina
af5c1bebb5 Fixed python-info-current-defun for classes without bases 2012-05-17 00:03:13 -03:00
Fabián Ezequiel Gallina
74d7b6051a Fixed infinite loop on python-info-current-defun
For this python-beginning-of-defun-function has been modified to
return t or nil if a defun was found.
2012-05-17 00:03:13 -03:00
Fabián Ezequiel Gallina
053a6c726f Docstrings enhancements 2012-05-17 00:03:13 -03:00
Fabián Ezequiel Gallina
327f0e8429 Small cornercase fix to python-info-current-defun.
Returned the bad defun name when point was at the beginning of defun.
2012-05-17 00:03:12 -03:00
Fabián Ezequiel Gallina
6b4328531c Fixed python-info-current-defun to match new navigation code.
python-nav-beginning-of-defun and python-beginning-of-defun-function
now support a new extra optional argument called NODECORATORS.
2012-05-17 00:03:12 -03:00
Fabián Ezequiel Gallina
2ed294c5df Replaced references from python-beginning-of-innermost-defun to python-beginning-of-defun-function 2012-05-17 00:03:12 -03:00
Fabián Ezequiel Gallina
c2cb97aec2 User customizable fill-paragraph behavior.
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
2012-05-17 00:03:11 -03:00
Fabián Ezequiel Gallina
0567effbae Corrected implementations for python-{beginning,end}-of-defun functions.
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
2012-05-17 00:03:11 -03:00
Fabián Ezequiel Gallina
c806ea6e87 New variable python-use-beginning-of-innermost-defun
Controls if beginning-of-defun function should go to outermost or
innermost defun.
2012-05-17 00:03:11 -03:00
Fabián Ezequiel Gallina
f9471190dc Better indentation handling when inside parens. 2012-05-17 00:03:10 -03:00
Fabián Ezequiel Gallina
86f1889aa9 Fixed indentation issue when indenting a python-indent-dedenter from end of line 2012-05-17 00:03:10 -03:00
Fabián Ezequiel Gallina
66bbb27f8d new variables python-shell-process-environment and python-shell-exec-path
The main reason for these new variables is virtualenv support.
2012-05-17 00:03:10 -03:00
Fabián Ezequiel Gallina
30e429dd37 New variable python-shell-send-setup-max-wait
Controls the timeout for output just before sending the setup code.
2012-05-17 00:03:09 -03:00
Fabián Ezequiel Gallina
e2d8d4790f Documentation enhancements 2012-05-17 00:03:09 -03:00
Fabián Ezequiel Gallina
c0428ba0bd Better shell setup using the new python-shell-send-setup-codes function.
At the moment of shell setup, all the pending output is accepted so
the prompt is always displayed correctly.
2012-05-17 00:03:09 -03:00
Fabián Ezequiel Gallina
9f1537ef3e Added indentation support for continuation of dotted expressions
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.
2012-05-17 00:03:08 -03:00
Fabián Ezequiel Gallina
c43cd8b10f Enhancements to python-indent-electric-colon.
Only de-indent line if it really closes a block.
2012-05-17 00:03:08 -03:00
Fabián Ezequiel Gallina
14a7849583 New function python-info-ppss-context
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.
2012-05-17 00:03:07 -03:00
Fabián Ezequiel Gallina
099bf0104e Added commentary about installing pyreadline on system that bundles Python without readline 2012-05-17 00:03:07 -03:00
Fabián Ezequiel Gallina
da3d48d7d6 Remove find-file-noselect invocation in python-shell-send-file 2012-05-17 00:03:07 -03:00
Fabián Ezequiel Gallina
2db30ac50a Use insert instead of insert-string 2012-05-17 00:03:06 -03:00
Fabián Ezequiel Gallina
62feb91565 Better non-standard shell integration support
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.
2012-05-17 00:03:06 -03:00
Fabián Ezequiel Gallina
9ce938be0b Shell integration improvements and cleanups
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.
2012-05-17 00:03:06 -03:00
Fabián Ezequiel Gallina
73ed683681 python.el now bytecompiles without warnings 2012-05-17 00:03:05 -03:00
Fabián Ezequiel Gallina
e2803784cf Implemented Skeletons after GNU/Emacs python.el
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.
2012-05-17 00:03:05 -03:00
Fabián Ezequiel Gallina
67845102b2 Explain we have python-indent-electric-colon 2012-05-17 00:03:05 -03:00
Fabián Ezequiel Gallina
cb42456fc6 Don't deactivate mark after indenting commands 2012-05-17 00:03:04 -03:00
Fabián Ezequiel Gallina
76eefb1fe5 Small fix to python-indent-electric-colon
Check current indentation is greater than the current calculated
indentation.
2012-05-17 00:03:04 -03:00
Fabián Ezequiel Gallina
ffdb56c385 Implemented python-indent-electric-colon 2012-05-17 00:03:04 -03:00
Fabián Ezequiel Gallina
17d13b8526 Fixed indentation of multi-line function call's closing parenthesis 2012-05-17 00:03:03 -03:00
Fabián Ezequiel Gallina
24b68537c3 Make inferior-python-mode-current-file be set via convert-standard-filename 2012-05-17 00:03:03 -03:00
Fabián Ezequiel Gallina
d439cda598 Enhanced python-shell-send-file function
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.
2012-05-17 00:03:03 -03:00
Fabián Ezequiel Gallina
57808175eb Added commentary about auto-indentation on newlines for python-mode.el users 2012-05-17 00:03:02 -03:00
Fabián Ezequiel Gallina
d818ffa870 Use convert-standard-filename to fix temp files path 2012-05-17 00:03:02 -03:00
Fabián Ezequiel Gallina
d8e594dba8 Fixed highlighting for dictionary assignments 2012-05-17 00:03:02 -03:00
Fabián Ezequiel Gallina
6eb68dc25b Fixed pdb-track on Windows
make-temp-file is returning the temp file path with the wrong type of
slashes.
2012-05-17 00:03:01 -03:00
Fabián Ezequiel Gallina
534e24385b Fixed incorrect syntax highlighting for variable assignations 2012-05-17 00:03:01 -03:00
Fabián Ezequiel Gallina
14d9f80c0d Fixed indentation guess logic to never accept 0 as a possible value 2012-05-17 00:03:01 -03:00
Fabián Ezequiel Gallina
78334b439d Implemented python-eldoc-at-point (python-describe-symbol replacement) 2012-05-17 00:03:00 -03:00
Fabián Ezequiel Gallina
8b3e0e76ee Implemented python-check 2012-05-17 00:03:00 -03:00
Fabián Ezequiel Gallina
2947016aa7 Small changes to ffap support 2012-05-17 00:03:00 -03:00