From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: Pop up context menu (at point) with key rather than mouse Date: Sun, 11 Nov 2018 00:27:17 +0700 Message-ID: References: <87sh0akqi1.fsf@moondust.localdomain> <83ftwaaw3k.fsf@gnu.org> <87bm6wluxf.fsf@moondust.localdomain> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1541870769 27436 195.159.176.226 (10 Nov 2018 17:26:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 10 Nov 2018 17:26:09 +0000 (UTC) Cc: help-gnu-emacs To: nljlistbox2@gmail.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 10 18:26:05 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 1gLX1J-0006zS-5c for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Nov 2018 18:26:05 +0100 Original-Received: from localhost ([::1]:39295 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLX3P-0005dq-1d for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Nov 2018 12:28:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36956) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLX2u-0005Ss-Sh for help-gnu-emacs@gnu.org; Sat, 10 Nov 2018 12:27:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLX2p-0002vY-FI for help-gnu-emacs@gnu.org; Sat, 10 Nov 2018 12:27:40 -0500 Original-Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]:43107) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gLX2m-0002mx-3g for help-gnu-emacs@gnu.org; Sat, 10 Nov 2018 12:27:36 -0500 Original-Received: by mail-ot1-x32e.google.com with SMTP id a11so829867otr.10 for ; Sat, 10 Nov 2018 09:27:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=SkXIkxrRlm2PVYvu31iFJMtzv0lvdMB7zcRy6pReUPw=; b=PkPQvneTYQ5auUYy3d6V2YMByou5FgwCWjxCddiLG+4eOvEs9EM4XK01efkeJTrveN A2METVU3xZOkQ8OIE9nNK939t9cIMHk7t/rmW459DXW/Bn6XAcgNKnXPGDJ2R5noafTy +grur1smiD70JJz0hRP5F+im/S3QmS7m0a0A0EWyglZXmne+ImJX6dm0eJ+FM3TCIHsq 4veDUU/WtEvnDqtNAEnLSTyKPNZdwg77Xz6AZppLITlGyqgptScTAPtlY2JI8PCAXhl8 CWKRbn9DOlGA6tWc/k3KV2BGZJXr0ZIeELaYdQxbRqKl0gWRECC79yJISy3FPi86weHA diWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=SkXIkxrRlm2PVYvu31iFJMtzv0lvdMB7zcRy6pReUPw=; b=iC+bco2LPMNgEHKy0iUNNLRN8dBA3RMsUszLXbJwnqj7vOQ0SDqgcOifO1kyeQlIZ+ 0ofV04XRnPXJNZtVBC/FHcI4MWG7NzN9VI+KucKwJ53HhjEJWFczelC+psoxDxlJP9nD RI1uvc5C4/BzycKpqvCc0UOHjQ234uBLgy3w6qsFkBWie2UPQKiLCJUCTfu8RdKoVE7I dUyep3VkOOSfVU8XIwN6kVihMzNjJCVa/dIQ1dOoLJq9LKbRHe4IC9uWVN1BIr91w1Pd QLCESMg3ts12GooTBXvouiZUPBSdesYj18HuQEv7At4PAAmZC1/1/cvMZEbvViN5QlrB lrbw== X-Gm-Message-State: AGRZ1gJenRTT27aAX9cj2KZDQp6I1QXb1/OIk4eE4frUDWKJA/vihswQ G7P/QCxwu2y2jxwSHvcHgMRkQaD150NMC5xkSc0= X-Google-Smtp-Source: AJdET5fQNTkDDsqsfov54yraoEv1Jh24GgncR6TUwsMzL+nYbfGqu53ruOan4XPaoIaxgG4PIcPpkUFta67e2m09kWw= X-Received: by 2002:a9d:6419:: with SMTP id h25mr1104353otl.34.1541870849873; Sat, 10 Nov 2018 09:27:29 -0800 (PST) In-Reply-To: <87bm6wluxf.fsf@moondust.localdomain> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::32e 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:118636 Archived-At: On Sun, Nov 11, 2018 at 12:11 AM N. Jackson wrote: > > (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))))) > > Hmm... where is `menu-item' defined? See the =E2=80=98`=E2=80=99 character? That indicates that the following is= a quoted list (except that the part prefixed with =E2=80=98,=E2=80=99 is not quoted.= Anyway, that is a list whose first element is the symbol 'menu-item, and that list is passed to =E2=80=98global-set-key=E2=80=99. So you want to go look what =E2=80=98global-set-key=E2=80=99 does with that= . You might know, or learn from the source, that =E2=80=98global-set-key=E2=80=99 is a = wrapper function around =E2=80=98define-key=E2=80=99. Then, C-h f define-key tells = you its last argument can take a number of forms, none of which seem to match a list '(menu-item =E2=80=A6), except possibly this: DEF is anything that can be a key=E2=80=99s definition: [=E2=80=A6] or an extended menu item definition. (See info node =E2=80=98(elisp)Extended Menu Items=E2=80=99.) So you dive into that info node, and sure enough, it explains that an extended menu item is a list starting with 'menu-item.