C-h f equivalent

Thomas Heller theller at python.net
Thu Mar 6 09:58:34 EST 2003


Gerhard Häring <gerhard.haering at opus-gmbh.net> writes:

> Glyn Millington <glyn at millingtons.org> wrote:
> > [...] Now when I want to put something together in elisp, in Xemacs
> > all I have to do is C-h f and then feed in the function name and I
> > get the goods on a particular function. C-h v does the same for
> > variables. [...]
> 
> Check out the help and dir builtin functions.
> 
> #v+
> >>> import os
> >>> help(os.rename)
> Help on built-in function rename:
> 
> rename(...)
>     rename(old, new) -> None
>     Rename a file or directory.
> 
> >>> x = {}
> >>> dir(x)
> ['__class__', '__cmp__', '__contains__', ... , 'setdefault', 'update',
> 'values']
> >>>
> #v-
> 
> There may be a shortcut that does just from Emacs' Python mode.

Recent versions of python-mode.el bind the F1 key to the help function:
Pressing F1 on the word 'dir' show this in a help-buffer:

Help on built-in function dir:

dir(...)
    dir([object]) -> list of strings
    
    Return an alphabetized list of names comprising (some of) the attributes
    of the given object, and of attributes reachable from it:
    
    No argument:  the names in the current scope.
    Module object:  the module attributes.
    Type or class object:  its attributes, and recursively the attributes of
        its bases.
    Otherwise:  its attributes, its class's attributes, and recursively the
        attributes of its class's base classes.

I have python-mode.el version 4.29, you may have to get it by CVS if
there are still older versions bundled with Xemacs.

Thomas




More information about the Python-list mailing list