I'm trying to get Aquamacs 3.0a GNU Emacs 24.3.50.2 to become my IDE for python development, and I'd like to use iPython 1.2.0 as my interpreter (with Python 2.7.6). The relevant parts of my .emacs file are
(require 'python-mode)
And in my `customizations.el` file:
(custom-set-variables
[...]
'(py-force-py-shell-name-p t)
'(py-python-command-args (quote ("-i" "--pylab")))
'(py-shell-name "ipython")
'(py-start-run-ipython-shell nil) [...]
I can start the iPython interpreter easily (e.g ^C^C from some python file), but tab completion is not working from the interpreter. For example, typing `pl` [tab] produces the message `progn: End of buffer`. If I instead use `M-x ipython-complete`, I get an error with the following backtrace:
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
format(nil "pl")
(process-send-string proc (format ccs pattern))
(if (string= pattern "") (tab-to-tab-stop) (process-send-string proc (format ccs pattern)) (accept-process-output proc 0.2) (if ugly-return (progn (setq completions (split-string (substring ugly-return 0 (position 10 ugly-return)) sep)) (if debug (progn (setq py-shell-complete-debug completions))) (py-shell-complete-finally)) (message "%s" "No response from Python process. Please check your configuration. If config is okay, please file a bug-regport at http://launchpad.net/python-mode")))
(let* (py-fontify-shell-buffer-p (oldbuf (current-buffer)) (pos (or pos (copy-marker (point)))) (beg (or beg (save-excursion (skip-chars-backward "a-z0-9A-Z_." (point-at-bol)) (point)))) (end (or end (point))) (pattern (or word (buffer-substring-no-properties beg end))) (sep ";") (py-shell-name (or shell (py-choose-shell))) (processlist (process-list)) (imports (or imports (py-find-imports))) (py-completion-buffer py-ipython-completions) done (process (if ipython-complete-use-separate-shell-p (if (and (buffer-live-p py-ipython-completions) (comint-check-proc (process-name ...))) nil (get-buffer-process (py-shell nil nil py-shell-name py-ipython-completions t))) (progn (while (and processlist (not done)) (if (and ... ... ...) (progn)) (setq processlist (cdr processlist))) done))) (proc (or process (get-buffer-process (py-shell nil nil (if (string-match "[iI][pP]ython[^[:alpha:]]*$" py-shell-name) "ipython") nil t)))) (comint-output-filter-functions (delq (quote py-comint-output-filter-function) comint-output-filter-functions)) (comint-preoutput-filter-functions (append comint-preoutput-filter-functions (quote (ansi-color-filter-apply (lambda (string) (setq ugly-return ...) ""))))) (ccs (or completion-command-string (if imports (concat imports (py-set-ipython-completion-command-string)) (py-set-ipython-completion-command-string)))) completion completions completion-table ugly-return) (if (string= pattern "") (tab-to-tab-stop) (process-send-string proc (format ccs pattern)) (accept-process-output proc 0.2) (if ugly-return (progn (setq completions (split-string (substring ugly-return 0 (position 10 ugly-return)) sep)) (if debug (progn (setq py-shell-complete-debug completions))) (py-shell-complete-finally)) (message "%s" "No response from Python process. Please check your configuration. If config is okay, please file a bug-regport at http://launchpad.net/python-mode"))))
ipython-complete()
call-interactively(ipython-complete record nil)
command-execute(ipython-complete record)
execute-extended-command(nil "ipython-complete")
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command)
Am 25.02.2014 04:05, schrieb Mike McCoy: set-variables py-shell- name-p t) command- args (quote ("-i" "--pylab"))) run-ipython- shell nil) [...]
> Public bug reported:
>
> I'm trying to get Aquamacs 3.0a GNU Emacs 24.3.50.2 to become my IDE for python development, and I'd like to use iPython 1.2.0 as my interpreter (with Python 2.7.6). The relevant parts of my .emacs file are
>
> (require 'python-mode)
>
> And in my `customizations.el` file:
>
> (custom-
> [...]
> '(py-force-
> '(py-python-
> '(py-shell-name "ipython")
> '(py-start-
>
> I can start the iPython interpreter easily (e.g ^C^C from some python
> file),
which would mean using a side-effect here.
M-x ipython RET should start it.
> but tab completion is not working from the interpreter.
TAB indents, it's also an edit-mode
M-TAB does completion
For type-argument stringp nil) send-string proc (format ccs pattern)) send-string proc (format ccs pattern)) (accept- process- output proc 0.2) (if ugly-return (progn (setq completions (split-string (substring ugly-return 0 (position 10 ugly-return)) sep)) (if debug (progn (setq py-shell- complete- debug completions))) (py-shell- complete- finally) ) (message "%s" "No response from Python process. Please check your configuration. If config is okay, please file a bug-regport at http:// launchpad. net/python- mode"))) shell-buffer- p (oldbuf (current-buffer)) (pos (or pos (copy-marker (point)))) (beg (or beg (save-excursion (skip-chars- backward "a-z0-9A-Z_." (point-at-bol)) (point)))) (end (or end (point))) (pattern (or word (buffer- substring- no-properties beg end))) (sep ";") (py-shell-name (or shell (py-choose-shell))) (processlist (process-list)) (imports (or imports (py-find-imports))) (py-completion- buffer py-ipython- completions) done (process (if ipython- complete- use-separate- shell-p (if (and (buffer-live-p py-ipython- completions) (comint-check-proc (process-name ...))) nil (get-buffer-process (py-shell nil nil py-shell-name py-ipython- completions t))) (progn (while (and processlist (not done)) (if (and ... ... ...) (progn)) (setq processlist (cdr processlist))) done))) (proc (or process (get-buffer-process (py-shell nil nil (if (string-match "[iI][pP] ython[^ [:alpha: ]]*$" py-shell-name) "ipython") nil t)))) (comint- output- filter- functions (delq (quote py-comint-output-fi output- filter- functions) ) (comint- preoutput- filter- functions (append comint- preoutput- filter- functions (quote (ansi-color- filter- apply (lambda (string) (setq ugly-return ...) ""))))) (ccs (or completion- command- string (if imports (concat imports (py-set- ipython- completion- command- string) ) (py-set- ipython- completion- command- string) ))) completion completions completion-table ugly-return) (if (string= pattern "") (tab-to-tab-stop) (process- send-string proc (format ccs pattern)) (accept- process- output proc 0.2) ...
> example, typing `pl` [tab] produces the message `progn: End of buffer`.
> If I instead use `M-x ipython-complete`, I get an error with the
> following backtrace:
>
> Debugger entered--Lisp error: (wrong-
> format(nil "pl")
> (process-
> (if (string= pattern "") (tab-to-tab-stop) (process-
> (let* (py-fontify-
lter-function) comint-