Message from discussion
rope-get-calltip?
Received: by 10.204.154.143 with SMTP id o15mr425163bkw.4.1328600786502;
Mon, 06 Feb 2012 23:46:26 -0800 (PST)
X-BeenThere: rope-dev@googlegroups.com
Received: by 10.204.200.144 with SMTP id ew16ls2465707bkb.2.gmail; Mon, 06 Feb
2012 23:46:25 -0800 (PST)
Received: by 10.204.133.213 with SMTP id g21mr1667355bkt.3.1328600785504;
Mon, 06 Feb 2012 23:46:25 -0800 (PST)
Received: by 10.204.133.213 with SMTP id g21mr1667354bkt.3.1328600785488;
Mon, 06 Feb 2012 23:46:25 -0800 (PST)
Return-Path: <gcpr-rope-...@m.gmane.org>
Received: from plane.gmane.org (plane.gmane.org. [80.91.229.3])
by gmr-mx.google.com with ESMTPS id 20si26695901bko.3.2012.02.06.23.46.25
(version=TLSv1/SSLv3 cipher=OTHER);
Mon, 06 Feb 2012 23:46:25 -0800 (PST)
Received-SPF: pass (google.com: domain of gcpr-rope-...@m.gmane.org designates 80.91.229.3 as permitted sender) client-ip=80.91.229.3;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of gcpr-rope-...@m.gmane.org designates 80.91.229.3 as permitted sender) smtp.mail=gcpr-rope-...@m.gmane.org
Received: from list by plane.gmane.org with local (Exim 4.69)
(envelope-from <gcpr-rope-...@m.gmane.org>)
id 1Rufks-0007qN-J3
for rope-dev@googlegroups.com; Tue, 07 Feb 2012 08:46:22 +0100
Received: from 119.255.41.67 ([119.255.41.67])
by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
id 1AlnuQ-0007hv-00
for <rope-dev@googlegroups.com>; Tue, 07 Feb 2012 08:46:22 +0100
Received: from sdl.web by 119.255.41.67 with local (Gmexim 0.1 (Debian))
id 1AlnuQ-0007hv-00
for <rope-dev@googlegroups.com>; Tue, 07 Feb 2012 08:46:22 +0100
X-Injected-Via-Gmane: http://gmane.org/
To: rope-dev@googlegroups.com
From: Leo <sdl....@gmail.com>
Subject: Re: rope-get-calltip?
Date: Tue, 07 Feb 2012 15:45:46 +0800
Lines: 53
Message-ID: <m11uq7gk7p.fsf@gmail.com>
References: <m1r4y94w5h.fsf@gmail.com>
<CAA0H+QRWW8wqfaig-SB889Vvs1mRPFXx4V+utqq8+-+C9stJmg@mail.gmail.com>
<20120502193202@lilem.mirepesht> <m1mx8xcgfk....@gmail.com>
<20120502220...@lilem.mirepesht>
Mime-Version: 1.0
Content-Type: text/plain
X-Complaints-To: use...@dough.gmane.org
X-Gmane-NNTP-Posting-Host: 119.255.41.67
Face: iVBORw0KGgoAAAANSUhEUgAAACkAAAApAQAAAACAGz1bAAABKElEQVQYlWNg3NIt5FDPUPt7
4+X79Qyucz5/ugik+L2PBgKpyphaIK921q23QDnG0NBQoMr/vaWl9f8ZLL78uPv5PwN7RETfzXoG
jhmFz27XM0RXmpuY/WfY+fv0Mc56BvFybfXA/wwL5t/wF61n2PU59axXPcOVzbmSW/8zrNt1benC
/ww70hqUU/4zKCtrT9jwn8FhwynbufUMendE2aLqGRpdX9al1zM8eh17lKeeQcTMrdD5P8P3j/YT
Q/8zXHSb7p1Qz/C4OM2JuZ7hgtI7K6AjqsMnf8j4z8C6xG1tw3+GqpqvsVn/GTzmpD9j/8/wP/oZ
S/l/Bka+QO/g/wy15ueeFQL9N1O8mPU/g+umV3t1gdT0/1bTgHLqYVeXAlWKpMWt+w8Az82C9nHf
X0cAAAAASUVORK5CYII=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (Mac OS X 10.6.8)
Cancel-Lock: sha1:WxYg7t6DU0/bfhIa5w6i2AvTGCw=
On 2012-02-06 02:31 +0800, Ali Gholami Rudi wrote:
>> (defun rope-get-calltip ()
>> (let ((message-log-max nil))
>> (rope-show-calltip ropemacs-separate-doc-buffer)
>> (let ((msg (current-message)))
>> (message nil)
>> (unless (equal msg "No docs available!")
>> msg))))
>
> And it works with eldoc?
Yes, by setting eldoc-documentation-function locally in python mode.
>> But this feels backwards. I think if rope-get-calltip is defined then
>> rope-show-calltip will be straightforward to define in elisp. Just like
>> rope-show-doc can be easily re-implemented in elisp using rope-get-doc.
>
> Changing ropemacs is a bit harder as you may need to change
> ropemode and possibly ropevim (but the latter is very unlikely).
> But I may be wrong. Do you have a patch?
The following patch works for me. Comments?
diff -r 9bf46eecc9b7 ropemode/interface.py
--- a/ropemode/interface.py Mon Feb 06 12:39:36 2012 +0100
+++ b/ropemode/interface.py Tue Feb 07 15:43:02 2012 +0800
@@ -182,8 +182,8 @@
self._check_project()
self._base_show_doc(prefix, codeassist.get_doc)
- @decorators.local_command('a c', 'P')
- def show_calltip(self, prefix):
+ @decorators.local_command()
+ def get_calltip(self):
self._check_project()
def _get_doc(project, text, offset, *args, **kwds):
try:
@@ -191,7 +191,11 @@
except ValueError:
return None
return codeassist.get_calltip(project, text, offset, *args, **kwds)
- self._base_show_doc(prefix, _get_doc)
+ return self._base_get_doc(_get_doc)
+
+ @decorators.local_command('a c', 'P')
+ def show_calltip(self, prefix):
+ self._base_show_doc(prefix, lambda *args, **kwds: self.get_calltip())
def _base_show_doc(self, prefix, get_doc):
docs = self._base_get_doc(get_doc)
Leo