From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Slawomir Nowaczyk Newsgroups: gmane.emacs.devel Subject: Patch: Python mode and eldoc "freeze" Date: Fri, 03 Nov 2006 22:11:02 +0100 Message-ID: <20061103215330.C1BA.SLAWOMIR.NOWACZYK.847@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1162588297 8361 80.91.229.2 (3 Nov 2006 21:11:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 3 Nov 2006 21:11:37 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 03 22:11:35 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Gg6Jz-0002qK-AG for ged-emacs-devel@m.gmane.org; Fri, 03 Nov 2006 22:11:27 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gg6Jy-0006nH-8C for ged-emacs-devel@m.gmane.org; Fri, 03 Nov 2006 16:11:26 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Gg6Jm-0006mR-1W for emacs-devel@gnu.org; Fri, 03 Nov 2006 16:11:14 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Gg6Jl-0006m2-0V for emacs-devel@gnu.org; Fri, 03 Nov 2006 16:11:13 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gg6Jk-0006lm-NQ for emacs-devel@gnu.org; Fri, 03 Nov 2006 16:11:12 -0500 Original-Received: from [130.235.16.11] (helo=himmelsborg.cs.lth.se) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Gg6Ji-0007Cd-Pe for emacs-devel@gnu.org; Fri, 03 Nov 2006 16:11:11 -0500 Original-Received: from [127.0.0.1] (slawek@dain [130.235.16.76]) by himmelsborg.cs.lth.se (8.13.6/8.13.6/perf-jw-tr) with ESMTP id kA3LB1hB025740 for ; Fri, 3 Nov 2006 22:11:05 +0100 (CET) Original-To: emacs-devel@gnu.org X-Esmandil_Citation: done X-Mailer-Plugin: Popup Memopad for Becky!2 Ver.0.02 Rev.2 X-Mailer: Becky! ver. 2.25.02 [en] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:61719 Archived-At: 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 * emacs.py: (eargs) Provide eldoc message for builtin types. Make sure eargs always outputs sentinel, to avoid emacs freeze. ********************************************************************** -- Best wishes, Slawomir Nowaczyk ( slawomir.nowaczyk.847@student.lu.se ) Power corrupts... absolute power is even more fun.