diff options
| author | Stefan Monnier | 2004-05-10 18:36:09 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2004-05-10 18:36:09 +0000 |
| commit | 522067b2d47f58a9ccafebf2385c2342c21995c1 (patch) | |
| tree | 8e4bdc7fd6386c9c7be22c464382d0836c363074 /lisp/progmodes/python.el | |
| parent | aa7094ba0f8c5681b294f7525a1e4667a3c9c76f (diff) | |
| download | emacs-522067b2d47f58a9ccafebf2385c2342c21995c1.tar.gz emacs-522067b2d47f58a9ccafebf2385c2342c21995c1.zip | |
(help-buffer): Autoload when compiling.
(python-after-info-look): Don't assume Info-goto-node returns non-nil.
(run-python): Prepend to any existing PYTHONPATH.
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 369b479066c..cee59a6e3e1 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -1138,10 +1138,12 @@ to this as appropriate. Runs the hook `inferior-python-mode-hook' | |||
| 1138 | ;; (not a name) in Python buffers from which `run-python' &c is | 1138 | ;; (not a name) in Python buffers from which `run-python' &c is |
| 1139 | ;; invoked. Would support multiple processes better. | 1139 | ;; invoked. Would support multiple processes better. |
| 1140 | (unless (comint-check-proc python-buffer) | 1140 | (unless (comint-check-proc python-buffer) |
| 1141 | (let ((cmdlist (append (python-args-to-list cmd) '("-i"))) | 1141 | (let* ((cmdlist (append (python-args-to-list cmd) '("-i"))) |
| 1142 | (process-environment ; to import emacs.py | 1142 | (path (getenv "PYTHONPATH")) |
| 1143 | (push (concat "PYTHONPATH=" data-directory) | 1143 | (process-environment ; to import emacs.py |
| 1144 | process-environment))) | 1144 | (push (concat "PYTHONPATH=" data-directory |
| 1145 | (if path (concat ":" path))) | ||
| 1146 | process-environment))) | ||
| 1145 | (set-buffer (apply 'make-comint "Python" (car cmdlist) nil | 1147 | (set-buffer (apply 'make-comint "Python" (car cmdlist) nil |
| 1146 | (cdr cmdlist))) | 1148 | (cdr cmdlist))) |
| 1147 | (setq python-buffer "*Python*")) | 1149 | (setq python-buffer "*Python*")) |
| @@ -1276,7 +1278,6 @@ module-qualified names." | |||
| 1276 | ;; Fixme: I'm not convinced by this logic from python-mode.el. | 1278 | ;; Fixme: I'm not convinced by this logic from python-mode.el. |
| 1277 | (python-send-command | 1279 | (python-send-command |
| 1278 | (if (string-match "\\.py\\'" file-name) | 1280 | (if (string-match "\\.py\\'" file-name) |
| 1279 | ;; Fixme: make sure the directory is in the path list | ||
| 1280 | (let ((module (file-name-sans-extension | 1281 | (let ((module (file-name-sans-extension |
| 1281 | (file-name-nondirectory file-name)))) | 1282 | (file-name-nondirectory file-name)))) |
| 1282 | (format "emacs.eimport(%S,%S)" | 1283 | (format "emacs.eimport(%S,%S)" |
| @@ -1307,6 +1308,7 @@ See variable `python-buffer'. Starts a new process if necessary." | |||
| 1307 | Otherwise inherits from `python-mode-syntax-table'.") | 1308 | Otherwise inherits from `python-mode-syntax-table'.") |
| 1308 | 1309 | ||
| 1309 | (defvar view-return-to-alist) | 1310 | (defvar view-return-to-alist) |
| 1311 | (eval-when-compile (autoload 'help-buffer "help-fns")) | ||
| 1310 | 1312 | ||
| 1311 | ;; Fixme: Should this actually be used instead of info-look, i.e. be | 1313 | ;; Fixme: Should this actually be used instead of info-look, i.e. be |
| 1312 | ;; bound to C-h S? Can we use other pydoc stuff before python 2.2? | 1314 | ;; bound to C-h S? Can we use other pydoc stuff before python 2.2? |
| @@ -1392,7 +1394,8 @@ Used with `eval-after-load'." | |||
| 1392 | ;; Don't use `info' because it would pop-up a *info* buffer. | 1394 | ;; Don't use `info' because it would pop-up a *info* buffer. |
| 1393 | (with-no-warnings | 1395 | (with-no-warnings |
| 1394 | (Info-goto-node (format "(python%s-lib)Miscellaneous Index" | 1396 | (Info-goto-node (format "(python%s-lib)Miscellaneous Index" |
| 1395 | version))) | 1397 | version)) |
| 1398 | t) | ||
| 1396 | (error nil))))) | 1399 | (error nil))))) |
| 1397 | (info-lookup-maybe-add-help | 1400 | (info-lookup-maybe-add-help |
| 1398 | :mode 'python-mode | 1401 | :mode 'python-mode |