From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Kevin Burton" Newsgroups: gmane.emacs.devel Subject: Re: Possible to show tooltip at (point) ???? Date: Sun, 28 Dec 2008 18:33:02 -0800 Message-ID: <30c6373b0812281833v325439e8vd382b3b2cf44ac4a@mail.gmail.com> References: <30c6373b0812272248y7c51447ax15bcea34d8cce132@mail.gmail.com> <8763l47jpy.fsf@cyd.mit.edu> <30c6373b0812280124r6301ec1ka7e12d2e719126a1@mail.gmail.com> <49574CB0.5050600@gnu.org> <30c6373b0812280920y722b7822s7c844f0c73636545@mail.gmail.com> <30c6373b0812281805odc4b2d7n549c6304ceb62553@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_124390_2350925.1230517982246" X-Trace: ger.gmane.org 1230518018 21336 80.91.229.12 (29 Dec 2008 02:33:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 29 Dec 2008 02:33:38 +0000 (UTC) Cc: Chong Yidong , emacs-devel@gnu.org, Jason Rumney To: "Lennart Borgman" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 29 03:34:45 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LH7xd-00011x-Vu for ged-emacs-devel@m.gmane.org; Mon, 29 Dec 2008 03:34:30 +0100 Original-Received: from localhost ([127.0.0.1]:37475 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LH7wQ-0001U1-8B for ged-emacs-devel@m.gmane.org; Sun, 28 Dec 2008 21:33:14 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LH7wJ-0001Tw-Uu for emacs-devel@gnu.org; Sun, 28 Dec 2008 21:33:07 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LH7wI-0001Tk-Cx for emacs-devel@gnu.org; Sun, 28 Dec 2008 21:33:06 -0500 Original-Received: from [199.232.76.173] (port=33380 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LH7wI-0001Th-7e for emacs-devel@gnu.org; Sun, 28 Dec 2008 21:33:06 -0500 Original-Received: from yx-out-1718.google.com ([74.125.44.157]:56141) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LH7wF-0000Fm-3q; Sun, 28 Dec 2008 21:33:03 -0500 Original-Received: by yx-out-1718.google.com with SMTP id 34so1526896yxf.66 for ; Sun, 28 Dec 2008 18:33:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type:references :x-google-sender-auth; bh=1KafOdTBrJ/8bcgqWwgyJSbok+KOsJKdZNoCW1+zNds=; b=Yd5wM7WMUm5buwc85WXAo8fJT4AsEEvR67OdlLX9MKEIXSWdID9gqRd+VPpvgzcHt6 BLD56R6lL9NEAz5KjMBnuIy9onw4lcDoTav+cXiBjERP+dC/kX6UvTpIXjr8c66DNzuS dNmGik4GdtblRZ6L4L3YTngwU4p3Okzzzxz2E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:references:x-google-sender-auth; b=cF0stBJlfYmhfUOPCd8zS6+iFajLZmcILuNd3WLgNQLvQvctws++4BYRhNhOOMN6ht beyjtjjENTkpygEzDluhtLZLbeQ7pZtxRdMKbYmmsytXSsnHThlY6VuB6Sxa5/tu0WjO d1ViBruk7YKHzieMnCvcqWUNCeeeMEIz9Q72I= Original-Received: by 10.90.71.16 with SMTP id t16mr6350544aga.26.1230517982254; Sun, 28 Dec 2008 18:33:02 -0800 (PST) Original-Received: by 10.90.98.6 with HTTP; Sun, 28 Dec 2008 18:33:02 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: 826a9116e2fcfb52 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:107363 Archived-At: ------=_Part_124390_2350925.1230517982246 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline What platform are you on? What's your emacs-version? Mine is: GNU Emacs 22.3.2 (i386-apple-darwin9.5.0, Carbon Version 1.6.0) of 2008-09-21 on plume.sr.unh.edu - Aquamacs Distribution 1.5 On Sun, Dec 28, 2008 at 6:14 PM, Lennart Borgman wrote: > For me it works also if the window is split. The only problem I have > seen is with the margins. Maybe this is platform dependent? > > I use this in nXhtml where it used for popup menus for completion in > XHTML. If you want to it is easy to test there. > > > On Mon, Dec 29, 2008 at 3:05 AM, Kevin Burton wrote: > > Yes..... this DOES work but for a window that's not split.... as soon as > you > > split the window the coord is for the first window (not the second). > > I guess I could look at the current window configuration and double the > > current Y if the window is split in half.... > > Kind of hacky but could work for a proof of concept. > > Kevin > > > > On Sun, Dec 28, 2008 at 9:31 AM, Lennart Borgman < > lennart.borgman@gmail.com> > > wrote: > >> > >> On Sun, Dec 28, 2008 at 6:20 PM, Kevin Burton > wrote: > >> > In the predictive package? > >> > I think one just needs to compute the left-margin width. > >> > >> Here is what I have. There is indeed a problem with the left margin. > >> What change do you propose? > >> > >> (defun point-to-coord (point) > >> "Return coordinates of POINT in selected window. > >> The coordinates are in the form \(\(XOFFSET YOFFSET) WINDOW). > >> This form is suitable for `popup-menu'." > >> ;; Fix-me: showtip.el adds (window-inside-pixel-edges > >> ;; (selected-window)). Why? > >> (let* ((pn (posn-at-point point)) > >> (x-y (posn-x-y pn)) > >> (x (car x-y)) > >> (y (cdr x-y)) > >> (pos (list (list x (+ y 20)) (selected-window)))) > >> pos)) > >> > >> > I wrote a tooltip-at-point package a few years ago (but never got it t > >> > work > >> > reliably) and added this into the mix.... > >> > Kevin > >> > > >> > On Sun, Dec 28, 2008 at 9:14 AM, Lennart Borgman > >> > > >> > wrote: > >> >> > >> >> On Sun, Dec 28, 2008 at 10:53 AM, Jason Rumney > wrote: > >> >> > Kevin Burton wrote: > >> >> >> > >> >> >> You mean by specifying top and left? I think that is what I was > >> >> >> going > >> >> >> to > >> >> >> do to position the tooltip but first I need to find out the x/y of > >> >> >> the > >> >> >> current point. > >> >> > > >> >> > (posn-at-point &optional POS WINDOW) > >> >> > >> >> I think there is a bug with left margin. (Though I have not had time > >> >> to submit a bug report for this.) > > > > > > > > -- > > Founder/CEO Spinn3r.com > > Location: San Francisco, CA > > AIM/YIM: sfburtonator > > Skype: burtonator > > Work: http://spinn3r.com > > > -- Founder/CEO Spinn3r.com Location: San Francisco, CA AIM/YIM: sfburtonator Skype: burtonator Work: http://spinn3r.com ------=_Part_124390_2350925.1230517982246 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline What platform are you on?  What's your emacs-version?

Mine is:

GNU Emacs 22.3.2 (i386-apple-darwin9.5.0, Carbon Version 1.6.0) of 2008-09-21 on plume.sr.unh.edu - Aquamacs Distribution 1.5


On Sun, Dec 28, 2008 at 6:14 PM, Lennart Borgman <lennart.borgman@gmail.com> wrote:
For me it works also if the window is split. The only problem I have
seen is with the margins. Maybe this is platform dependent?

I use this in nXhtml where it used for popup menus for completion in
XHTML. If you want to it is easy to test there.


On Mon, Dec 29, 2008 at 3:05 AM, Kevin Burton <burton@spinn3r.com> wrote:
> Yes..... this DOES work but for a window that's not split.... as soon as you
> split the window the coord is for the first window (not the second).
> I guess I could look at the current window configuration and double the
> current Y if the window is split in half....
> Kind of hacky but could work for a proof of concept.
> Kevin
>
> On Sun, Dec 28, 2008 at 9:31 AM, Lennart Borgman <lennart.borgman@gmail.com>
> wrote:
>>
>> On Sun, Dec 28, 2008 at 6:20 PM, Kevin Burton <burton@spinn3r.com> wrote:
>> > In the predictive package?
>> > I think one just needs to compute the left-margin width.
>>
>> Here is what I have. There is indeed a problem with the left margin.
>> What change do you propose?
>>
>> (defun point-to-coord (point)
>>  "Return coordinates of POINT in selected window.
>> The coordinates are in the form \(\(XOFFSET YOFFSET) WINDOW).
>> This form is suitable for `popup-menu'."
>>  ;; Fix-me: showtip.el adds (window-inside-pixel-edges
>>  ;; (selected-window)). Why?
>>  (let* ((pn (posn-at-point point))
>>         (x-y (posn-x-y pn))
>>         (x (car x-y))
>>         (y (cdr x-y))
>>         (pos (list (list x (+ y 20)) (selected-window))))
>>    pos))
>>
>> > I wrote a tooltip-at-point package a few years ago (but never got it t
>> > work
>> > reliably) and added this into the mix....
>> > Kevin
>> >
>> > On Sun, Dec 28, 2008 at 9:14 AM, Lennart Borgman
>> > <lennart.borgman@gmail.com>
>> > wrote:
>> >>
>> >> On Sun, Dec 28, 2008 at 10:53 AM, Jason Rumney <jasonr@gnu.org> wrote:
>> >> > Kevin Burton wrote:
>> >> >>
>> >> >> You mean by specifying top and left?  I think that is what I was
>> >> >> going
>> >> >> to
>> >> >> do to position the tooltip but first I need to find out the x/y of
>> >> >> the
>> >> >> current point.
>> >> >
>> >> > (posn-at-point &optional POS WINDOW)
>> >>
>> >> I think there is a bug with left margin. (Though I have not had time
>> >> to submit a bug report for this.)
>
>
>
> --
> Founder/CEO Spinn3r.com
> Location: San Francisco, CA
> AIM/YIM: sfburtonator
> Skype: burtonator
> Work: http://spinn3r.com
>



--
Founder/CEO Spinn3r.com
Location: San Francisco, CA
AIM/YIM: sfburtonator
Skype: burtonator
Work: http://spinn3r.com
------=_Part_124390_2350925.1230517982246--