summaryrefslogtreecommitdiff
path: root/lisp/cedet/semantic/wisent/python.el
diff options
context:
space:
mode:
authorDavid Engster <dengste@eml.cc>2012-10-14 21:20:28 +0200
committerDavid Engster <dengste@eml.cc>2012-10-14 21:20:28 +0200
commitbf659b3f5819b9c3664c08fb01a7e51efff01fe4 (patch)
treed771152303dd23f2aed4844bd6f73daf2d754225 /lisp/cedet/semantic/wisent/python.el
parent740877cd2346da5fa3e2085185cd51912eebf0a0 (diff)
downloademacs-bf659b3f5819b9c3664c08fb01a7e51efff01fe4.tar.gz
Merge changes from CEDET upstream.
* semantic.el (semantic-error-if-unparsed): New function. Raise error if buffer was not parsed by Semantic (bug #12045). (navigate-menu, edit-menu, cedet-menu-map): Enable Semantic items only if buffer was parsed. Also, replace ':active' with ':enable' where necessary. * semantic/wisent/python.el (semantic-python-get-system-include-path): Use `python-shell-internal-send-string' if available to query Python for system paths. * semantic/senator.el (senator-next-tag): (senator-previous-tag): (senator-go-to-up-reference): Use `semantic-error-if-unparsed'. * semantic/complete.el (semantic-complete-jump-local): (semantic-complete-jump): (semantic-complete-jump-local-members): (semantic-complete-self-insert): Use `semantic-error-if-unparsed'. (semantic-complete-inline-project): Fix autoload cookie. * semantic/analyze/complete.el (semantic-analyze-possible-completions): Check if buffer was parsed. Only raise an error if function was called interactively, otherwise silently return nil. * cedet.el (cedet-menu-map): Fix copy&paste typo in menu creation.
Diffstat (limited to 'lisp/cedet/semantic/wisent/python.el')
-rw-r--r--lisp/cedet/semantic/wisent/python.el27
1 files changed, 9 insertions, 18 deletions
diff --git a/lisp/cedet/semantic/wisent/python.el b/lisp/cedet/semantic/wisent/python.el
index a0ea488f0fe..89c0499b7da 100644
--- a/lisp/cedet/semantic/wisent/python.el
+++ b/lisp/cedet/semantic/wisent/python.el
@@ -48,24 +48,15 @@
(defun semantic-python-get-system-include-path ()
"Evaluate some Python code that determines the system include path."
- (python-proc)
- (if python-buffer
- (with-current-buffer python-buffer
- (set (make-local-variable 'python-preoutput-result) nil)
- (python-send-string
- "import sys; print '_emacs_out ' + '\\0'.join(sys.path)")
- (accept-process-output (python-proc) 2)
- (if python-preoutput-result
- (split-string python-preoutput-result "[\0\n]" t)
- ;; Try a second, Python3k compatible shot
- (python-send-string
- "import sys; print('_emacs_out ' + '\\0'.join(sys.path))")
- (accept-process-output (python-proc) 2)
- (if python-preoutput-result
- (split-string python-preoutput-result "[\0\n]" t)
- (message "Timeout while querying Python for system include path.")
- nil)))
- (message "Python seems to be unavailable on this system.")))
+ (delq nil
+ (mapcar
+ (lambda (dir)
+ (when (file-directory-p dir)
+ dir))
+ (split-string
+ (python-shell-internal-send-string
+ "import sys;print ('\\n'.join(sys.path))")
+ "\n" t))))
(defcustom-mode-local-semantic-dependency-system-include-path
python-mode semantic-python-dependency-system-include-path