[Patches] [ python-Patches-545439 ] interactive help in python-mode

noreply@sourceforge.net noreply@sourceforge.net
Mon, 22 Apr 2002 11:15:33 -0700


Patches item #545439, was opened at 2002-04-17 19:31
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=545439&group_id=5470

Category: Demos and tools
Group: None
Status: Closed
Resolution: Accepted
Priority: 5
Submitted By: Skip Montanaro (montanaro)
Assigned to: Barry Warsaw (bwarsaw)
Summary: interactive help in python-mode

Initial Comment:
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.


----------------------------------------------------------------------

>Comment By: Skip Montanaro (montanaro)
Date: 2002-04-22 13:15

Message:
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


----------------------------------------------------------------------

Comment By: Barry Warsaw (bwarsaw)
Date: 2002-04-22 12:12

Message:
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.


----------------------------------------------------------------------

Comment By: Barry Warsaw (bwarsaw)
Date: 2002-04-22 11:46

Message:
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.

----------------------------------------------------------------------

Comment By: Thomas Heller (theller)
Date: 2002-04-18 02:05

Message:
Logged In: YES 
user_id=11105

FYI, a *somewhat* similar thing can be found at bug 541031.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=545439&group_id=5470