emacs-devel
[Top][All Lists]
Advanced

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

Please add point-to-coord to Emacs 23


From: Lennart Borgman (gmail)
Subject: Please add point-to-coord to Emacs 23
Date: Thu, 25 Sep 2008 23:40:39 +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

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?


(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]