This file contains 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
(require 'python) | |
(require 'popup) | |
(defun py-doc-popup () | |
"Get help() for object at point, and display it in a popup." | |
(interactive) | |
(when (buffer-live-p (get-buffer "*py-doc-popup*")) | |
(kill-buffer "*py-doc-popup*")) | |
(let ((symbol (with-syntax-table python-dotty-syntax-table (current-word))) | |
(docstr nil)) | |
(if (equal symbol "") (error "No symbol")) | |
(with-current-buffer (get-buffer-create "*py-doc-popup*") | |
(comint-redirect-send-command-to-process | |
(format "emacs.ehelp(%S, %s)" | |
symbol python-imports) "*py-doc-popup*" (python-proc) nil t) | |
(setq docstr (buffer-substring-no-properties (point-min) (point-max)))) ;取れない | |
(popup-tip docstr))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment