unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Please add point-to-coord and popup-menu-at-point
@ 2008-03-15 19:18 Lennart Borgman (gmail)
  0 siblings, 0 replies; only message in thread
From: Lennart Borgman (gmail) @ 2008-03-15 19:18 UTC (permalink / raw)
  To: Emacs Devel

I have sent these functions several times now and wonder why they never 
get added. I just looked a bit at flyspell.el where they are badly 
needed IMO.

Please add these functions to Emacs.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Popups etc.

(defun point-to-coord (point)
   "Return coordinates of point in selected window.
The coordinates are in the form \(\(XOFFSET YOFFSET) WINDOW)."
   (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))

(defun popup-menu-at-point (menu &optional prefix)
   "Popup the given menu at point.
This is similar to `popup-menu' and MENU and PREFIX has the same
meaning as there.  The position for the popup is however where
the window point is."
   (let ((where (point-to-coord (point))))
     (popup-menu menu where prefix)))





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-03-15 19:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-15 19:18 Please add point-to-coord and popup-menu-at-point Lennart Borgman (gmail)

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).