Created
September 29, 2010 10:31
-
-
Save myuhe/602537 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun py-doc-exec () | |
(interactive) | |
(save-current-buffer | |
(let ((symbol | |
(with-syntax-table python-dotty-syntax-table (current-word))) | |
(tmpbuf (get-buffer-create "*py-doc-popup*")) | |
(enable-recursive-minibuffers t)) | |
(if (equal symbol "") (error "No symbol")) | |
(set-buffer "*py-doc-popup*") | |
(comint-redirect-send-command-to-process | |
(format "emacs.ehelp(%S, %s)" | |
symbol python-imports) "*py-doc-popup*" (python-proc) nil t)))) | |
(defun py-doc-popup () | |
"Get help() for object at point, and display it in a popup." | |
;; Note that we do this in the inferior process, not a separate one, to | |
;; ensure the environment is appropriate. | |
(interactive) | |
(py-doc-exec) | |
(let ((curbuf (current-buffer))) | |
(set-buffer "*py-doc-popup*") | |
(let ((bs (buffer-string))) | |
(set-buffer curbuf) | |
(popup-tip bs)) | |
(kill-buffer "*py-doc-popup*"))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment