~a-roehler/python-mode/XEmacs-compat-test

« back to all changes in this revision

Viewing changes to python-mode.el

  • Committer: Andreas Roehler
  • Date: 2012-01-19 09:26:30 UTC
  • Revision ID: andreas.roehler@online.de-20120119092630-g4xatd0hx10pc9an
`py-shell' proceedings further cleanup



Show diffs side-by-side

added added

removed removed

Lines of Context:
5034
5034
;;; Python named shells
5035
5035
(defun python (&optional argprompt)
5036
5036
  "Start an Python interpreter in another window.
5037
 
 
5038
 
With optional \\[universal-argument] user is prompted
5039
 
for options to pass to the Python interpreter. "
 
5037
   With optional \\[universal-argument] user is prompted
 
5038
    for options to pass to the Python interpreter. "
5040
5039
  (interactive)
5041
 
  (let ((py-shell-name "python"))
5042
 
    (py-shell argprompt)))
 
5040
  (py-set-shell-completion-environment)
 
5041
  (py-shell argprompt nil "python"))
5043
5042
 
5044
5043
(defun python2 (&optional argprompt)
5045
5044
  "Start an Python2 interpreter in another window.
5046
 
 
5047
 
With optional \\[universal-argument] user is prompted
5048
 
for options to pass to the Python2 interpreter. "
 
5045
   With optional \\[universal-argument] user is prompted
 
5046
    for options to pass to the Python2 interpreter. "
5049
5047
  (interactive)
5050
 
  (let ((py-shell-name "python2"))
5051
 
    (py-shell argprompt)))
 
5048
  (py-set-shell-completion-environment)
 
5049
  (py-shell argprompt nil "python2"))
5052
5050
 
5053
5051
(defun python2.7 (&optional argprompt)
5054
5052
  "Start an Python2.7 interpreter in another window.
5055
 
 
5056
 
With optional \\[universal-argument] user is prompted
5057
 
for options to pass to the Python2.7 interpreter. "
 
5053
   With optional \\[universal-argument] user is prompted
 
5054
    for options to pass to the Python2.7 interpreter. "
5058
5055
  (interactive)
5059
 
  (let ((py-shell-name "python2.7"))
5060
 
    (py-shell argprompt)))
 
5056
  (py-set-shell-completion-environment)
 
5057
  (py-shell argprompt nil "python2.7"))
5061
5058
 
5062
5059
(defun python3 (&optional argprompt)
5063
5060
  "Start an Python3 interpreter in another window.
5064
 
 
5065
 
With optional \\[universal-argument] user is prompted
5066
 
for options to pass to the Python3 interpreter. "
 
5061
   With optional \\[universal-argument] user is prompted
 
5062
    for options to pass to the Python3 interpreter. "
5067
5063
  (interactive)
5068
 
  (let ((py-shell-name "python3"))
5069
 
    (py-shell argprompt)))
 
5064
  (py-set-shell-completion-environment)
 
5065
  (py-shell argprompt nil "python3"))
5070
5066
 
5071
5067
(defun python3.2 (&optional argprompt)
5072
5068
  "Start an Python3.2 interpreter in another window.
5073
 
 
5074
 
With optional \\[universal-argument] user is prompted
5075
 
for options to pass to the Python3.2 interpreter. "
 
5069
   With optional \\[universal-argument] user is prompted
 
5070
    for options to pass to the Python3.2 interpreter. "
5076
5071
  (interactive)
5077
 
  (let ((py-shell-name "python3.2"))
5078
 
    (py-shell argprompt)))
 
5072
  (py-set-shell-completion-environment)
 
5073
  (py-shell argprompt nil "python3.2"))
5079
5074
 
 
5075
(defalias 'iyp 'ipython)
 
5076
(defalias 'ipy 'ipython)
5080
5077
(defun ipython (&optional argprompt)
5081
5078
  "Start an IPython interpreter in another window.
5082
 
 
5083
 
With optional \\[universal-argument] user is prompted
5084
 
for options to pass to the IPython interpreter. "
 
5079
   With optional \\[universal-argument] user is prompted
 
5080
    for options to pass to the IPython interpreter. "
5085
5081
  (interactive)
5086
 
  (let* ((py-shell-name "ipython"))
5087
 
    (py-set-shell-completion-environment)
5088
 
    (py-shell argprompt)
5089
 
    (when (interactive-p) (switch-to-buffer (current-buffer))
5090
 
          (goto-char (point-max)))))
 
5082
  (py-set-shell-completion-environment)
 
5083
  (py-shell argprompt nil "ipython"))
5091
5084
 
5092
5085
(defun jython (&optional argprompt)
5093
5086
  "Start an Jython interpreter in another window.
5094
 
 
5095
 
With optional \\[universal-argument] user is prompted
5096
 
for options to pass to the Jython interpreter. "
 
5087
   With optional \\[universal-argument] user is prompted
 
5088
    for options to pass to the Jython interpreter. "
5097
5089
  (interactive)
5098
 
  (let ((py-shell-name "jython"))
5099
 
    (py-shell argprompt)))
 
5090
  (py-set-shell-completion-environment)
 
5091
  (py-shell argprompt nil "jython"))
5100
5092
 
5101
 
;;; Python dedicated shells
5102
5093
(defun python-dedicated (&optional argprompt)
5103
 
  "Start an unique Python interpreter in another window.
5104
 
 
5105
 
With optional \\[universal-argument] user is prompted
5106
 
for options to pass to the Python interpreter. "
 
5094
  "Start an Python dedicated interpreter in another window.
 
5095
   With optional \\[universal-argument] user is prompted
 
5096
    for options to pass to the Python interpreter. "
5107
5097
  (interactive)
5108
 
  (let ((py-shell-name "python"))
5109
 
    (py-shell argprompt t)))
 
5098
  (py-set-shell-completion-environment)
 
5099
  (py-shell argprompt t "python"))
5110
5100
 
5111
5101
(defun python2-dedicated (&optional argprompt)
5112
 
  "Start an unique Python2 interpreter in another window.
5113
 
 
5114
 
With optional \\[universal-argument] user is prompted
5115
 
for options to pass to the Python2 interpreter. "
 
5102
  "Start an Python2 dedicated interpreter in another window.
 
5103
   With optional \\[universal-argument] user is prompted
 
5104
    for options to pass to the Python2 interpreter. "
5116
5105
  (interactive)
5117
 
  (let ((py-shell-name "python2"))
5118
 
    (py-shell argprompt t)))
 
5106
  (py-set-shell-completion-environment)
 
5107
  (py-shell argprompt t "python2"))
5119
5108
 
5120
5109
(defun python2.7-dedicated (&optional argprompt)
5121
 
  "Start an unique Python2.7 interpreter in another window.
5122
 
 
5123
 
With optional \\[universal-argument] user is prompted
5124
 
for options to pass to the Python2.7 interpreter. "
 
5110
  "Start an Python2.7 dedicated interpreter in another window.
 
5111
   With optional \\[universal-argument] user is prompted
 
5112
    for options to pass to the Python2.7 interpreter. "
5125
5113
  (interactive)
5126
 
  (let ((py-shell-name "python2.7"))
5127
 
    (py-shell argprompt t)))
 
5114
  (py-set-shell-completion-environment)
 
5115
  (py-shell argprompt t "python2.7"))
5128
5116
 
5129
5117
(defun python3-dedicated (&optional argprompt)
5130
 
  "Start an unique Python3 interpreter in another window.
5131
 
 
5132
 
With optional \\[universal-argument] user is prompted
5133
 
for options to pass to the Python3 interpreter. "
 
5118
  "Start an Python3 dedicated interpreter in another window.
 
5119
   With optional \\[universal-argument] user is prompted
 
5120
    for options to pass to the Python3 interpreter. "
5134
5121
  (interactive)
5135
 
  (let ((py-shell-name "python3"))
5136
 
    (py-shell argprompt t)))
 
5122
  (py-set-shell-completion-environment)
 
5123
  (py-shell argprompt t "python3"))
5137
5124
 
5138
5125
(defun python3.2-dedicated (&optional argprompt)
5139
 
  "Start an unique Python3.2 interpreter in another window.
5140
 
 
5141
 
With optional \\[universal-argument] user is prompted
5142
 
for options to pass to the Python3.2 interpreter. "
 
5126
  "Start an Python3.2 dedicated interpreter in another window.
 
5127
   With optional \\[universal-argument] user is prompted
 
5128
    for options to pass to the Python3.2 interpreter. "
5143
5129
  (interactive)
5144
 
  (let ((py-shell-name "python3.2"))
5145
 
    (py-shell argprompt t)))
 
5130
  (py-set-shell-completion-environment)
 
5131
  (py-shell argprompt t "python3.2"))
5146
5132
 
5147
5133
(defun ipython-dedicated (&optional argprompt)
5148
 
  "Start an unique IPython interpreter in another window.
5149
 
 
5150
 
With optional \\[universal-argument] user is prompted
5151
 
for options to pass to the IPython interpreter. "
 
5134
  "Start an IPython dedicated interpreter in another window.
 
5135
   With optional \\[universal-argument] user is prompted
 
5136
    for options to pass to the IPython interpreter. "
5152
5137
  (interactive)
5153
 
  (let ((py-shell-name "ipython"))
5154
 
    (py-shell argprompt t)))
 
5138
  (py-set-shell-completion-environment)
 
5139
  (py-shell argprompt t "ipython"))
5155
5140
 
5156
5141
(defun jython-dedicated (&optional argprompt)
5157
 
  "Start an unique Jython interpreter in another window.
5158
 
 
5159
 
With optional \\[universal-argument] user is prompted
5160
 
for options to pass to the Jython interpreter. "
 
5142
  "Start an Jython dedicated interpreter in another window.
 
5143
   With optional \\[universal-argument] user is prompted
 
5144
    for options to pass to the Jython interpreter. "
5161
5145
  (interactive)
5162
 
  (let ((py-shell-name "jython"))
5163
 
    (py-shell argprompt t)))
 
5146
  (py-set-shell-completion-environment)
 
5147
  (py-shell argprompt t "jython"))
5164
5148
 
5165
5149
 
5166
5150
;; Code execution commands