Issue 545439: interactive help in python-mode (original) (raw)

Created on 2002-04-18 00:31 by skip.montanaro, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
py-help.el skip.montanaro,2002-04-18 00:31
545439.txt barry,2002-04-22 17:12
Messages (6)
msg39632 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2002-04-18 00:31
If you apply the patch from bug 545436 to python-mode.el, the attached code allows programmers to get help from pydoc about the current possibly dotted expression. This is just a quick-n-dirty hack, but seems at least marginally useful.
msg39633 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2002-04-18 07:05
Logged In: YES user_id=11105 FYI, a *somewhat* similar thing can be found at bug 541031.
msg39634 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2002-04-22 16:46
Logged In: YES user_id=12800 One problem with your patch is that symbol-near-point is a XEmacs-ism. I think we can fix that, and avoid the need to "regexp-unquote" the return value by just inlining what we need of symbol-near-point. I'll work out that patch and check it in if it works.
msg39635 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2002-04-22 17:12
Logged In: YES user_id=12800 Skip, check out the attached patch. This ought to work in Emacs too. It binds py-help-at-point to C-c C-h.
msg39636 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2002-04-22 18:15
Logged In: YES user_id=44345 The patch works for me for methods but fails for symbols. I hadn't tried it for something like "sys.platform" before, so I'm pretty sure my original patch failed for that as well. When I ask for help on sys.platform it complains about "no help for 'linux2'". That makes sense, since it's asking for pydoc.help(sys.platform) Too bad Python doesn't have Lisp's quote feature! <0.5 wink> Ooh! Ooh! Pydoc *does* understand quoting! Try pydoc.help("sys.platform") pydoc.help("sys.exc_info") Looks like the help arg should always be quoted. A couple other suggestions: * How about binding py-help-at-point to [F1]? * How about adding the following two lines to the end of py-help-at-point: (set-buffer "*Python Output*") (help-mode) That puts point in the *P O* buffer and makes it easy to dump the help buffer when you're through with it (just press 'q'). S
msg39637 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2002-04-22 22:03
Logged In: YES user_id=12800 I like the fix for sys.platform, and the binding to [f1]. I'm less sure about the (help-mode) bit because *Python Output* is overloaded for other things too. Oh well, I'll add them all and see if anybody complains. :)
History
Date User Action Args
2022-04-10 16:05:14 admin set github: 36457
2002-04-18 00:31:07 skip.montanaro create