From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
To: Emacs Devel <emacs-devel@gnu.org>
Subject: Support routines for popup menus
Date: Mon, 03 Dec 2007 01:50:36 +0100 [thread overview]
Message-ID: <475352DC.1090807@gmail.com> (raw)
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)))
next reply other threads:[~2007-12-03 0:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-03 0:50 Lennart Borgman (gmail) [this message]
2007-12-03 18:43 ` Support routines for popup menus 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=475352DC.1090807@gmail.com \
--to=lennart.borgman@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.