From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Pop up context menu (at point) with key rather than mouse Date: Fri, 09 Nov 2018 21:29:03 +0200 Message-ID: <83ftwaaw3k.fsf@gnu.org> References: <87sh0akqi1.fsf@moondust.localdomain> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1541791669 24898 195.159.176.226 (9 Nov 2018 19:27:49 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 9 Nov 2018 19:27:49 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 09 20:27:44 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gLCRU-0006LT-NQ for geh-help-gnu-emacs@m.gmane.org; Fri, 09 Nov 2018 20:27:44 +0100 Original-Received: from localhost ([::1]:35689 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLCTa-0002GW-UN for geh-help-gnu-emacs@m.gmane.org; Fri, 09 Nov 2018 14:29:54 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45994) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLCT6-0002GF-8y for help-gnu-emacs@gnu.org; Fri, 09 Nov 2018 14:29:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLCT2-0000rc-5X for help-gnu-emacs@gnu.org; Fri, 09 Nov 2018 14:29:24 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41809) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLCT1-0000qr-QU for help-gnu-emacs@gnu.org; Fri, 09 Nov 2018 14:29:20 -0500 Original-Received: from [176.228.60.248] (port=4519 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gLCSz-00015O-K2 for help-gnu-emacs@gnu.org; Fri, 09 Nov 2018 14:29:19 -0500 In-reply-to: <87sh0akqi1.fsf@moondust.localdomain> (nljlistbox2@gmail.com) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:118630 Archived-At: > From: "N. Jackson" > Date: Fri, 09 Nov 2018 14:19:50 -0500 > > I think what I need to move forward on this, is to know what function is > run to display the menus popped up by C-mouse-3 (and by mouse-3 (when it > pops up a menu at all)), I suppose I can find these functions by running > Emacs under GDB, popping up a menu, halting Emacs in GDB, and displaying > a backtrace, although I feel there must be a much easier way. > > Does anyone have any information that might help with this? >From mouse.el: ;; By binding these to down-going events, we let the user use the up-going ;; event to make the selection, saving a click. (global-set-key [C-down-mouse-1] 'mouse-buffer-menu) (if (not (eq system-type 'ms-dos)) (global-set-key [S-down-mouse-1] 'mouse-appearance-menu)) ;; C-down-mouse-2 is bound in facemenu.el. (global-set-key [C-down-mouse-3] `(menu-item ,(purecopy "Menu Bar") ignore :filter (lambda (_) (if (zerop (or (frame-parameter nil 'menu-bar-lines) 0)) (mouse-menu-bar-map) (mouse-menu-major-mode-map)))))