[Top][All Lists]

[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: Gecko/20071031 Thunderbird/ Mnenhy/

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))))

reply via email to

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