Skip to content

Commit

Permalink
Fix emacs tab-completion in ipython.el and remove the obsolete IPComp…
Browse files Browse the repository at this point in the history
…leter.all_completions() helper method
  • Loading branch information
wilsaj committed Nov 22, 2010
1 parent e5effe0 commit 33c2d78
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
18 changes: 0 additions & 18 deletions IPython/core/completer.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,24 +456,6 @@ def __init__(self, shell, namespace=None, global_namespace=None,
self.python_func_kw_matches,
]

# Code contributed by Alex Schmolck, for ipython/emacs integration
def all_completions(self, text):
"""Return all possible completions for the benefit of emacs."""

completions = []
comp_append = completions.append
try:
for i in xrange(sys.maxint):
res = self.complete(text, i, text)
if not res:
break
comp_append(res)
#XXX workaround for ``notDefined.<tab>``
except NameError:
pass
return completions
# /end Alex Schmolck code.

def _clean_glob(self,text):
return self.glob("%s*" % text)

Expand Down
2 changes: 1 addition & 1 deletion docs/emacs/ipython.el
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ gets converted to:
(replace-match "" t nil)))))

(defvar ipython-completion-command-string
"print(';'.join(get_ipython().Completer.all_completions('%s'))) #PYTHON-MODE SILENT\n"
"print(';'.join(get_ipython().Completer.complete('%s')[1])) #PYTHON-MODE SILENT\n"
"The string send to ipython to query for all possible completions")


Expand Down

0 comments on commit 33c2d78

Please sign in to comment.