[gnu.emacs] x-popup-menu

avr@CS.PURDUE.EDU (Andrew V. Royappa) (10/08/89)

(Running gnu emacs v. 18.53.22)

(defun x-popup-bib-menu (arg)
  "pop up a bib menu"
  (let ((menu '("Bibliography Menu"
		("Bibliographies"  
		 ("bib 1" . "menu 1 return")
		 ("bib 2" . "menu 2 return")
		 ("bib 3" . "menu 3 return")
		 ("bib 4" . "menu 4 return")))))
    (message  (or (x-popup-menu arg menu) ""))))

(define-key mouse-map x-button-s-right 'x-popup-bib-menu)


To prototype a simple menu, I did the above, after looking at "x-help"
and "x-buffer-menu" in x-mouse.el. However, the menu never pops up
at the right place (except the first time after loading the file 
containing this function!). It pops up at either the same row OR the
same column as the mouse, but not both.

What am I doing wrong ?

I tried substituting "x-mouse-map" for "arg" with a little better luck.
I get the best luck, though, with changing the last line of x-popup-bib-menu
to these two lines:

(message (format "(%d,%d)" (car x-mouse-pos) (car (cdr x-mouse-pos))))
(message (or (x-popup-menu x-mouse-map menu) ""))))

Then, MOST of the time, the menu pops up in the right place!

What I'd like to know then is, how come "x-menu" and "x-buffer-menu"
pop up the menus in the right place always ?

		Thanks,

			Andrew