Fix usage of built-in Python help() helper.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Thu, 18 Feb 2016 00:48:04 +0200
changeset 1345 6fe0ba3b4dc4
parent 1344 131e20ea7dad
child 1346 b9df4ce57aed
Fix usage of built-in Python help() helper.
.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 ""))