Subject: Re: bug#11672: 23.3; info menu-bar acts on wrong window

From: martin rudalics <[email-masked]>
Date: Tue, 12 Jun 2012 08:54:11 +0200

> Steps to reproduce the bug:
 >
 > -start emacs
 > -start info
 > -clone-buffer
 > -activate the 1st window (e.g by clicking in the window)
 > -open a node in the first window (e.g by hitting '3')
 > -activate the 2nd window (e.g. by clicking in the window)
 > -open a node in the 2nd window (e.g. by clicking '5')
 > -click the "Up: (dir)" link in the menu-bar of the first window
 >  without activating the window first
 >
 > As you see, the node changes in the second window, not in the first one.
 >
 > The same happens with emacs started in a text mode terminal with gpm
 > mouse support.

I'd define things like

(defun Info-header-up ()
   (interactive)
   (let* ((mouse-position (mouse-position))
	 (window
	  (ignore-errors
	    (window-at (cadr mouse-position) (cddr mouse-position)
		       (car mouse-position)))))
     (if window
	(with-selected-window window
	  (Info-up))
       (Info-up))))

together with

     (define-key keymap [header-line mouse-1] 'Info-header-up)
     (define-key keymap [header-line mouse-2] 'Info-header-up)

martin