1. 27 Dec, 2014 1 commit
    • Fabián Ezequiel Gallina's avatar
      python.el: Handle file encoding for shell. · 2dd5163d
      Fabián Ezequiel Gallina authored
      * lisp/progmodes/python.el (python-rx-constituents): Add coding-cookie.
      (python-shell--save-temp-file): Write file with proper encoding.
      (python-shell-buffer-substring): Add coding cookie for detected
      encoding to generated content.  Fix blank lines when removing
      if-name-main block.
      (python-shell-send-file): Handle file encoding.
      (python-info-encoding-from-cookie)
      (python-info-encoding): New functions.
      
      * test/automated/python-tests.el (python-shell-buffer-substring-1)
      (python-shell-buffer-substring-2, python-shell-buffer-substring-3)
      (python-shell-buffer-substring-4, python-shell-buffer-substring-5)
      (python-shell-buffer-substring-6, python-shell-buffer-substring-7)
      (python-shell-buffer-substring-8)
      (python-info-encoding-from-cookie-1)
      (python-info-encoding-from-cookie-2)
      (python-info-encoding-from-cookie-3)
      (python-info-encoding-from-cookie-4)
      (python-info-encoding-from-cookie-5)
      (python-info-encoding-from-cookie-6)
      (python-info-encoding-from-cookie-7, python-info-encoding-1)
      (python-info-encoding-2): New tests.
      2dd5163d
  2. 22 Dec, 2014 1 commit
    • Fabián Ezequiel Gallina's avatar
      python.el: Fix electric colon behavior · 749813e9
      Fabián Ezequiel Gallina authored
      * lisp/progmodes/python.el (python-indent-post-self-insert-function):
      Make colon to re-indent only for dedenters, handling
      multiline-statements gracefully.
      
      * test/automated/python-tests.el (python-indent-electric-colon-2)
      (python-indent-electric-colon-3): New tests.
      749813e9
  3. 22 Nov, 2014 1 commit
    • Fabián Ezequiel Gallina's avatar
      Set PYTHONUNBUFFERED on shell startup. · 238c052f
      Fabián Ezequiel Gallina authored
      Fixes: debbugs:18595
      
      * lisp/progmodes/python.el (python-shell-unbuffered): New var.
      (python-shell-calculate-process-environment): Use it.
      
      * test/automated/python-tests.el
      (python-shell-calculate-process-environment-4)
      (python-shell-calculate-process-environment-5): New tests.
      (python-shell-make-comint-3): Use file-equal-p.
      (python-shell-get-or-create-process-1)
      (python-shell-get-or-create-process-2)
      (python-shell-get-or-create-process-3): Fix interpreter for
      Windows.
      238c052f
  4. 15 Nov, 2014 2 commits
    • Fabián Ezequiel Gallina's avatar
      Fixes: debbugs:18432 · 92f58578
      Fabián Ezequiel Gallina authored
      * lisp/progmodes/python.el (python-indent-calculate-levels): Fix
      indentation behavior multiline dedenter statement.
      
      * test/automated/python-tests.el (python-indent-dedenters-8): New test
      for Bug#18432.
      92f58578
    • Fabián Ezequiel Gallina's avatar
      Fix region indentation · 89ebffc1
      Fabián Ezequiel Gallina authored
      Fixes: debbugs:18843
      
      * lisp/progmodes/python.el (python-indent-region): Use
      python-indent-line and skip special cases.
      
      * test/automated/python-tests.el (python-indent-region-1)
      (python-indent-region-2, python-indent-region-3)
      (python-indent-region-4, python-indent-region-5): New tests.
      89ebffc1
  5. 01 Sep, 2014 1 commit
  6. 18 Aug, 2014 1 commit
  7. 21 Jul, 2014 1 commit
  8. 20 Jul, 2014 1 commit
    • Fabián Ezequiel Gallina's avatar
      Make python.el work with IPython automatically. · b06a0dff
      Fabián Ezequiel Gallina authored
      * lisp/progmodes/python.el:
      (python-shell-completion-setup-code): New value supporting iPython.
      (python-shell-completion-string-code): New value supporting iPython.
      (python-shell-completion-get-completions): Use them.
      (python-shell-completion-module-string-code): Make obsolete.
      (python-shell-prompt-input-regexps)
      (python-shell-prompt-output-regexps): Add safeguard for ipdb.
      (python-shell-output-filter): Fix comment typo.
      
      * test/automated/python-tests.el:
      (python-util-clone-local-variables-1): Fix test.
      
      Fixes: debbugs:15510
      b06a0dff
  9. 19 Jul, 2014 1 commit
    • Fabián Ezequiel Gallina's avatar
      Autodetect Python shell prompts. · d949ade3
      Fabián Ezequiel Gallina authored
      * lisp/progmodes/python.el:
      (python-shell-interpreter-interactive-arg)
      (python-shell-prompt-detect-enabled)
      (python-shell-prompt-detect-failure-warning)
      (python-shell-prompt-input-regexps)
      (python-shell-prompt-output-regexps): New vars.
      (python-shell-prompt-calculated-input-regexp)
      (python-shell-prompt-calculated-output-regexp): New vars.
      (python-shell-get-process-name)
      (python-shell-internal-get-process-name)
      (python-shell-output-filter)
      (python-shell-completion-get-completions): Use them.
      (python-shell-prompt-detect)
      (python-shell-prompt-validate-regexps): New functions.
      (python-shell-prompt-set-calculated-regexps): New function.
      (inferior-python-mode): Use it.  Also honor overriden
      python-shell-interpreter and python-shell-interpreter-args.
      (python-shell-make-comint): Honor overriden
      python-shell-interpreter and python-shell-interpreter-args.
      (python-shell-get-or-create-process): Make it testable by allowing
      to call run-python non-interactively.
      (python-util-valid-regexp-p): New function.
      (python-shell-prompt-regexp, python-shell-prompt-block-regexp)
      (python-shell-prompt-output-regexp)
      (python-shell-prompt-pdb-regexp): Use it as defcustom :safe.
      
      * test/automated/python-tests.el (python-shell-make-comint-1):
      (python-shell-make-comint-2): Fix indentation.
      (python-shell-make-comint-3)
      (python-shell-make-comint-4): New tests.
      (python-shell-get-or-create-process-1): Fix test.
      (python-shell-get-or-create-process-2)
      (python-shell-get-or-create-process-3): New tests.
      (python-shell-internal-get-or-create-process-1): Fix test.
      (python-shell-prompt-detect-1): New test.
      (python-shell-prompt-detect-2): New test.  (Bug#17370)
      (python-shell-prompt-detect-3)
      (python-shell-prompt-detect-4)
      (python-shell-prompt-detect-5)
      (python-shell-prompt-detect-6)
      (python-shell-prompt-validate-regexps-1)
      (python-shell-prompt-validate-regexps-2)
      (python-shell-prompt-validate-regexps-3)
      (python-shell-prompt-validate-regexps-4)
      (python-shell-prompt-validate-regexps-5)
      (python-shell-prompt-validate-regexps-6)
      (python-shell-prompt-validate-regexps-7)
      (python-shell-prompt-set-calculated-regexps-1)
      (python-shell-prompt-set-calculated-regexps-2)
      (python-shell-prompt-set-calculated-regexps-3)
      (python-shell-prompt-set-calculated-regexps-4)
      (python-shell-prompt-set-calculated-regexps-5)
      (python-shell-prompt-set-calculated-regexps-6)
      (python-util-valid-regexp-p-1): New tests.
      d949ade3
  10. 09 Jul, 2014 1 commit
    • Fabián Ezequiel Gallina's avatar
      Fix dedenters and electric colon handling. · fded0b4a
      Fabián Ezequiel Gallina authored
      * lisp/progmodes/python.el
      (python-rx-constituents): Add dedenter and block-ender.
      (python-indent-dedenters, python-indent-block-enders): Delete.
      (python-indent-context): Return new case for dedenter-statement.
      (python-indent-calculate-indentation): Handle new case.
      (python-indent-calculate-levels): Fix levels calculation for
      dedenter statements.
      (python-indent-post-self-insert-function): Fix colon handling.
      (python-info-dedenter-opening-block-message): New function.
      (python-indent-line): Use it.
      (python-info-closing-block)
      (python-info-closing-block-message): Remove.
      (python-info-dedenter-opening-block-position)
      (python-info-dedenter-opening-block-positions)
      (python-info-dedenter-statement-p): New functions.
      
      * test/automated/python-tests.el
      (python-indent-block-enders-1)
      (python-indent-block-enders-2): Fix tests.
      (python-indent-block-enders-3)
      (python-indent-block-enders-4)
      (python-indent-block-enders-5)
      (python-indent-dedenters-1)
      (python-indent-dedenters-2): Remove tests.
      (python-indent-dedenters-1)
      (python-indent-dedenters-2)
      (python-indent-dedenters-3)
      (python-indent-dedenters-4)
      (python-indent-dedenters-5)
      (python-indent-dedenters-6)
      (python-indent-dedenters-7)
      (python-info-dedenter-opening-block-position-1)
      (python-info-dedenter-opening-block-position-2)
      (python-info-dedenter-opening-block-position-3)
      (python-info-dedenter-opening-block-positions-1)
      (python-info-dedenter-opening-block-positions-2)
      (python-info-dedenter-opening-block-positions-3)
      (python-info-dedenter-opening-block-positions-4)
      (python-info-dedenter-opening-block-positions-5)
      (python-info-dedenter-opening-block-message-1)
      (python-info-dedenter-opening-block-message-2)
      (python-info-dedenter-opening-block-message-3)
      (python-info-dedenter-opening-block-message-4)
      (python-info-dedenter-opening-block-message-5)
      (python-info-dedenter-statement-p-1)
      (python-info-dedenter-statement-p-2)
      (python-info-dedenter-statement-p-3)
      (python-info-dedenter-statement-p-4)
      (python-info-dedenter-statement-p-5): New tests.
      
      Fixes: debbugs:15163
      fded0b4a
  11. 01 Jul, 2014 1 commit
  12. 21 Jun, 2014 1 commit
    • Fabián Ezequiel Gallina's avatar
      Fix completion retrieval parsing. · 656f99be
      Fabián Ezequiel Gallina authored
      * progmodes/python.el (python-mode):
      (python-util-strip-string): New function.
      (python-shell-completion-get-completions): Use it.
      
      * automated/python-tests.el (python-util-strip-string-1): New test.
      
      Fixes: debbugs:17209
      656f99be
  13. 09 Apr, 2014 1 commit
  14. 06 Apr, 2014 1 commit
    • João Távora's avatar
      Fix triple-quoting electricity in python-mode · 7aecc2f6
      João Távora authored
      * lisp/progmodes/python.el (python-electric-pair-string-delimiter): Fix
      triple-quoting electricity. 
      
      * test/automated/python-tests.el (python-triple-quote-pairing): New test.
      (python-syntax-after-python-backspace): New test.
      
      Fixes: debbugs:17192
      7aecc2f6
  15. 01 Jan, 2014 1 commit
  16. 25 Dec, 2013 1 commit
    • Fabián Ezequiel Gallina's avatar
      * lisp/progmodes/python.el: · 01379221
      Fabián Ezequiel Gallina authored
      (python-nav--lisp-forward-sexp): New function.
      (python-nav--lisp-forward-sexp-safe): Use it.  Rename from
      python-nav-lisp-forward-sexp-safe.
      (python-nav--forward-sexp): New argument SAFE allows switching
      forward sexp movement behavior for parens.
      (python-nav-forward-sexp): Throw errors on unterminated parens.
      (python-nav-backward-sexp, python-nav-forward-sexp-safe)
      (python-nav-backward-sexp-safe): New functions.
      (python-shell-buffer-substring): Use
      `python-nav-forward-sexp-safe'.
      
      * test/automated/python-tests.el
      (python-nav-lisp-forward-sexp-safe-1): Remove test.
      (python-nav-forward-sexp-safe-1): New test.
      
      Fixes: debbugs:16191
      01379221
  17. 12 Dec, 2013 3 commits
  18. 23 Nov, 2013 2 commits
    • Glenn Morris's avatar
      Stop some python tests leaving temp-files behind · 0b09f7c0
      Glenn Morris authored
      * test/automated/python-tests.el (python-shell-make-comint-1)
      (python-shell-make-comint-2, python-shell-get-process-1):
      Suppress creation of some temp-files.
      0b09f7c0
    • Glenn Morris's avatar
      Use skip-unless in some python tests · f4d341af
      Glenn Morris authored
      * test/automated/python-tests.el (python-shell-parse-command-1)
      (python-shell-make-comint-1, python-shell-make-comint-2)
      (python-shell-get-process-1)
      (python-shell-internal-get-or-create-process-1):
      Skip rather than fail if prereqs not found.
      f4d341af
  19. 13 Aug, 2013 1 commit
  20. 13 Jul, 2013 1 commit
  21. 09 Jul, 2013 2 commits
  22. 27 Jun, 2013 1 commit
  23. 19 Apr, 2013 1 commit
    • Fabián Ezequiel Gallina's avatar
      New faster Imenu implementation. · adc31213
      Fabián Ezequiel Gallina authored
      * lisp/progmodes/python.el:
      (python-imenu-prev-index-position):
      (python-imenu-format-item-label-function)
      (python-imenu-format-parent-item-label-function)
      (python-imenu-format-parent-item-jump-label-function):
      New vars.
      (python-imenu-format-item-label)
      (python-imenu-format-parent-item-label)
      (python-imenu-format-parent-item-jump-label)
      (python-imenu--put-parent, python-imenu--build-tree)
      (python-imenu-create-index, python-imenu-create-flat-index)
      (python-util-popn): New functions.
      (python-mode): Set imenu-create-index-function to
      python-imenu-create-index.
      
      * test/automated/python-tests.el (python-imenu-prev-index-position-1):
      Removed test.
      (python-imenu-create-index-1, python-imenu-create-flat-index-1):
      New tests.
      
      Fixes: debbugs:14058
      adc31213
  24. 17 Apr, 2013 2 commits
  25. 01 Apr, 2013 1 commit
  26. 26 Mar, 2013 1 commit
    • Fabián Ezequiel Gallina's avatar
      Un-indent after "pass" and "return" statements · c9886b39
      Fabián Ezequiel Gallina authored
      * lisp/progmodes/python.el (python-indent-block-enders): New var.
      (python-indent-calculate-indentation): Use it.
      
      * test/automated/python-tests.el
      (python-indent-block-enders): New test.
      (python-info-current-defun-2): Fix test.
      
      Fixes: debbugs:13888
      c9886b39
  27. 25 Feb, 2013 2 commits
    • Fabián Ezequiel Gallina's avatar
      * automated/python-tests.el · b85f3423
      Fabián Ezequiel Gallina authored
      (python-tests-with-temp-buffer): Doc fix.
      (python-tests-with-temp-file): New macro.
      (python-tests-shell-interpreter): New var.
      (python-shell-get-process-name-1)
      (python-shell-internal-get-process-name-1)
      (python-shell-parse-command-1)
      (python-shell-calculate-process-environment-1)
      (python-shell-calculate-process-environment-2)
      (python-shell-calculate-process-environment-3)
      (python-shell-calculate-exec-path-1)
      (python-shell-calculate-exec-path-2)
      (python-shell-make-comint-1)
      (python-shell-make-comint-2)
      (python-shell-get-process-1)
      (python-shell-get-or-create-process-1)
      (python-shell-internal-get-or-create-process-1): New tests.
      b85f3423
    • Paul Eggert's avatar
      Spelling fixes. · 52b823c8
      Paul Eggert authored
      52b823c8
  28. 20 Feb, 2013 1 commit
    • Fabián Ezequiel Gallina's avatar
      Added intial test suite for python.el. · 4dddd5dc
      Fabián Ezequiel Gallina authored
      * automated/python-tests.el
      (python-tests-with-temp-buffer): New macro.
      (python-tests-look-at): New function.
      (python-tests-look-at-1)
      (python-tests-look-at-2)
      (python-indent-pep8-1)
      (python-indent-pep8-2)
      (python-indent-pep8-3)
      (python-indent-inside-paren-1)
      (python-indent-inside-paren-2)
      (python-indent-after-block-1)
      (python-indent-after-block-2)
      (python-indent-dedenters-1)
      (python-indent-after-backslash-1)
      (python-indent-after-backslash-2)
      (python-nav-beginning-of-defun-1)
      (python-nav-beginning-of-defun-2)
      (python-nav-end-of-defun-1)
      (python-nav-end-of-defun-2)
      (python-nav-beginning-of-statement-1)
      (python-nav-end-of-statement-1)
      (python-nav-forward-statement-
      (python-nav-backward-statement-1)
      (python-nav-backward-statement-2)
      (python-nav-beginning-of-block-1)
      (python-nav-end-of-block-1)
      (python-nav-forward-block-1)
      (python-nav-lisp-forward-sexp-safe-1)
      (python-nav-forward-sexp-1)
      (python-nav-forward-sexp-2)
      (python-nav-forward-sexp-3)
      (python-nav-up-list-1)
      (python-nav-backward-up-list-1)
      (python-imenu-prev-index-position-1)
      (python-info-current-defun-1)
      (python-info-current-defun-2)
      (python-info-current-defun-3)
      (python-info-current-symbol-1)
      (python-info-current-symbol-2)
      (python-info-current-symbol-3)
      (python-info-statement-starts-block-p-1)
      (python-info-statement-starts-block-p-2)
      (python-info-statement-ends-block-p-1)
      (python-info-statement-ends-block-p-2)
      (python-info-beginning-of-statement-p-1)
      (python-info-beginning-of-statement-p-2)
      (python-info-end-of-statement-p-1)
      (python-info-end-of-statement-p-2)
      (python-info-beginning-of-block-p-1)
      (python-info-beginning-of-block-p-2)
      (python-info-end-of-block-p-1)
      (python-info-end-of-block-p-2)
      (python-info-closing-block-1)
      (python-info-closing-block-2)
      (python-info-line-ends-backslash-p-1)
      (python-info-beginning-of-backslash-1)
      (python-info-continuation-line-p-1)
      (python-info-block-continuation-line-p-1)
      (python-info-block-continuation-line-p-2)
      (python-info-assignment-continuation-line-p-1)
      (python-info-assignment-continuation-line-p-2)
      (python-info-looking-at-beginning-of-defun-1)
      (python-info-current-line-comment-p-1)
      (python-info-current-line-empty-p)
      (python-util-goto-line-1)
      (python-util-clone-local-variables-1)
      (python-util-forward-comment-1): New tests.
      4dddd5dc