(original) (raw)
Index: python-mode.el =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/python-mode.el,v retrieving revision 4.8 diff -u -r4.8 python-mode.el --- python-mode.el 18 Mar 2002 18:53:56 -0000 4.8 +++ python-mode.el 22 Apr 2002 15:22:01 -0000 @@ -1355,14 +1349,17 @@ (format "python-%d-%d" sn pid) (format "python-%d" sn))) (make-temp-name "python-"))) - (file (expand-file-name temp py-temp-directory)) + (file (concat (expand-file-name temp py-temp-directory) ".py")) (cur (current-buffer)) - (buf (get-buffer-create file))) + (buf (get-buffer-create file)) + shell) ;; Write the contents of the buffer, watching out for indented regions. (save-excursion (goto-char start) (let ((needs-if (/= (py-point 'bol) (py-point 'boi)))) (set-buffer buf) + (python-mode) + (setq shell py-which-shell) (when needs-if (insert "if 1:\n")) (insert-buffer-substring cur start end))) @@ -1377,7 +1374,7 @@ ;; TBD: a horrible hack, but why create new Custom variables? (arg (if (string-equal py-which-bufname "Python") "-u" ""))) - (start-process py-which-bufname buf py-which-shell arg file) + (start-process py-which-bufname buf shell arg file) (pop-to-buffer buf) (py-postprocess-output-buffer buf) ;; TBD: clean up the temporary file! @@ -1396,7 +1393,7 @@ (setq py-exception-buffer (cons file (current-buffer)))) (t ;; TBD: a horrible hack, buy why create new Custom variables? - (let ((cmd (concat py-which-shell + (let ((cmd (concat shell (if (string-equal py-which-bufname "JPython") " -" "")))) ;; otherwise either run it synchronously in a subprocess