~a-roehler/python-mode/python-mode-components

« back to all changes in this revision

Viewing changes to python-components-mode.el

  • Committer: Andreas Roehler
  • Date: 2012-03-07 18:33:14 UTC
  • Revision ID: andreas.roehler@online.de-20120307183314-rfiawxa44pr1e3zs
With C-u 4 `py-choose-shell' prompts for `py-shell-name' 


Show diffs side-by-side

added added

removed removed

Lines of Context:
4830
4830
 
4831
4831
When interactivly called, messages the shell name, Emacs would in the given circtumstances.
4832
4832
 
4833
 
To change the default Python interpreter, use `py-switch-shell'.
 
4833
With \\[universal-argument] 4 is called `py-switch-shells' see docu there.
4834
4834
"
4835
 
  (interactive)
4836
 
  (let* ((erg (cond (py-use-local-default
4837
 
                     (if (not (string= "" py-shell-local-path))
4838
 
                         (expand-file-name py-shell-local-path)
4839
 
                       (message "Abort: `py-use-local-default' is set to `t' but `py-shell-local-path' is empty. Maybe call `py-toggle-local-default-use'")))
4840
 
                    ((py-choose-shell-by-shebang))
4841
 
                    ((py-choose-shell-by-import))
4842
 
                    (t (default-value 'py-shell-name))))
4843
 
         (cmd (if py-edit-only-p erg
4844
 
                (executable-find erg))))
4845
 
    (if cmd
4846
 
        (when (interactive-p)
4847
 
          (message "%s" cmd))
4848
 
      (when (interactive-p) (message "%s" "Could not detect Python on your system. Maybe set `py-edit-only-p'?")))
4849
 
    erg))
 
4835
  (interactive "P")
 
4836
  (if (eq 4 (prefix-numeric-value arg))
 
4837
      (py-switch-shells '(4))
 
4838
    (let* ((erg (cond (py-use-local-default
 
4839
                       (if (not (string= "" py-shell-local-path))
 
4840
                           (expand-file-name py-shell-local-path)
 
4841
                         (message "Abort: `py-use-local-default' is set to `t' but `py-shell-local-path' is empty. Maybe call `py-toggle-local-default-use'")))
 
4842
                      ((py-choose-shell-by-shebang))
 
4843
                      ((py-choose-shell-by-import))
 
4844
                      (t (default-value 'py-shell-name))))
 
4845
           (cmd (if py-edit-only-p erg
 
4846
                  (executable-find erg))))
 
4847
      (if cmd
 
4848
          (when (interactive-p)
 
4849
            (message "%s" cmd))
 
4850
        (when (interactive-p) (message "%s" "Could not detect Python on your system. Maybe set `py-edit-only-p'?")))
 
4851
      erg)))
 
4852
 
4850
4853
 
4851
4854
(defadvice pdb (before gud-query-cmdline activate)
4852
4855
  "Provide a better default command line when called interactively."