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

* Re: Support routines for popup menus
  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)
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Stallman @ 2007-12-03 18:43 UTC (permalink / raw
  To: Lennart Borgman (gmail); +Cc: 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.

What's the goal?  Just to move the menu vertically down a line or two?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Support routines for popup menus
  2007-12-03 18:43 ` Richard Stallman
@ 2007-12-03 19:21   ` Lennart Borgman (gmail)
  2007-12-04 16:56     ` Richard Stallman
  0 siblings, 1 reply; 7+ messages in thread
From: Lennart Borgman (gmail) @ 2007-12-03 19:21 UTC (permalink / raw
  To: rms; +Cc: emacs-devel

Richard Stallman wrote:
>     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.
> 
> What's the goal?  Just to move the menu vertically down a line or two?

To show the menu where point is, not where the mouse cursor is. It 
displays the menu under the point with point visible, if possible. (If 
the menu has to be displayed upwards it, then it unfortunately covers 
point. This is a minor bug, of course. I think it is not easy to correct.)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Support routines for popup menus
  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)
  0 siblings, 2 replies; 7+ messages in thread
From: Richard Stallman @ 2007-12-04 16:56 UTC (permalink / raw
  To: Lennart Borgman (gmail); +Cc: emacs-devel

    To show the menu where point is, not where the mouse cursor is. It 
    displays the menu under the point with point visible, if possible. (If 

I expect people will find that very strange and inconvenient.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Support routines for popup menus
  2007-12-04 16:56     ` Richard Stallman
@ 2007-12-04 17:16       ` Lennart Borgman (gmail)
  2007-12-12  1:39       ` Lennart Borgman (gmail)
  1 sibling, 0 replies; 7+ messages in thread
From: Lennart Borgman (gmail) @ 2007-12-04 17:16 UTC (permalink / raw
  To: rms; +Cc: emacs-devel

Richard Stallman wrote:
>     To show the menu where point is, not where the mouse cursor is. It 
>     displays the menu under the point with point visible, if possible. (If 
> 
> I expect people will find that very strange and inconvenient.

I guess you are misunderstanding. The purpose is not to show the popup 
menu at the point when clicking with the mouse.

I thinks computer users today are used to menus that popup at the point 
for operations that has something to do with the text at point - even 
when they work with the keyboard. I have for example used this for 
completion in nXhtml:

   http://ourcomments.org/Emacs/nXhtml/doc/nxhtml.html#completion

I think there are other Emacs libraries that does similar things.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Support routines for popup menus
  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
  1 sibling, 1 reply; 7+ messages in thread
From: Lennart Borgman (gmail) @ 2007-12-12  1:39 UTC (permalink / raw
  To: rms; +Cc: emacs-devel

Richard Stallman wrote:
>     To show the menu where point is, not where the mouse cursor is. It 
>     displays the menu under the point with point visible, if possible. (If 
> 
> I expect people will find that very strange and inconvenient.

Could you please reread what I wrote about this? I think you have 
misunderstod the intention.

Popping up menus the way I suggest here while working from the keyboard 
is quite common. Most often it is tied to the [apps] key.

BTW I have proposed a framework for using the [apps] key (so that 
different modes etc can cooperate on the use of it) but have not have 
time to clean that file up and send it to the list.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Support routines for popup menus
  2007-12-12  1:39       ` Lennart Borgman (gmail)
@ 2007-12-12 22:52         ` Richard Stallman
  0 siblings, 0 replies; 7+ messages in thread
From: Richard Stallman @ 2007-12-12 22:52 UTC (permalink / raw
  To: Lennart Borgman (gmail); +Cc: emacs-devel

    Popping up menus the way I suggest here while working from the keyboard 
    is quite common. Most often it is tied to the [apps] key.

I agree, it does make sense when using a keyboard command.
I was thinking of the mouse.

^ 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.