Commit graph

440 commits

Author SHA1 Message Date
Fabián Ezequiel Gallina
e44970863d * progmodes/python.el (python-shell-parse-command): Find
python-shell-interpreter with modified environment.
2013-01-28 18:59:42 -03:00
Glenn Morris
830e46e61b Merge from emacs-24; up to 2012-12-11T18:52:31Z!monnier@iro.umontreal.ca 2013-01-24 20:41:39 -08:00
Fabián Ezequiel Gallina
345f866e04 * lisp/progmodes/python.el: Enhancements to header documentation about
skeletons.

Fixes: debbugs:5716
2013-01-23 22:24:09 -03:00
Glenn Morris
c0511b5769 Merge from emacs-24; up to 2012-12-10T20:27:33Z!eggert@cs.ucla.edu 2013-01-13 12:03:01 -08:00
Fabián Ezequiel Gallina
5062005180 * progmodes/python.el (python-nav-end-of-statement): Fix
cornercase when handling multiline strings.
2013-01-10 00:44:12 -03:00
Paul Eggert
0877d0dc24 Merge from emacs-24; up to 2012-12-06T01:39:03Z!monnier@iro.umontreal.ca 2013-01-02 08:13:04 -08:00
Paul Eggert
ab422c4d68 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
Fabián Ezequiel Gallina
6861432ebd * progmodes/python.el (python-nav-end-of-statement): Rewrite in
order to improve efficiency (Based on Daniel Colascione's
<dancol@dancol.org> patch).

Fixes: debbugs:13182
2012-12-31 17:58:57 -03:00
Fabián Ezequiel Gallina
5b63c74a17 * progmodes/python.el: Bump defgroup :version to 24.3. 2012-12-31 16:35:57 -03:00
Fabián Ezequiel Gallina
df4758b82e Backported revisions 2012-12-29T12:33:33Z!fgallina@gnu.org and 2012-12-29T12:57:49Z!fgallina@gnu.org from trunk. 2012-12-31 16:27:20 -03:00
Fabián Ezequiel Gallina
ccb1c17e8b * progmodes/python.el: Support other commands triggering
python-indent-line so indentation cycling continues to work.
(python-indent-trigger-commands): New defcustom.
(python-indent-line): Use it.
2012-12-29 09:57:49 -03:00
Fabián Ezequiel Gallina
16768034b2 * progmodes/python.el (python-shell-send-region): Add blank lines
for non sent code so backtraces remain correct.
2012-12-29 09:33:33 -03:00
Fabián Ezequiel Gallina
66164d2f17 * progmodes/python.el: Remove cl dependency.
(python-syntax-count-quotes): Replace incf call.
(python-fill-string): Replace setf call.
2012-12-29 08:04:55 -03:00
Glenn Morris
727f973937 Merge from emacs-24; up to 2012-11-30T04:44:52Z!cyd@gnu.org 2012-12-12 21:29:15 -08:00
Fabián Ezequiel Gallina
2c43a9adb2 * progmodes/python.el (python-skeleton-class)
(python-skeleton-def): Do not add space after defun name.
2012-12-11 04:22:55 -03:00
Glenn Morris
5c9cf0a3f9 Merge from emacs-24; up to 2012-11-20T20:06:17Z!monnier@iro.umontreal.ca 2012-11-26 19:10:32 -08:00
Fabián Ezequiel Gallina
98f99594f7 * progmodes/python.el:
(python-indent-guess-indent-offset): If indentation is guessed
make python-indent-offset variable buffer local.
2012-11-26 20:31:06 -03:00
Fabián Ezequiel Gallina
207cb73c18 Fix Imenu regression.
* progmodes/python.el:
(python-nav-beginning-of-defun): Fix forward movement when
statement(s) separates point from defun.
(python-imenu-prev-index-position): New function.
2012-11-26 18:45:58 -03:00
Stefan Monnier
141462223d * lisp/emacs-lisp/byte-run.el (defun-declarations-alist):
Allow compiler-macros to be lambda expressions.
* lisp/progmodes/python.el: Use cl-lib.  Move var declarations outside of
eval-when-compile.
(python-syntax-context): Add compiler-macro.
(python-font-lock-keywords): Simplify with De Morgan.
2012-11-19 16:30:55 -05:00
Fabián Ezequiel Gallina
2e6625b527 Fix end-of-defun misbehavior.
* progmodes/python.el (python-nav-beginning-of-defun): Rename from
python-beginning-of-defun-function.  Handle nested defuns
correctly.
(python-nav-end-of-defun): Rename from
python-end-of-defun-function.  Ensure forward movement.
(python-info-current-defun): Reimplemented to work as intended
with new fixed python-nav-{end,beginning}-of-defun.  Stop scanning
parent defuns as soon as possible.
2012-11-12 10:26:50 -03:00
Fabián Ezequiel Gallina
12fd5ee1ae * progmodes/python.el (inferior-python-mode): Fix hang in
jit-lock.

