emacs-devel
[Top][All Lists]
Advanced

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

Re: Please add point-to-coord to Emacs 23


From: Lennart Borgman (gmail)
Subject: Re: Please add point-to-coord to Emacs 23
Date: Fri, 26 Sep 2008 01:02:13 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

Lennart Borgman (gmail) wrote:
> I have several times asked if not a function like the one below could be
> added to Emacs. Here is my request again.
> 
> Even if it is not added could someone perhaps explain how to change it
> so that it works when left margin is non-zero?

It looks like a bug in posn-at-point to me, but I am not sure.

> (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'."
>   (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))
> 
> 
> 




reply via email to

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