Using r1056 under Windows, if I try to complete the string "ex" in a script window, an *IPython Completion* buffer opens with the correct completions listed, but I also get the following error:
Debugger entered--Lisp error: (void-function word-at-point)
(word-at-point)
(progn (forward-word -1) (delete-other-windows) (word-at-point))
(if (search-forward (car (all-completions pattern completions))) (progn (forward-word -1) (delete-other-windows) (word-at-point)))
(when (search-forward (car (all-completions pattern completions))) (forward-word -1) (delete-other-windows) (word-at-point))
(cond ((eq completion t) (if (eq this-command last-command) (when python-completion-original-window-configuration (set-window-configuration python-completion-original-window-configuration))) (setq python-completion-original-window-configuration nil) (message "Can't find completion for \"%s\"" pattern) (ding) nil) ((not (string= pattern completion)) (progn (delete-char (- (length pattern))) (insert completion) nil)) ((< 1 (length completions)) (unless python-completion-original-window-configuration (setq python-completion-original-window-configuration (current-window-configuration))) (with-output-to-temp-buffer "*IPython Completions*" (display-completion-list (all-completions pattern completions))) (set-buffer "*IPython Completions*") (switch-to-buffer "*IPython Completions*") (goto-char (point-min)) (when (search-forward (car (all-completions pattern completions))) (forward-word -1) (delete-other-windows) (word-at-point))) ((null completion) (message "Can't find completion for \"%s\"" pattern) (ding)))
(let* ((beg (or beg (progn (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 ";") (shell (py-choose-shell)) (pyshellname (if (string-match "ipython" shell) shell "ipython")) (processlist (process-list)) done (process (if ipython-complete-use-separate-shell-p (unless (and (buffer-live-p "*IPython-Complete*") (comint-check-proc (process-name ...))) (get-buffer-process (py-shell nil nil pyshellname (quote noswitch) nil "*IPython-Complete*"))) (progn (while (and processlist (not done)) (when (and ... ... ...)) (setq processlist (cdr processlist))) done))) (python-process (or process (get-buffer-process (py-shell nil nil (if (string-match "[iI][pP]ython[^[:alpha:]]*$" pyshellname) pyshellname "ipython") (quote noswitch) nil)))) (comint-output-filter-functions (delq (quote py-comint-output-filter-function) comint-output-filter-functions)) (comint-output-filter-functions (append comint-output-filter-functions (quote (ansi-color-filter-apply (lambda (string) (setq ugly-return ...) (delete-region comint-last-output-start ...)))))) (ccs (or completion-command-string (py-set-ipython-completion-command-string (process-name python-process)))) completion completions completion-table ugly-return) (if (string= pattern "") (tab-to-tab-stop) (process-send-string python-process (format ccs pattern)) (accept-process-output python-process 0.1) (setq completions (split-string (substring ugly-return 0 (position 10 ugly-return)) sep)) (setq completion (when completions (try-completion pattern completions)))) (cond ((eq completion t) (if (eq this-command last-command) (when python-completion-original-window-configuration (set-window-configuration python-completion-original-window-configuration))) (setq python-completion-original-window-configuration nil) (message "Can't find completion for \"%s\"" pattern) (ding) nil) ((not (string= pattern completion)) (progn (delete-char (- (length pattern))) (insert completion) nil)) ((< 1 (length completions)) (unless python-completion-original-window-configuration (setq python-completion-original-window-configuration (current-window-configuration))) (with-output-to-temp-buffer "*IPython Completions*" (display-completion-list (all-completions pattern completions))) (set-buffer "*IPython Completions*") (switch-to-buffer "*IPython Completions*") (goto-char (point-min)) (when (search-forward (car (all-completions pattern completions))) (forward-word -1) (delete-other-windows) (word-at-point))) ((null completion) (message "Can't find completion for \"%s\"" pattern) (ding))))
ipython-complete(nil nil 21 23 "ex")
(cond ((string= word "") (tab-to-tab-stop)) ((string-match "[iI][pP]ython" shell) (ipython-complete nil nil beg end word)) ((string-match "[pP]ython3[^[:alpha:]]*$" shell) (python-shell-completion--do-completion-at-point proc (buffer-substring-no-properties beg end) word)) (imports (py-python-script-complete shell imports beg end word)) (t (py-shell-complete-intern word beg end shell imports proc)))
(let* ((shell (or shell (py-choose-shell))) py-split-windows-on-execute-p py-switch-buffers-on-execute-p (proc (or (get-process shell) (get-buffer-process (py-shell nil nil shell (quote noswitch) nil)))) (beg (save-excursion (skip-chars-backward "a-zA-Z0-9_.") (point))) (end (point)) (word (buffer-substring-no-properties beg end)) (imports (py-find-imports))) (cond ((string= word "") (tab-to-tab-stop)) ((string-match "[iI][pP]ython" shell) (ipython-complete nil nil beg end word)) ((string-match "[pP]ython3[^[:alpha:]]*$" shell) (python-shell-completion--do-completion-at-point proc (buffer-substring-no-properties beg end) word)) (imports (py-python-script-complete shell imports beg end word)) (t (py-shell-complete-intern word beg end shell imports proc))))
(if (or (eq major-mode (quote comint-mode)) (eq major-mode (quote inferior-python-mode))) (let (py-fontify-shell-buffer-p (shell (or shell (py-report-executable (buffer-name (current-buffer))))) (imports (py-find-imports))) (if (string-match "[iI][pP]ython" shell) (ipython-complete) (let* ((orig (point)) (beg (save-excursion (skip-chars-backward "a-zA-Z0-9_.") (point))) (end (point)) (word (buffer-substring-no-properties beg end)) (proc (get-buffer-process (current-buffer)))) (cond ((string= word "") (tab-to-tab-stop)) ((string-match "[pP]ython3[^[:alpha:]]*$" shell) (python-shell-completion--do-completion-at-point proc imports word)) (t (py-shell-complete-intern word beg end shell imports proc)))))) (let* ((shell (or shell (py-choose-shell))) py-split-windows-on-execute-p py-switch-buffers-on-execute-p (proc (or (get-process shell) (get-buffer-process (py-shell nil nil shell (quote noswitch) nil)))) (beg (save-excursion (skip-chars-backward "a-zA-Z0-9_.") (point))) (end (point)) (word (buffer-substring-no-properties beg end)) (imports (py-find-imports))) (cond ((string= word "") (tab-to-tab-stop)) ((string-match "[iI][pP]ython" shell) (ipython-complete nil nil beg end word)) ((string-match "[pP]ython3[^[:alpha:]]*$" shell) (python-shell-completion--do-completion-at-point proc (buffer-substring-no-properties beg end) word)) (imports (py-python-script-complete shell imports beg end word)) (t (py-shell-complete-intern word beg end shell imports proc)))))
py-shell-complete()
completion--capf-wrapper(py-shell-complete all)
run-hook-wrapped(completion--capf-wrapper py-shell-complete all)
completion-at-point()
complete-symbol(nil)
call-interactively(complete-symbol nil nil)
Hi Richard,
thanks for the report.
Inserting a (require 'thingatpt) should do it.
Will check in a resp. fix
Andreas