Mercurial > emacs
comparison lisp/progmodes/python.el @ 106574:427e81917607
* progmodes/python.el (python-symbol-completions): Remove text
properties from symbol string before calling python-send-receive.
| author | Chong Yidong <cyd@stupidchicken.com> |
|---|---|
| date | Mon, 14 Dec 2009 16:19:24 +0000 |
| parents | 806e9f7990d8 |
| children | 2db50e698b85 |
comparison
equal
deleted
inserted
replaced
| 106573:2125c0e45659 | 106574:427e81917607 |
|---|---|
| 71 | 71 |
| 72 (eval-when-compile | 72 (eval-when-compile |
| 73 (require 'compile) | 73 (require 'compile) |
| 74 (require 'hippie-exp)) | 74 (require 'hippie-exp)) |
| 75 | 75 |
| 76 (require 'sym-comp) | |
| 77 (autoload 'comint-mode "comint") | 76 (autoload 'comint-mode "comint") |
| 78 | 77 |
| 79 (defgroup python nil | 78 (defgroup python nil |
| 80 "Silly walks in the Python language." | 79 "Silly walks in the Python language." |
| 81 :group 'languages | 80 :group 'languages |
| 2145 ;; running. Presumably a timing issue with i/o to the process. | 2144 ;; running. Presumably a timing issue with i/o to the process. |
| 2146 (defun python-symbol-completions (symbol) | 2145 (defun python-symbol-completions (symbol) |
| 2147 "Return a list of completions of the string SYMBOL from Python process. | 2146 "Return a list of completions of the string SYMBOL from Python process. |
| 2148 The list is sorted. | 2147 The list is sorted. |
| 2149 Uses `python-imports' to load modules against which to complete." | 2148 Uses `python-imports' to load modules against which to complete." |
| 2150 (when symbol | 2149 (when (stringp symbol) |
| 2151 (let ((completions | 2150 (let ((completions |
| 2152 (condition-case () | 2151 (condition-case () |
| 2153 (car (read-from-string | 2152 (car (read-from-string |
| 2154 (python-send-receive | 2153 (python-send-receive |
| 2155 (format "emacs.complete(%S,%s)" symbol python-imports)))) | 2154 (format "emacs.complete(%S,%s)" |
| 2155 (substring-no-properties symbol) | |
| 2156 python-imports)))) | |
| 2156 (error nil)))) | 2157 (error nil)))) |
| 2157 (sort | 2158 (sort |
| 2158 ;; We can get duplicates from the above -- don't know why. | 2159 ;; We can get duplicates from the above -- don't know why. |
| 2159 (delete-dups completions) | 2160 (delete-dups completions) |
| 2160 #'string<)))) | 2161 #'string<)))) |