Fixes: debbugs:12645
2012-11-03 09:20:02 -03:00
Fabián Ezequiel Gallina
55cd00c8f9 * progmodes/python.el (python-mode-map): Replace
subtitute-key-definition with proper command remapping.
(python-nav--up-list): Fix behavior for blocks on the same level.
2012-10-11 21:07:25 -03:00
Fabián Ezequiel Gallina
a4ff7fe145 Implemented `backward-up-list'-like navigation.
* progmodes/python.el (python-nav-up-list)
(python-nav-backward-up-list): New functions.
(python-mode-map): Define substitute key for backward-up-list to
python-nav-backward-up-list.
2012-10-08 23:07:26 -03:00
Fabián Ezequiel Gallina
24517d82a9 * progmodes/python.el (python-fill-paragraph): Rename from
python-fill-paragraph-function.  Fixed fill-paragraph for
decorators.

Fixes: debbugs:12605
2012-10-08 19:18:05 -03:00
Fabián Ezequiel Gallina
51867ae225 * progmodes/python.el (python-shell-output-filter): Handle extra
carriage return in OSX.

Fixes: debbugs:12409
2012-10-08 18:51:02 -03:00
Fabián Ezequiel Gallina
a5b773c40c Fix shell handling of unbalanced quotes and parens in output.
* progmodes/python.el (python-rx-constituents): Added
string-delimiter.
(python-syntax-propertize-function): Use it.
(python-shell-output-syntax-table): New var.
(inferior-python-mode): Prevent unbalanced parens/quotes from
previous output mess with current input context.
2012-10-08 18:30:36 -03:00
Fabián Ezequiel Gallina
8dbce54cc7 Enhancements on forward-sexp movement.
* progmodes/python.el (python-nav-beginning-of-statement)
(python-nav-end-of-statement): Return point-marker.
(python-nav-forward-sexp): lisp-like forward-sexp behavior.
(python-info-current-symbol)
(python-info-statement-starts-block-p): Rename from
python-info-beginning-of-block-p.
(python-info-statement-ends-block-p): Rename from
python-info-end-of-block-p.
(python-info-beginning-of-statement-p)
(python-info-end-of-statement-p)
(python-info-beginning-of-block-p, python-info-end-of-block-p):
New functions.
2012-10-08 02:19:15 -03:00
Fabián Ezequiel Gallina
f27c99dc7e * progmodes/python.el (inferior-python-mode)
(python-shell-make-comint): Fixed initialization of local
variables copied from parent buffer.
2012-10-07 16:37:37 -03:00
Fabián Ezequiel Gallina
be0d5baecc Enhancements to indentation.
* lisp/progmodes/python.el (python-indent-context): Give priority to
inside-string context.  Make comments indentation markers.
(python-indent-region): Do not mess with strings, unless it's the
enclosing set of quotes.
2012-10-07 13:13:52 -03:00
Fabián Ezequiel Gallina
08f18c3d4d Fix shell output retrieval and comint-prompt-regexp init.
* progmodes/python.el (inferior-python-mode):
(python-shell-make-comint): Fix initialization of
comint-prompt-regexp from copied file local variables.
(python-shell-fetched-lines): Remove var.
(python-shell-output-filter-in-progress): Rename from
python-shell-fetch-lines-in-progress.
(python-shell-output-filter-buffer): Rename from
python-shell-fetch-lines-string.
(python-shell-fetch-lines-filter): Delete function.
(python-shell-output-filter): New function.
(python-shell-send-string-no-output): Use them.
2012-10-07 01:33:16 -03:00
Fabián Ezequiel Gallina
7fa36ccb71 Enhancements to docstring formatting when filling paragraphs.
* progmodes/python.el (python-fill-docstring-style): Rename from
python-fill-string-style.  Added new style.
(python-fill-string): Use new style.  Better checks for
docstrings.
2012-10-05 10:42:08 -03:00
Paul Eggert
735135f9bc Spelling fixes. 2012-10-04 22:57:24 -07:00
Fabián Ezequiel Gallina
fc345011a6 Allow user to set docstring style for fill-paragraph.
* progmodes/python.el
(python-fill-comment-function, python-fill-string-function)
(python-fill-decorator-function, python-fill-paren-function):
Remove :safe for defcustoms.
(python-fill-string-style): New defcustom
(python-fill-paragraph-function): Enhanced context detection.
(python-fill-string): Honor python-fill-string-style settings.
2012-10-04 13:39:37 -03:00
Fabián Ezequiel Gallina
a1a9f411ab Fix cornercase for string syntax.
* progmodes/python.el (python-syntax-propertize-function):
Simplify and enhance the regexp for unescaped quotes.  Now it also
matches quotes in weird situations like the single quote in
"something\"'".
(python-syntax-stringify): Simplify num-quotes detecting code.
2012-10-03 18:53:09 -03:00
Fabián Ezequiel Gallina
0478776bb7 Shell output catching a la gud-gdb.
* progmodes/python.el (python-shell-fetch-lines-in-progress)
(python-shell-fetch-lines-string, python-shell-fetched-lines): New
Vars.
(python-shell-fetch-lines-filter): New function.
(python-shell-send-string-no-output): Use them.
2012-09-30 21:53:44 -03:00
Fabián Ezequiel Gallina
5727eadff9 Enhancements for triple-quote string syntax.
* progmodes/python.el (python-syntax-propertize-function): Match
both quote cases in one regexp.
(python-syntax-stringify): Handle matches properly.
2012-09-30 17:14:02 -03:00
Fabián Ezequiel Gallina
dc4f818b02 * progmodes/python.el:
(python-shell-send-buffer): Better handling of "if __name__ ==
'__main__':" conditionals when sending the buffer.
2012-09-24 20:15:40 -03:00
Fabián Ezequiel Gallina
8fb8b88f2d Enhancements for triple-quote string syntax.
* progmodes/python.el (python-quote-syntax): Remove.
(python-syntax-propertize-function): New value.
(python-syntax-count-quotes, python-syntax-stringify): New
functions.
2012-09-24 14:54:46 -03:00
Fabián Ezequiel Gallina
095bb82357 * progmodes/python.el (python-indent-line): More consistent cursor
movement behavior.
2012-09-23 15:21:33 -03:00
Matt McClure
9dd40b0005 * progmodes/python.el (python-shell-send-string): When
default-directory is remote, create temp file on remote
filesystem.
(python-shell-send-file): When file is remote, pass local view of
file paths to remote Python interpreter.  (Bug#12340)
2012-09-07 16:53:15 +02:00
Glenn Morris
2a1e24765b Replace version 24.2 with 24.3 where appropriate (hopefully) 2012-08-15 09:29:11 -07:00
Fabián Ezequiel Gallina
925411b4ce * progmodes/python.el (python-shell-send-string):
(python-shell-send-setup-code): Do not use `format' with
`message'.
2012-08-14 10:39:27 -03:00
Fabián Ezequiel Gallina
5beed58664 Use `completion-table-dynamic' for completion functions.
* progmodes/python.el
(python-shell-completion--do-completion-at-point)
(python-shell-completion--get-completions): Remove
functions.
(python-shell-completion-complete-at-point): New function.
(python-completion-complete-at-point): Use it.
2012-08-14 01:18:41 -03:00
Chong Yidong
1530c98e56 Remove some unnecessary bindings of same-window-* variables.
* lisp/progmodes/python.el (python-shell-get-process-name): Don't mess
with same-window-buffer-names.

