summaryrefslogtreecommitdiff
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el19
1 files changed, 10 insertions, 9 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 214b6f0e24c..cee59a6e3e1 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -297,10 +297,9 @@ comments and strings, or that the bracket/paren nesting depth is nonzero."
(syntax-ppss (line-beginning-position)))))))
(defun python-comment-line-p ()
- "Return non-nil if current line has only a comment or is blank."
+ "Return non-nil iff current line has only a comment."
(save-excursion
(end-of-line)
- ;; FIXME: This looks wrong because it returns nil for empty lines. --Stef
(when (eq 'comment (syntax-ppss-context (syntax-ppss)))
(back-to-indentation)
(looking-at (rx (or (syntax comment-start) line-end))))))
@@ -1025,7 +1024,6 @@ et al.")
(let ((map (make-sparse-keymap)))
;; This will inherit from comint-mode-map.
(define-key map "\C-c\C-l" 'python-load-file)
- (define-key map "\C-c\C-z" 'python-switch-to-python) ;What for? --Stef
(define-key map "\C-c\C-v" 'python-check)
;; Note that we _can_ still use these commands which send to the
;; Python process even at the prompt iff we have a normal prompt,
@@ -1140,10 +1138,12 @@ to this as appropriate. Runs the hook `inferior-python-mode-hook'
;; (not a name) in Python buffers from which `run-python' &c is
;; invoked. Would support multiple processes better.
(unless (comint-check-proc python-buffer)
- (let ((cmdlist (append (python-args-to-list cmd) '("-i")))
- (process-environment ; to import emacs.py
- (push (concat "PYTHONPATH=" data-directory)
- process-environment)))
+ (let* ((cmdlist (append (python-args-to-list cmd) '("-i")))
+ (path (getenv "PYTHONPATH"))
+ (process-environment ; to import emacs.py
+ (push (concat "PYTHONPATH=" data-directory
+ (if path (concat ":" path)))
+ process-environment)))
(set-buffer (apply 'make-comint "Python" (car cmdlist) nil
(cdr cmdlist)))
(setq python-buffer "*Python*"))
@@ -1278,7 +1278,6 @@ module-qualified names."
;; Fixme: I'm not convinced by this logic from python-mode.el.
(python-send-command
(if (string-match "\\.py\\'" file-name)
- ;; Fixme: make sure the directory is in the path list
(let ((module (file-name-sans-extension
(file-name-nondirectory file-name))))
(format "emacs.eimport(%S,%S)"
@@ -1309,6 +1308,7 @@ See variable `python-buffer'. Starts a new process if necessary."
Otherwise inherits from `python-mode-syntax-table'.")
(defvar view-return-to-alist)
+(eval-when-compile (autoload 'help-buffer "help-fns"))
;; Fixme: Should this actually be used instead of info-look, i.e. be
;; bound to C-h S? Can we use other pydoc stuff before python 2.2?
@@ -1394,7 +1394,8 @@ Used with `eval-after-load'."
;; Don't use `info' because it would pop-up a *info* buffer.
(with-no-warnings
(Info-goto-node (format "(python%s-lib)Miscellaneous Index"
- version)))
+ version))
+ t)
(error nil)))))
(info-lookup-maybe-add-help
:mode 'python-mode