Skip to content

Instantly share code, notes, and snippets.

@mori-dev

mori-dev/hoge.el Secret

Created September 29, 2010 12:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mori-dev/3f188a60f2db7f4d949e to your computer and use it in GitHub Desktop.
Save mori-dev/3f188a60f2db7f4d949e to your computer and use it in GitHub Desktop.
(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