.emacs-my
changeset 1706 26b2fc3886f9
parent 1705 3ed88879232f
child 1707 84c30e639991
equal deleted inserted replaced
1705:3ed88879232f 1706:26b2fc3886f9
  3068 (setq python-shell-interpreter "python3")
  3068 (setq python-shell-interpreter "python3")
  3069 (setq python-shell-interpreter-args "-i")
  3069 (setq python-shell-interpreter-args "-i")
  3070 
  3070 
  3071 (setq python-indent-offset 4)
  3071 (setq python-indent-offset 4)
  3072 
  3072 
  3073 (defun my-python/describe-at-point (symbol process)
  3073 (defun my-python/describe-at-point (symbol process prefix)
  3074   "Show full docs for symbol at point."
  3074   "Show full docs for symbol at point."
  3075   (interactive (list (python-info-current-symbol)
  3075   (interactive (list (python-info-current-symbol)
  3076                      (python-shell-get-process)))
  3076                      (python-shell-get-process)
  3077   (let ( (cmd (concat "help('" symbol "')\n")) )
  3077                      current-prefix-arg))
       
  3078   (let ( (cmd
       
  3079           (cond
       
  3080            ((eq 1 prefix) (concat "type(" symbol ")\n"))
       
  3081            ((eq 2 prefix) (concat "vars(" symbol ")\n"))
       
  3082            ((eq 3 prefix) (concat "repr(" symbol ")\n"))
       
  3083            ((not prefix) (concat "help('" symbol "')\n"))
       
  3084            (t (concat "dir(" symbol ")\n")))) )
  3078     (switch-to-buffer (get-buffer-create (format "*pydoc: %s*" symbol)))
  3085     (switch-to-buffer (get-buffer-create (format "*pydoc: %s*" symbol)))
  3079     (fundamental-mode)
  3086     (fundamental-mode)
  3080     (read-only-mode -1)
  3087     (read-only-mode -1)
  3081     (buffer-disable-undo)
  3088     (buffer-disable-undo)
  3082     (erase-buffer)
  3089     (erase-buffer)