* lisp/eshell/eshell.el (eshell-add-to-window-buffer-names)
(eshell-remove-from-window-buffer-names): Make obsolete.
(eshell-buffer-name, eshell-unload-hook): Don't use them.
(eshell): Just use pop-to-buffer-same-window instead.
2012-08-11 00:46:07 +08:00
Fabián Ezequiel Gallina
e0cc4efac7 * progmodes/python.el (python-pdbtrack-tracked-buffer)
(python-pdbtrack-buffers-to-kill, python-shell-internal-buffer)
(python-shell-internal-last-output): Use make-local-variable
instead of make-variable-buffer-local.
2012-08-09 01:08:29 -03:00
Fabián Ezequiel Gallina
489af14fa5 * progmodes/python.el: Enhancements to forward-sexp.
(python-nav-forward-sexp): Rename from
python-nav-forward-sexp-function.
(python-nav--forward-sexp, python-nav--backward-sexp): New
functions.
2012-08-09 00:30:37 -03:00
Fabián Ezequiel Gallina
2d79ec42a2 * progmodes/python.el Fixed defsubst warning.
(python-syntax-context) Rename from python-info-ppss-context.
(python-syntax-context-type): Rename from
python-info-ppss-context-type.
(python-syntax-comment-or-string-p): Rename from
python-info-ppss-comment-or-string-p.
2012-08-07 23:30:08 -03:00
Fabián Ezequiel Gallina
ba7b015436 Make internal shell process buffer names start with space.
* progmodes/python.el (python-shell-make-comint): Add optional
argument INTERNAL.
(run-python-internal): Use it.
(python-shell-internal-get-or-create-process): Check for new
internal buffer names.
2012-08-06 00:27:43 -03:00
Fabián Ezequiel Gallina
0d49da68b9 Shell processes: enhancements to startup and CEDET compatibility.
* progmodes/python.el (python-shell-send-setup-max-wait): Delete var.
(python-shell-make-comint): accept-process-output at startup.
(run-python-internal): Set inferior-python-mode-hook to nil.
(python-shell-internal-get-or-create-process): call sit-for.
(python-preoutput-result): Add obsolete alias.
(python-shell-internal-send-string): Use it.
(python-shell-send-setup-code): Remove call to
accept-process-output.
2012-07-31 20:43:31 -03:00
Fabián Ezequiel Gallina
d77149619b * progmodes/python.el (run-python-internal): Disable font lock for
internal shells.
2012-07-31 00:31:10 -03:00