diff options
| author | Stefan Monnier | 2006-09-09 19:42:35 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2006-09-09 19:42:35 +0000 |
| commit | d8ca7d34751c7602f50e8ad4860a026f26f3f24a (patch) | |
| tree | 9226b9c3e84174fe55bf8e43cdbc11885d834a32 /lisp/progmodes/python.el | |
| parent | 46d6e6920075af484a606821ab5d5cc2404e19bb (diff) | |
| download | emacs-d8ca7d34751c7602f50e8ad4860a026f26f3f24a.tar.gz emacs-d8ca7d34751c7602f50e8ad4860a026f26f3f24a.zip | |
Quieten the compiler about hippie-expand vars.
(python-send-string): Be slightly more careful about adding \n.
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 66d8cd4714f..1299ff368d9 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -67,7 +67,8 @@ | |||
| 67 | (eval-when-compile | 67 | (eval-when-compile |
| 68 | (require 'cl) | 68 | (require 'cl) |
| 69 | (require 'compile) | 69 | (require 'compile) |
| 70 | (require 'comint)) | 70 | (require 'comint) |
| 71 | (require 'hippie-exp)) | ||
| 71 | 72 | ||
| 72 | (autoload 'comint-mode "comint") | 73 | (autoload 'comint-mode "comint") |
| 73 | 74 | ||
| @@ -1424,11 +1425,13 @@ COMMAND should be a single statement." | |||
| 1424 | "Evaluate STRING in inferior Python process." | 1425 | "Evaluate STRING in inferior Python process." |
| 1425 | (interactive "sPython command: ") | 1426 | (interactive "sPython command: ") |
| 1426 | (comint-send-string (python-proc) string) | 1427 | (comint-send-string (python-proc) string) |
| 1427 | (comint-send-string (python-proc) | 1428 | (unless (string-match "\n\\'" string) |
| 1428 | ;; If the string is single-line or if it ends with \n, | 1429 | ;; Make sure the text is properly LF-terminated. |
| 1429 | ;; only add a single \n, otherwise add 2, so as to | 1430 | (comint-send-string (python-proc) "\n")) |
| 1430 | ;; make sure we terminate the multiline instruction. | 1431 | (when (string-match "\n[ \t].*\n?\\'" string) |
| 1431 | (if (string-match "\n.+\\'" string) "\n\n" "\n"))) | 1432 | ;; If the string contains a final indented line, add a second newline so |
| 1433 | ;; as to make sure we terminate the multiline instruction. | ||
| 1434 | (comint-send-string (python-proc) "\n"))) | ||
| 1432 | 1435 | ||
| 1433 | (defun python-send-buffer () | 1436 | (defun python-send-buffer () |
| 1434 | "Send the current buffer to the inferior Python process." | 1437 | "Send the current buffer to the inferior Python process." |