Commit graph

274 commits

Author SHA1 Message Date
Fabián Ezequiel Gallina
2bdce3883b Renamed indentity occurrences to identity in previous commmit 2012-05-17 00:03:29 -03:00
Fabián Ezequiel Gallina
279c9272ee Enhancements to internal python shell naming.
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.
2012-05-17 00:03:29 -03:00
Fabián Ezequiel Gallina
e1f00930bf Enhancements to pdbtrack.
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
2012-05-17 00:03:28 -03:00
Fabián Ezequiel Gallina
aeac8c27f2 Enhancements to pdbtrack
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'
2012-05-17 00:03:28 -03:00
Fabián Ezequiel Gallina
8386d830a3 Documentation enhancements and other small fixes.
Removed vars:
  + python-shell-import-line-regexp
2012-05-17 00:03:28 -03:00
Dan Davison
9253ea694d Complete module import lines in addition to variable names
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")
2012-05-17 00:03:27 -03:00
Dan Davison
b71bfa9cd6 Return appropriate value to comint-dynamic-complete
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.
2012-05-17 00:03:27 -03:00
Fabián Ezequiel Gallina
929036b470 Enhancements to `python-shell-calculate-process-environment'
The `python-shell-extra-pythonpaths' variable have been introduced as
simple way of adding paths to the PYTHONPATH without affecting
existing values.
2012-05-17 00:03:27 -03:00
Fabián Ezequiel Gallina
40417cb37a Enhancements on python-shell-calculate-process-environment' and python-shell-calculate-exec-path'
Removed functions:
 + python-util-merge
2012-05-17 00:03:26 -03:00
Fabián Ezequiel Gallina
fc6c545e4c Added simple way of jumping to current buffer's class/function definitions
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.
2012-05-17 00:03:25 -03:00
Fabián Ezequiel Gallina
1faf2911d6 Enhancements to python-shell-send-string-no-output to work OK with iPython 0.11
Also the documentation has been updated with info to make iPython 0.11
and 0.10 work with python.el's shell integration.
2012-05-17 00:03:25 -03:00
Fabián Ezequiel Gallina
a0686d71f6 Make run-python-internal to set process-query-on-exit-flag to nil
Also python-shell-make-comint now returns the process buffer name.
2012-05-17 00:03:25 -03:00
Fabián Ezequiel Gallina
fad22dec87 Fixed indentation case for after beginning of block 2012-05-17 00:03:25 -03:00
Fabián Ezequiel Gallina
fbc39529f0 Renamed python-clone-local-variables to python-util-clone-local-variables 2012-05-17 00:03:24 -03:00
Fabián Ezequiel Gallina
d2190c5795 New function python-clone-local-variables
Copied from org.el: it allows the `python-shell-make-comint' to be
simplified. It copies all local variables from a buffer to the
current.
2012-05-17 00:03:24 -03:00
Fabián Ezequiel Gallina
307bd2e8c7 Fix typo enviroment => environment
Removed function:
    * python-shell-calculate-process-enviroment

New function:
    * python-shell-calculate-process-environment
2012-05-17 00:03:24 -03:00
Fabián Ezequiel Gallina
96eeb83a55 Make shells inherit variables from parent buffer and internal shells not show by default.
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.
2012-05-17 00:03:23 -03:00
Fabián Ezequiel Gallina
0f55249e18 Use defcustom with :safe whenever is possible. 2012-05-17 00:03:23 -03:00
Fabián Ezequiel Gallina
77afb61ab3 Refactored run-python and run-python-internal.
Created new function python-shell-make-comint that takes care of
creating comint processes.

New Function:
    * python-shell-make-comint
2012-05-17 00:03:22 -03:00
Fabián Ezequiel Gallina
257b0017ef Fixed cornercase for normal lines when indentation was triggered in the middle of them 2012-05-17 00:03:22 -03:00
Fabián Ezequiel Gallina
8565528794 Make python-info-continuation-line-p to check context type matches
In order for a line to be continuation of another, they must be on the
same context.

New Function:
    * python-info-ppss-context-type
2012-05-17 00:03:22 -03:00
Fabián Ezequiel Gallina
64348c3241 Implemented simple virtualenv setup via python-shell-virtualenv-path variable.
when set to a string, makes the values stored in
`python-shell-process-environment' and `python-shell-exec-path' to be
modified properly so shells are started with the specified virtualenv.

New Variables:
    * python-shell-virtualenv-path

New functions:
    * python-shell-calculate-process-environment
    * python-shell-calculate-exec-path
2012-05-17 00:03:21 -03:00
Fabián Ezequiel Gallina
1fe1b5aa84 Implemented internal python shell.
This new kind of shell is intended to be used for generic
communication related to defined configurations. The main difference
with global or dedicated shells is that these ones are attached to a
configuration, not a buffer. This means that can be used for example
to retrieve the sys.path and other stuff, without messing with user
shells.

New Variables:
    * python-shell-internal-buffer-name,

New functions:
    * python-shell-internal-get-process-name
    * run-python-internal
    * python-shell-internal-get-or-create-process
    * python-shell-internal-send-string (makes python-send-receive obsolete)
2012-05-17 00:03:21 -03:00
Fabián Ezequiel Gallina
ecf24fd762 Backported triple quote syntax from Emacs 24 2012-05-17 00:03:21 -03:00
Fabián Ezequiel Gallina
33d0aec16e Make package description separator contain 3 dashes (ELPA conformance) 2012-05-17 00:03:20 -03:00
Fabián Ezequiel Gallina
f2a972f356 Updated TODO 2012-05-17 00:03:20 -03:00
Fabián Ezequiel Gallina
9438f1ef3a fixed font-lock-builtin-face regexp 2012-05-17 00:03:20 -03:00
Fabián Ezequiel Gallina
82c2b0de6a Set local variable `mode-require-final-newline' to t 2012-05-17 00:03:19 -03:00
Fabián Ezequiel Gallina
c61d750ea7 None, True, False, Ellipsis, __debug__, and NotImplemented now use font-lock-constant-face
Also copyright, license, credits, quit, exit are removed from
font-lock since they are added by the site module and only useful for
shell interaction and not programs.

See: http://docs.python.org/release/3.1.3/library/constants.html#constants-added-by-the-site-module
2012-05-17 00:03:19 -03:00
Fabián Ezequiel Gallina
0b7b2e512d python-info-current-defun: fixed cornercase that caused imenu to break 2012-05-17 00:03:19 -03:00
Fabián Ezequiel Gallina
b7f1355986 Added package information for ELPA conformance 2012-05-17 00:03:18 -03:00
Fabián Ezequiel Gallina
15cc40b819 Fixed eldoc behavior.
* python-eldoc-setup-code: The code to get help now uses the
        inspect element. When an object doesn't have documentation and
        if it is callable it returns the signature for it. Also when
        an object does contain documentation it only returns the first
        line.

      * python-eldoc-at-point: has been simplified to just message the
        doc header of objects.

      * python-info-current-defun: was not taking into account the
        current indentation so point was always inside a defun, even
        if the indentation was less or equal than the defun above.
2012-05-17 00:03:18 -03:00
Fabián Ezequiel Gallina
9787f82961 Indentation enhancements on after-backslash
Multiline sentences beginning with "import", "from" or "return" are
indented correctly now.
2012-05-17 00:03:18 -03:00
Fabián Ezequiel Gallina
f8994527d4 fixed last paren indentation logic 2012-05-17 00:03:17 -03:00
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