Make pydoc-info-python-symbol-at-point customisable

Issue #2 new
Takafumi Arakaki
created an issue

The problem of pydoc-info-python-symbol-at-point is that if the symbol at point is not "full name" you need to type it by hand. For example, if you do path = os.path and the symbol at point is path.join, the default value for the look up will be path.join, instead of os.path.join.

I am trying to solve this problem by using Python IDE library called Jedi [1] and my elisp binding Jedi.el [2]. Currently I am using defadvice to override the behavior of pydoc-info-python-symbol-at-point.

(defadvice pydoc-info-python-symbol-at-point
  (around jedi:pydoc-info-python-symbol-at-point activate)
  "Use true \"full name\" to search for the symbol at point."
  (or (setq ad-return-value (jedi:get-full-name-sync))

But I think it would be nice to have a configuration variable to modify the behavior. Also, I think it will be friendly for python-mode.el users. What do you think?

Comments (2)

  1. Jon Waltman repo owner

    Yes, your right. This should be configurable.

    I would have just punted to python.el in the first place had it defined a function to do so. (The current version seems to have added one since this time, python-info-current-symbol.)

    So unless you suggest a better alternative, I'll just add a new variable pydoc-info-current-symbol-function or something, that if set, will be called to get the current symbol. I'll get around to this pretty soon hopefully.

    I played around a little with Jedi.el, seems nice. Good luck with that.


  2. Log in to comment