From xemacs-m  Mon Mar 24 13:35:53 1997
Received: from CNRI.Reston.VA.US (CNRI.Reston.VA.US [132.151.1.1])
	by xemacs.org (8.8.5/8.8.5) with SMTP id NAA16564
	for <xemacs-beta@xemacs.org>; Mon, 24 Mar 1997 13:35:53 -0600 (CST)
Received: from newcnri.cnri.reston.va.us by CNRI.Reston.VA.US id aa17088;
          24 Mar 97 14:37 EST
Received: from anthem.CNRI.Reston.Va.US by newcnri.CNRI.Reston.Va.US (SMI-8.6/SMI-SVR4)
	id OAA20818; Mon, 24 Mar 1997 14:37:16 -0500
Received: by anthem.CNRI.Reston.Va.US (SMI-8.6/SMI-SVR4)
	id OAA00579; Mon, 24 Mar 1997 14:37:16 -0500
Date: Mon, 24 Mar 1997 14:37:16 -0500
Message-Id: <199703241937.OAA00579@anthem.CNRI.Reston.Va.US>
From: "Barry A. Warsaw" <bwarsaw@CNRI.Reston.VA.US>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: "Michael Sperber [Mr. Preprocessor]" <sperber@informatik.uni-tuebingen.de>
Cc: xemacs-beta@xemacs.org, Wernke zur Borg <wzb@anitesystems.de>
Subject: Re: [Wernke zur Borg <wzb@anitesystems.de>] Re: popup-mode-menu()
References: <m2u3m1h4m2.fsf@altair.xemacs.org>
	<y9lafnt8ojd.fsf@modas.informatik.uni-tuebingen.de>
X-Mailer: VM 6.20 under 19.15 XEmacs Lucid (beta101)
Reply-To: bwarsaw@python.org
X-Attribution: BAW
X-Oblique-Strategy: Mute and continue
X-Url: http://www.python.org/~bwarsaw


    MS> That's because cc-mode doesn't *call* popup-mode-menu, but
    MS> does

    MS> (define-key c-mode-map 'button3 'c-popup-menu)))

    MS> Call it a bug in cc-mode, but it sure isn't one in
    MS> popup-mode-menu.  Barry?

You're not quoting the whole thing.

  (if (and
       ;; Infodock has it's own menu
       (not (memq 'infodock c-emacs-features))
       ;; Emacs 19 defines menus in the mode map. This call will
       ;; return t on Emacs 19, otherwise no-op and return nil.
       (not (c-mode-fsf-menu "CC Mode" c-mode-map))
       ;; In XEmacs 19, we want the menu to popup when the 3rd button
       ;; is hit.  In Lucid Emacs 19.10 and beyond this is done
       ;; automatically if we put the menu on mode-popup-menu
       ;; variable, see c-common-init. Emacs 19 uses C-Mouse-3 for
       ;; this, and it works with no special effort.
       (boundp 'current-menubar)
       (not (boundp 'mode-popup-menu)))
      (define-key c-mode-map 'button3 'c-popup-menu)))

and in c-common-init:

  (if (boundp 'mode-popup-menu)
      (setq mode-popup-menu (c-mode-menu)))

and indeed, in a CC Mode buffer, mode-popup-menu is set to the menu.
Unless things have changed, this is the blessed way to do all this.
However, button 3 gives me just the mode specific menu, not a
combination of this and the global menu.

-Barry

