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 prefix) |
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 using Python's help() built-in. |
|
3075 |
|
3076 With argument 1 uses Python's type() built-in. |
|
3077 With argument 2 uses Python's repr() built-in. |
|
3078 With argument 1 uses Python's dir() built-in. |
|
3079 With argument 1 uses Python's vars() built-in." |
3075 (interactive (list (python-info-current-symbol) |
3080 (interactive (list (python-info-current-symbol) |
3076 (python-shell-get-process) |
3081 (python-shell-get-process) |
3077 current-prefix-arg)) |
3082 current-prefix-arg)) |
3078 (let ( (cmd |
3083 (let ( (cmd |
3079 (cond |
3084 (cond |
3080 ((eq 1 prefix) (concat "type(" symbol ")\n")) |
3085 ((eq 1 prefix) (concat "type(" symbol ")\n")) |
3081 ((eq 2 prefix) (concat "vars(" symbol ")\n")) |
3086 ((eq 2 prefix) (concat "repr(" symbol ")\n")) |
3082 ((eq 3 prefix) (concat "repr(" symbol ")\n")) |
3087 ((eq 3 prefix) (concat "print('\\n'.join(dir(" symbol ")))\n")) |
|
3088 ((eq 4 prefix) (concat "vars(" symbol ")\n")) |
3083 ((not prefix) (concat "help('" symbol "')\n")) |
3089 ((not prefix) (concat "help('" symbol "')\n")) |
3084 (t (concat "dir(" symbol ")\n")))) ) |
3090 (t (concat "dir(" symbol ")\n")))) ) |
3085 (switch-to-buffer (get-buffer-create (format "*pydoc: %s*" symbol))) |
3091 (switch-to-buffer (get-buffer-create (format "*pydoc: %s*" symbol))) |
3086 (fundamental-mode) |
3092 (fundamental-mode) |
3087 (read-only-mode -1) |
3093 (read-only-mode -1) |