emacs-devel
[Top][All Lists]
Advanced

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

Patch: Python mode and eldoc "freeze"


From: Slawomir Nowaczyk
Subject: Patch: Python mode and eldoc "freeze"
Date: Fri, 03 Nov 2006 22:11:02 +0100

Hello,

I have sent patch below in response to bug report on emacs-pretest-bug,
but I am resending it here... It changes two things, first it adds eldoc
messages for some (built-in) types like open() or property() which were
missing previously (the bug report was about them).

Second, the patch prevents eldoc from freezing emacs when it tries to
get arglist for some more exotic built-ins ("basestring" being one
example).

While the first part could be seen, arguably, as a new feature, the
other is definitely a bugfix.

Can someone please install it?

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

--- EmacsCVS/etc/emacs.py   2006-10-26 23:25:56.225217600 +0200
+++ Emacs/etc/emacs.py       2006-11-01 00:13:29.307024000 +0100
@@ -50,12 +50,11 @@
        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]
+            print '_emacs_out', doc.split ('\n')[0]
            return
        if inspect.ismethod (func):
            func = func.im_func

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

Here is changelog entry:

2006-11-01  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 )

Power corrupts... absolute power is even more fun.





reply via email to

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