Skip to content

Instantly share code, notes, and snippets.

Created Sep 29, 2010
What would you like to do?
(defun py-doc-exec ()
(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*")
(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.
(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