bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#19637: 25.0.50; ipython eldoc keep visible while typing parameters


From: Carlos Pita
Subject: bug#19637: 25.0.50; ipython eldoc keep visible while typing parameters
Date: Thu, 5 Feb 2015 16:21:03 -0300

Here is a tentative patch.

What it does is the following:

1) If point is in a paren context it escapes to the opening parenthesis

2) Now, if point is left (or was there from the very beginning) over
an opening (, then the relevant symbol is the one to the left of the
(, so whitespaces, newlines and backslashes are skipped backwards.
Presumably the point is now over a symbol.

3) We call (python-info-current-symbol). If a symbol is indeed parsed,
it's returned, if not, then the point position is restored and
(python-info-current-symbol) is called as usual.

Notice that the above allows for nested calls. But the exact behavior
is as follows (say * marks the position of the point):

a) m*ap(xx           will return map
b) map(xx*           will return map
c) map(open*       will also return map
d) map(open(xx*  will return open

I think this is almost always what you want. But a more complex
sequence could be implemented for c that first checks if there is any
documentation for 'open' and only in case there was no documentation
for the symbol, it showed the documentation for 'map'. I don't think
it's worth the extra complexity.

Cheers
--
Carlos

Attachment: tooltip.patch
Description: Text Data


reply via email to

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