all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Support routines for popup menus
@ 2007-12-03  0:50 Lennart Borgman (gmail)
  2007-12-03 18:43 ` Richard Stallman
  0 siblings, 1 reply; 7+ messages in thread
From: Lennart Borgman (gmail) @ 2007-12-03  0:50 UTC (permalink / raw)
  To: Emacs Devel

I just noticed that a library in Emacs opened a popup menu in such a way 
that the line it should give information about was hided. I think I have 
forgotten to send the two routines below which simplifies poping up 
menus alined to the point. Could they (or something similar) please be 
added to Emacs?

(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] 7+ messages in thread

end of thread, other threads:[~2007-12-12 22:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-03  0:50 Support routines for popup menus Lennart Borgman (gmail)
2007-12-03 18:43 ` Richard Stallman
2007-12-03 19:21   ` Lennart Borgman (gmail)
2007-12-04 16:56     ` Richard Stallman
2007-12-04 17:16       ` Lennart Borgman (gmail)
2007-12-12  1:39       ` Lennart Borgman (gmail)
2007-12-12 22:52         ` Richard Stallman

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.