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:05:29 -0800 Message-ID: <30c6373b0812281805odc4b2d7n549c6304ceb62553@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> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_124283_24830918.1230516329247" X-Trace: ger.gmane.org 1230516346 18287 80.91.229.12 (29 Dec 2008 02:05:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 29 Dec 2008 02:05:46 +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:06:54 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 1LH7Wv-0004Ze-4g for ged-emacs-devel@m.gmane.org; Mon, 29 Dec 2008 03:06:53 +0100 Original-Received: from localhost ([127.0.0.1]:57138 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LH7Vh-0006Kl-SN for ged-emacs-devel@m.gmane.org; Sun, 28 Dec 2008 21:05:37 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LH7Vc-0006KM-Ez for emacs-devel@gnu.org; Sun, 28 Dec 2008 21:05:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LH7Vb-0006K8-OC for emacs-devel@gnu.org; Sun, 28 Dec 2008 21:05:31 -0500 Original-Received: from [199.232.76.173] (port=58209 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LH7Vb-0006K5-If for emacs-devel@gnu.org; Sun, 28 Dec 2008 21:05:31 -0500 Original-Received: from rn-out-0910.google.com ([64.233.170.186]:28850) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LH7VZ-0007KD-Ot; Sun, 28 Dec 2008 21:05:29 -0500 Original-Received: by rn-out-0910.google.com with SMTP id k32so3277766rnd.7 for ; Sun, 28 Dec 2008 18:05:29 -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=GAFuKRe1rhYvLqNhTRke8HuI4I8ss6fbYmq7kwZhFdA=; b=QpqX6Qhfe6n1yAF8lTfdZG2apjWmaU5bSjLzOLk78HbZsI5FTsNFX7l+WYQxoFQqzo 4ulBfnJjJosNU7R5XiU/ngp6XMAW5yfuf/v8T3y1Ar3qNC8cPRFoNMO7I9ze9TWkhS66 oDJkkVMo53O4VIu+tsQPaKOfUL+wBCUiXCBOA= 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=qUh8khVNN1aywqmmlVUfKPeZtR5ONWa2yZggyAAVlt0g2ia+JFZXTHVJAm5/qrPbSN +CvROjwzySQLr2/ulcA9jr+hAZrK2Dy52bej0DMUKvBgOLCcUeOsX/9UVrufz1wXKSIk ek84Dq0wR5ctJytNHCjCOQNZauU9sVS7fbSks= Original-Received: by 10.90.104.20 with SMTP id b20mr6322483agc.109.1230516329246; Sun, 28 Dec 2008 18:05:29 -0800 (PST) Original-Received: by 10.90.98.6 with HTTP; Sun, 28 Dec 2008 18:05:29 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: 45a1d1e60fda3b77 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:107360 Archived-At: ------=_Part_124283_24830918.1230516329247 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 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 < > lennart.borgman@gmail.com> > > 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 ------=_Part_124283_24830918.1230516329247 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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
------=_Part_124283_24830918.1230516329247--