# HG changeset patch # User Oleksandr Gavenko # Date 1455749284 -7200 # Node ID 6fe0ba3b4dc49848820d9575776b64125b389aa1 # Parent 131e20ea7dadad5f52bf5a7742b9332162c5a3aa Fix usage of built-in Python help() helper. diff -r 131e20ea7dad -r 6fe0ba3b4dc4 .emacs-my --- a/.emacs-my Tue Feb 16 21:52:27 2016 +0200 +++ b/.emacs-my Thu Feb 18 00:48:04 2016 +0200 @@ -2782,7 +2782,7 @@ (defvar my/python-eldoc-string-code "__PYDOC_get_full_help('''%s''')" "Python code used to get a string with the documentation of an object.") -(defvar my/python-eldoc-string-code2 "help('''%s''')" +(defvar my/python-eldoc-string-code2 "help(%s); pass" "Python code used to get a string with the documentation of an object.") ;; For built-in python.el @@ -2827,12 +2827,12 @@ (format "Describe symbol (default %s): " symbol) "Describe symbol: ") nil nil symbol)))) - (let ( (python-eldoc-string-code my/python-eldoc-string-code2) ) + (let ( ) (switch-to-buffer (get-buffer-create "*Python-doc*")) (read-only-mode -1) (buffer-disable-undo) (erase-buffer) - (insert (python-eldoc--get-doc-at-point symbol)) + (insert (python-shell-send-string-no-output (format my/python-eldoc-string-code2 symbol) (python-shell-get-process))) (goto-char (point-min)) (when (re-search-forward "^u?'" (line-end-position) t) (replace-match ""))