Commit graph

634 commits

Author SHA1 Message Date
Fabián Ezequiel Gallina
7d1e62d51b python.el: Enhance shell user interaction and deprecate python-shell-get-or-create-process.
* lisp/progmodes/python.el
(python-shell-get-process-or-error): New function.
(python-shell-with-shell-buffer): Use it.
(python-shell-send-string, python-shell-send-region)
(python-shell-send-buffer, python-shell-send-defun)
(python-shell-send-file, python-shell-switch-to-shell): Use it.
Add argument MSG to display user-friendly message when no process
is running.
(python-shell-switch-to-shell): Call pop-to-buffer with NORECORD.
(python-shell-make-comint): Rename argument SHOW from POP.  Use
display-buffer instead of pop-to-buffer.
(run-python): Doc fix.  Return process.
(python-shell-get-or-create-process): Make obsolete.

* test/automated/python-tests.el (python-shell-get-or-create-process-1)
(python-shell-get-or-create-process-2)
(python-shell-get-or-create-process-3): Remove tests.
2014-12-27 20:12:00 -03:00
Fabián Ezequiel Gallina
996ad1b846 Merge from origin/emacs-24
433af0a * lisp/progmodes/python.el (python-shell-buffer-substring): Handle cornercase when region sent starts at point-min.
2014-12-27 20:09:32 -03:00
Fabián Ezequiel Gallina
433af0a060 * lisp/progmodes/python.el (python-shell-buffer-substring): Handle
cornercase when region sent starts at point-min.
2014-12-27 17:22:29 -03:00
Fabián Ezequiel Gallina
35e1f9d9fc Merge from origin/emacs-24
a5f38fa Fix ChangeLog typo
c6400e1 Fix composition of characters from Syriac and Arabis scripts.
7e9dfde python.el: Fix message when sending region.
800260c python.el: Cleanup temp files even with eval errors.
ed65b91 Fix for previous commit
2dd5163 python.el: Handle file encoding for shell.
7aa506e Spelling fixes
4cd6d77 * automated/tramp-tests.el (tramp-test17-insert-directory): Do not expect a given order of "." and "..".
a41d07b Fix rendering of composed caharacters on the mode line.  (Bug#19435)
b70977c Small doc markup fixes
73c050c * doc/lispref/modes.texi (Defining Minor Modes, SMIE Lexer): Markup fixes.
1783e6c ChangeLog fix
c741b1b TUTORIAL.es: Improve style consistency
f89efea TUTORIAL.es: spelling fixes
0d48826 Avoid compiler warning.

Conflicts:
	doc/lispref/ChangeLog
	doc/lispref/control.texi
	etc/ChangeLog
	lisp/ChangeLog
	src/ChangeLog
	test/ChangeLog
2014-12-27 13:31:20 -03:00
Fabián Ezequiel Gallina
411c1c6531 Merge from origin/emacs-24
216c6aa * net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band): Use `tramp-rsh-end-of-line', it ought to be more robust.
20cfd24 Improve indexing on the chapter/section/subsection levels.
14c3739 * lisp/progmodes/js.el (js-syntax-propertize): "return" can't be divided.
ea78112 * net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band): Use "\n" as end-of-line delimeter for passwords, when running on MS Windows.
012479a * lisp/progmodes/sh-script.el: Don't set global indent-line-function
75e114f Fix line numbers on Python shell.
d0fd23c doc/emacs/buffers.texi (Kill Buffer): Improve indexing.
8e818d1 Keep maximized when going fullscreen.
749813e python.el: Fix electric colon behavior
936d5e5 Fix last patch.
74d3b20 Fixes: debbugs:18623

Conflicts:
	doc/emacs/ChangeLog
	doc/lispref/ChangeLog
	doc/lispref/functions.texi
	lisp/ChangeLog
	src/ChangeLog
	src/xterm.c
	test/ChangeLog
2014-12-27 13:21:17 -03:00
Fabián Ezequiel Gallina
7e9dfded93 python.el: Fix message when sending region.
* lisp/progmodes/python.el (python-shell-send-region): Rename argument
send-name from nomain.  Fix message.
(python-shell-send-buffer): Rename argument send-name from arg.
2014-12-27 04:01:32 -03:00
Fabián Ezequiel Gallina
800260c4eb python.el: Cleanup temp files even with eval errors.
* lisp/progmodes/python.el (python-shell-send-file): Make file-name
mandatory.  Fix temp file removal in the majority of cases.
2014-12-27 03:38:32 -03:00
Fabián Ezequiel Gallina
ed65b91571 Fix for previous commit 2014-12-27 03:32:01 -03:00
Fabián Ezequiel Gallina
2dd5163d76 python.el: Handle file encoding for shell.
* 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.
2014-12-27 01:30:21 -03:00
Fabián Ezequiel Gallina
7284a174ab python.el: Generate clearer shell buffer names.
* lisp/progmodes/python.el (python-shell-get-process-name)
(python-shell-internal-get-process-name): Use `buffer-name`.
(python-shell-internal-get-or-create-process): Simplify.

* test/automated/python-tests.el (python-shell-get-process-name-1)
(python-shell-internal-get-process-name-1): Cleanup.
(python-shell-get-process-name-2)
(python-shell-internal-get-process-name-2): New tests.
(python-shell-calculate-command-1)
(python-shell-calculate-process-environment-3)
(python-shell-calculate-exec-path-2, python-shell-make-comint-1)
(python-shell-make-comint-2, python-shell-make-comint-4)
(python-shell-get-process-1, python-util-clone-local-variables-1):
Replace obsolete function and variable references with current.
2014-12-26 17:59:33 -03:00
Fabián Ezequiel Gallina
8cf42182b8 Revert "Prevent Python process shell buffer to pop twice."
This reverts commit 4256626a7a.
2014-12-26 17:14:18 -03:00
Fabián Ezequiel Gallina
75e114fa3b Fix line numbers on Python shell.
* lisp/progmodes/python.el (python-shell--save-temp-file): Do not
append coding cookie.
(python-shell-send-string): Generalize for
python-shell-send-region.
(python--use-fake-loc): Delete var.
(python-shell-buffer-substring): Cleanup fake-loc logic.
(python-shell-send-region): Remove fake-loc logic, simplify.
2014-12-23 00:45:22 -03:00
Fabián Ezequiel Gallina
749813e9d4 python.el: Fix electric colon behavior
* 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.
2014-12-22 02:24:42 -03:00
Ted Zlatanov
28e0d0c95d Merge from origin/emacs-24
bd6c441 * simple.el (password-word-equivalents): Add "passcode", used for numeric secrets like PINs or RSA tokens.
16d4c1c A better fix for bug#19346
82ec808 * .gitignore: Add !lib/std*.in.h, so as to not ignore the .in.h files.
3cf7629 Git ignore lib/std*.h
301a401 Always define `gnutls-available-p' even if GnuTLS is not available.
d76b9b2 Don't break example string between 2 lines (bug#19257)
75b4857 Port commit-msg to mawk
9ac0332 Improve commit-msg messages and autosquash
0c2f254 Support overflow-newline-into-fringe together with word-wrap (bug#19300)
935ee05 * net/tramp-sh.el (tramp-get-remote-path): Use a login shell in order to determine `tramp-own-remote-path'.
c2db939 python.el: Support interpreter paths with spaces
d83f329 ChangeLog fix
0f9fbb9 Port commit-message checking to FreeBSD 9.
3db1ada admin/MAINTAINERS: Update my interests and responsibilities.
6382f24 * .gitignore: Ignore autosave files.

Conflicts:
	ChangeLog
	lisp/progmodes/python.el
	src/gnutls.c
2014-12-12 19:23:19 -05:00
Stefan Monnier
074965f935 * lisp/progmodes/python.el (python-indent-line): Use `noindent' in strings.
(python-indent-levels): Document extra value.
(python-indent-calculate-indentation): Return `noindent' in strings.
(python-indent-post-self-insert-function)
(python-indent-calculate-levels): Handle new value.
2014-12-12 09:55:42 -05:00
Fabián Ezequiel Gallina
c2db939359 python.el: Support interpreter paths with spaces
Fixes: debbugs:19289

* lisp/progmodes/python.el (python-shell-parse-command): Quote
`python-shell-interpreter`.
2014-12-08 22:32:53 -03:00
Fabián Ezequiel Gallina
afa1d80fe0 python.el: Don't change `comint-prompt-read-only' globally
Fixes: debbugs:19288

* lisp/progmodes/python.el (inferior-python-mode): Set
`comint-prompt-read-only` to `t` only locally.
2014-12-08 22:19:37 -03:00
Tom Willemse
9dfa949c0d * lisp/progmodes/python.el: Recognize docstrings.
(python-docstring-at-p, python-font-lock-syntactic-face-function):
New functions.
(python-mode): Use them.
2014-12-07 11:24:35 -05:00
Stefan Monnier
0bb24df135 Merge from origin/emacs-24
bb19b22 Python.el: Update commentary on RET-behavior
2014-12-05 15:12:00 -05:00
Rasmus
bb19b229f9 Python.el: Update commentary on RET-behavior
Commentary reflect that `electric-indent-mode' in enabled by default.
2014-11-29 13:58:20 -03:00
Paul Eggert
0cce3623b1 Merge branch 'emacs-24'. 2014-11-28 23:07:16 -08:00
Fabián Ezequiel Gallina
7bf7edf53f * lisp/progmodes/python.el (python-shell-completion-setup-code): Use
__builtin__ module (or builtins in Python 3) and catch all errors
when importing readline and rlcompleter.
2014-11-26 23:45:24 -03:00
Ted Zlatanov
ba4502fe14 Merge branch 'emacs-24'
Conflicts:
	nt/addsection.c
	nt/inc/ms-w32.h
	src/w32.c
2014-11-26 21:31:11 -05:00
Fabián Ezequiel Gallina
238c052fdb Set PYTHONUNBUFFERED on shell startup.
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.
2014-11-22 20:09:30 -03:00
Fabián Ezequiel Gallina
c2e145b237 * lisp/progmodes/python.el (python-mode): Avoid use of set-local to
keep Emacs 24.x compatibility.
2014-11-16 17:59:42 -03:00
Fabián Ezequiel Gallina
651ebee618 Fixes: debbugs:18596
* lisp/progmodes/python.el (run-python): Allow CMD to be optional and
default it to a safe command, even for Windows.  (bug#18596)
2014-11-16 11:20:25 -03:00
Fabián Ezequiel Gallina
cf100f60a6 Prevent resizing the echo area when iPython is enabled
Fixes: debbugs:18794

* lisp/progmodes/python.el (python-eldoc--get-doc-at-point): Strip
shell output before returning.
2014-11-16 11:11:49 -03:00
Fabián Ezequiel Gallina
6f167f95dc * lisp/progmodes/python.el (python-shell-calculate-command): Rename
from python-shell-parse-command.  Cleanup.
(run-python, run-python-internal): Use it.
(python-shell-calculate-pythonpath): Rename from
python-new-pythonpath.
(python-shell-calculate-process-environment): Use it.
(python-shell-calculate-exec-path): Add comment.

* test/automated/python-tests.el
(python-shell-calculate-process-environment-2): Fix test.
(python-shell-calculate-process-environment-1)
(python-shell-calculate-process-environment-3): Cleanup.
2014-11-16 10:47:14 -03:00
Stefan Monnier
9075fcc193 Merge from emacs-24 2014-11-16 00:22:20 -05:00
Fabián Ezequiel Gallina
92f58578cc Fixes: debbugs:18432
* 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.
2014-11-15 19:02:52 -03:00
Fabián Ezequiel Gallina
89ebffc1f6 Fix region indentation
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.
2014-11-15 18:10:58 -03:00
Fabián Ezequiel Gallina
9ae5396b8f Eldoc setup code enhancements
Fixes: debbugs:18962

* lisp/progmodes/python.el (python-eldoc-setup-code): Enhance string
type checks, simplify printing.
2014-11-15 15:50:30 -03:00
Ivan Andrus
15ec2d7cff Backport Use derived-mode-p in python.el instead of equality test with major-mode
Fixes: debbugs:18854

* progmodes/python.el (python-ffap-module-path): Use
`derived-mode-p' instead of equality test on `major-mode'.
2014-11-14 21:56:11 -07:00
Ivan Andrus
f20a19df87 Use derived-mode-p in python.el instead of equality test on major-mode
* progmodes/python.el (python-shell-font-lock-kill-buffer):
(python-shell-font-lock-with-font-lock-buffer)
(python-shell-get-buffer, python-ffap-module-path): Use
`derived-mode-p' instead of equality test on `major-mode'.
2014-11-14 13:54:10 -07:00
Fabián Ezequiel Gallina
eb97699236 Rename python-shell-virtualenv-path to fit GNU conventions
* lisp/progmodes/python.el (python-shell-virtualenv-root): Rename from
python-shell-virtualenv-path.
(python-shell-internal-get-process-name)
(python-shell-calculate-process-environment)
(python-shell-calculate-exec-path): Use it.
2014-11-14 03:26:08 -03:00
Fabián Ezequiel Gallina
5d977b968c * lisp/progmodes/python.el (python-shell-completion-get-completions):
Fix previous merge.
2014-11-14 02:29:40 -03:00
Stefan Monnier
c9f7e33c60 * lisp/progmodes/python.el (inferior-python-mode): Use add-hook. 2014-10-20 18:37:04 -04:00
Glenn Morris
b1d5ab0352 Merge from emacs-24; up to 2014-07-26T11:58:24Z!schwab@linux-m68k.org 2014-10-12 15:56:45 -07:00
Fabián Ezequiel Gallina
b1be0eda33 Fix import completion.
* lisp/progmodes/python.el (python-shell-completion-get-completions):
Fix import case regexp.

Fixes: debbugs:18582
2014-10-12 12:12:04 -03:00
Stefan Monnier
cb325041b0 * lisp/progmodes/python.el: Avoid building unneeded markers.
(python-font-lock-keywords, python-indent-dedent-line)
(python-fill-paren, python-shell-completion-complete-or-indent):
Prefer point over point-marker.
(inferior-python-mode): Remove redundant completion settings.
2014-10-03 22:35:28 -04:00
Stefan Monnier
d7f413b893 Merge from emacs-24 2014-10-02 11:13:05 -04:00
Stefan Monnier
85ee81a08f * lisp/progmodes/python.el (python-shell-completion-get-completions):
Use python-shell--prompt-calculated-input-regexp from the
process buffer.
Don't assume that `line' comes from the process buffer.

Fixes: debbugs:18582
2014-09-30 20:41:51 -04:00
Stefan Monnier
07bec0fc67 Merge from emacs-24 2014-09-30 19:19:31 -04:00
Leonardo Nobrega
d3b7a90bc2 * lisp/progmodes/python.el (python-fill-paren): Don't inf-loop at EOB.
Fixes: debbugs:18462
2014-09-30 19:00:57 -04:00
Stefan Monnier
cbdc06f3be Rename 24.5 to 25.1
Except where we expect to backport the corresponding change.
2014-09-29 14:14:08 -04:00
Paul Eggert
0f2ed59206 Spelling fixes.
* lisp/ses.el (ses-file-format-extend-parameter-list): Rename from
ses-file-format-extend-paramter-list.  All uses changed.
* lisp/gnus-cloud.el (gnus-cloud-parse-version-1): Fix misspelling
of ":delete".
2014-09-11 12:44:25 -07:00
Glenn Morris
62fca47221 Merge from emacs-24; up to 2014-07-04T02:28:54Z!dmantipov@yandex.ru 2014-09-02 21:21:40 -07:00
Fabián Ezequiel Gallina
0e4c8f1856 * lisp/progmodes/python.el (python-indent-post-self-insert-function):
Avoid electric colon at beginning-of-defun. 

* test/automated/python-tests.el:
(python-indent-electric-colon-1): New test.  (Bug#18228)
2014-09-01 19:51:46 -03:00
Glenn Morris
6d26235315 Merge from emacs-24; up to 2014-07-02T00:57:53Z!juri@jurta.org 2014-08-27 18:59:29 -07:00
Sam Steingold
3f05baa175 Extract python-new-pythonpath to handle PYTHONPATH in user code
* lisp/progmodes/python.el (python-new-pythonpath): Extract from
`python-shell-calculate-process-environment'.
2014-08-20 11:33:10 -04:00