##// END OF EJS Templates
Fix Emacs tab-completion support....
Fernando Perez -
Show More
@@ -321,7 +321,7 b' class IPCompleter(Completer):'
321 321 comp_append = completions.append
322 322 try:
323 323 for i in xrange(sys.maxint):
324 res = self.complete(text, i)
324 res = self.complete(text, i, text)
325 325 if not res:
326 326 break
327 327 comp_append(res)
@@ -583,7 +583,7 b' class IPCompleter(Completer):'
583 583
584 584 return None
585 585
586 def complete(self, text, state,line_buffer=None):
586 def complete(self, text, state, line_buffer=None):
587 587 """Return the next possible completion for 'text'.
588 588
589 589 This is called successively with state == 0, 1, 2, ... until it
@@ -6,8 +6,8 b''
6 6 ;; URL: http://ipython.scipy.org
7 7 ;; Compatibility: Emacs21, XEmacs21
8 8 ;; FIXME: #$@! INPUT RING
9 (defconst ipython-version "$Revision: 2927 $"
10 "VC version number.")
9 (defconst ipython-version "0.11"
10 "Tied to IPython main version number.")
11 11
12 12 ;;; Commentary
13 13 ;; This library makes all the functionality python-mode has when running with
@@ -36,7 +36,7 b''
36 36 ;; always in ``pylab`` mode with hardcoded light-background colors, you can
37 37 ;; use::
38 38 ;;
39 ;; (setq py-python-command-args '("-pylab" "-colors" "LightBG"))
39 ;; (setq py-python-command-args '("-pylab" "--colors" "LightBG"))
40 40 ;;
41 41 ;;
42 42 ;; NOTE: This mode is currently somewhat alpha and although I hope that it
@@ -217,10 +217,10 b' the second for a \'normal\' command, and the third for a multiline command.")'
217 217 (setq py-shell-input-prompt-1-regexp "^In \\[[0-9]+\\]: *"
218 218 py-shell-input-prompt-2-regexp "^ [.][.][.]+: *" )
219 219 ;; select a suitable color-scheme
220 (unless (member "-colors" py-python-command-args)
220 (unless (member "--colors" py-python-command-args)
221 221 (setq py-python-command-args
222 222 (nconc py-python-command-args
223 (list "-colors"
223 (list "--colors"
224 224 (cond
225 225 ((eq frame-background-mode 'dark)
226 226 "Linux")
@@ -311,7 +311,7 b' gets converted to:'
311 311 (replace-match "" t nil)))))
312 312
313 313 (defvar ipython-completion-command-string
314 "print(';'.join(__IP.Completer.all_completions('%s'))) #PYTHON-MODE SILENT\n"
314 "print(';'.join(get_ipython().Completer.all_completions('%s'))) #PYTHON-MODE SILENT\n"
315 315 "The string send to ipython to query for all possible completions")
316 316
317 317
@@ -347,11 +347,12 b' in the current *Python* session."'
347 347 (setq ugly-return (concat ugly-return string))
348 348 (delete-region comint-last-output-start
349 349 (process-mark (get-buffer-process (current-buffer)))))))))
350 ;(message (format "#DEBUG pattern: '%s'" pattern))
350 ;(message (format "#DEBUG pattern: '%s'" pattern))
351 351 (process-send-string python-process
352 352 (format ipython-completion-command-string pattern))
353 353 (accept-process-output python-process)
354 ;(message (format "DEBUG return: %s" ugly-return))
354
355 ;(message (format "DEBUG return: %s" ugly-return))
355 356 (setq completions
356 357 (split-string (substring ugly-return 0 (position ?\n ugly-return)) sep))
357 358 (setq completion-table (loop for str in completions
General Comments 0
You need to be logged in to leave comments. Login now