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: Re: Patch: Python mode and eldoc "freeze" Date: Sat, 04 Nov 2006 11:55:05 +0100 Message-ID: <20061104113803.C1C4.SLAWOMIR.NOWACZYK.847@student.lu.se> References: <20061103215330.C1BA.SLAWOMIR.NOWACZYK.847@student.lu.se> <87bqnn28be.fsf@stupidchicken.com> 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 1162637764 21669 80.91.229.2 (4 Nov 2006 10:56:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 4 Nov 2006 10:56:04 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 04 11:56:02 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 1GgJBj-0004A8-AL for ged-emacs-devel@m.gmane.org; Sat, 04 Nov 2006 11:55:47 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GgJBi-000600-SR for ged-emacs-devel@m.gmane.org; Sat, 04 Nov 2006 05:55:46 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GgJBB-0005dy-R3 for emacs-devel@gnu.org; Sat, 04 Nov 2006 05:55:13 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GgJB9-0005bi-UP for emacs-devel@gnu.org; Sat, 04 Nov 2006 05:55:13 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GgJB9-0005bT-LT for emacs-devel@gnu.org; Sat, 04 Nov 2006 05:55:11 -0500 Original-Received: from [130.235.16.11] (helo=himmelsborg.cs.lth.se) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GgJB9-0000mB-DZ for emacs-devel@gnu.org; Sat, 04 Nov 2006 05:55: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 kA4At8M1001218 for ; Sat, 4 Nov 2006 11:55:08 +0100 (CET) Original-To: emacs-devel@gnu.org In-Reply-To: <87bqnn28be.fsf@stupidchicken.com> 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:61757 Archived-At: On Fri, 03 Nov 2006 22:35:01 -0500 Chong Yidong wrote: #> Slawomir Nowaczyk 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 * 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 ) Lord, make my words as sweet as honey, for one day I may have to eat them.