emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch: Python mode and eldoc "freeze"


From: Slawomir Nowaczyk
Subject: Re: Patch: Python mode and eldoc "freeze"
Date: Sat, 04 Nov 2006 11:55:05 +0100

On Fri, 03 Nov 2006 22:35:01 -0500
Chong Yidong <address@hidden> wrote:

#> Slawomir Nowaczyk <address@hidden> writes:
#> 
#> >             doc = func.__doc__
#> >             if doc.find (' ->') != -1:
#> >                 print '_emacs_out', doc.split (' ->')[0]
#> > -           elif doc.find ('\n') != -1:
#> > -               print '_emacs_out', doc.split ('\n')[0]
#> > +            print '_emacs_out', doc.split ('\n')[0]
#> >             return
#> 
#> Won't this print _emacs_out twice?

Oops, sorry, it obviously will... thanks for noticing it. It's not a big
deal since code in python.el deals with it OK, but the patch below is
clearly better.

**********************************************************************

--- EmacsCVS/etc/emacs.py   2006-10-26 23:25:56.225217600 +0200
+++ Emacs/etc/emacs.py       2006-11-04 11:40:26.337289600 +0100
@@ -50,12 +50,12 @@
        if len (parts) > 1:
            exec 'import ' + parts[0] # might fail
        func = eval (name)
-       if inspect.isbuiltin (func):
+       if inspect.isbuiltin (func) or type(func) is type:
            doc = func.__doc__
            if doc.find (' ->') != -1:
                print '_emacs_out', doc.split (' ->')[0]
-           elif doc.find ('\n') != -1:
-               print '_emacs_out', doc.split ('\n')[0]
+            else:
+                print '_emacs_out', doc.split ('\n')[0]
            return
        if inspect.ismethod (func):
            func = func.im_func

**********************************************************************

Here is changelog entry:

2006-11-04  Slawomir Nowaczyk  <address@hidden>

        * emacs.py: (eargs) Provide eldoc message for builtin types.
          Make sure eargs always outputs sentinel, to avoid emacs freeze.

**********************************************************************

-- 
 Best wishes,
   Slawomir Nowaczyk
     ( address@hidden )

Lord, make my words as sweet as honey, for one day I may have to eat them.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]