From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "N. Jackson" Newsgroups: gmane.emacs.help Subject: Re: Pop up context menu (at point) with key rather than mouse Date: Sat, 10 Nov 2018 12:50:30 -0500 Message-ID: <87zhugkejd.fsf@moondust.localdomain> 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 1541874782 10088 195.159.176.226 (10 Nov 2018 18:33:02 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 10 Nov 2018 18:33:02 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: help-gnu-emacs To: Yuri Khan Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 10 19:32:58 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 1gLY41-0002Uc-Oi for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Nov 2018 19:32:57 +0100 Original-Received: from localhost ([::1]:39546 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLY67-0003q5-Iz for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Nov 2018 13:35:07 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42290) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLXPA-00016j-7C for help-gnu-emacs@gnu.org; Sat, 10 Nov 2018 12:50:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLXP2-0007Mx-NL for help-gnu-emacs@gnu.org; Sat, 10 Nov 2018 12:50:40 -0500 Original-Received: from mail-it1-x134.google.com ([2607:f8b0:4864:20::134]:40246) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gLXP2-0007GP-5R for help-gnu-emacs@gnu.org; Sat, 10 Nov 2018 12:50:36 -0500 Original-Received: by mail-it1-x134.google.com with SMTP id e11so7928024itl.5 for ; Sat, 10 Nov 2018 09:50:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=r/g0xsgHXrQWg7uXcsVLtbf+mvvTXNisxnQXZW6ZlQA=; b=kin1OWtnQDcc82/AjD1E4/tzFsDQNreY5SIsj9fU2j8C9eSrgK3GeyQas25wLIfB/m TvNowAot+FFACRU1Tku0x1UrgFUCtsWrhuTtgorKHlZv7g5QmDcCv9MTo+tPSY8RBvbc xegJ8zRuLe66WXcTJDjg6MXUSeZWTXPygNHwC4Ec3D++EeWHLPKVIWuxnRV6/yxtJK3X NY6jdkcOPGVzPGyfFJ+Q8k72Evfe5HqqqjpmnGAi+HIb0kcIPvmrNPiQ9gUvBggX84/B 3MlHvo4F/zOHDNGIKZpxnyKy55wURrRLsOzyEgM8LAVedyPxZjHu0bZFxrUyZ7LuFsvY bpVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=r/g0xsgHXrQWg7uXcsVLtbf+mvvTXNisxnQXZW6ZlQA=; b=byHZHTBRcFh5w9qFufpHfMBh0+I96N/FX7wbQsv+VaphqmuuLIyfyb1aszUrE9uAUc nxEIytFNK1tdplgm1OiuJTmbMis4f/ewpVUOLARsGAHAoviMXWYJg/Z4YhQ504+qM9cF 1ia7p3Y4sUE2El135+J6nTnrvDdk4kZto+zRQSZXVuQyp8p8Cr2j1yjUqAEhHaSiDQjj /g/pY3oRKP7kq3gOtXsFkJwT1tQlpooKU1/D4aUdsWLn8WTwtLKSrVkxA0cLW8EHWyXc DJ+7NbgSEuoM5c3MwPZFvAdtjerUVwHjbXdze6sM0bPdwKhuQK6CD/QfuMphrR1jHUBY Pe5g== X-Gm-Message-State: AGRZ1gK17Y/gNAV8SpezAzt/nddpMfJh3JaL8VcaMJEvcEn6mARROghX h42UABrirHVJEXN8FVN/xFNFr1da X-Google-Smtp-Source: AJdET5diiaJmXzD0nZgf9gTQcPxz++Btx5YI6VbdaaT+zg3I2oRoejZkCv+SK1uq2WrV3vlLlHktvg== X-Received: by 2002:a02:1ec9:: with SMTP id 70-v6mr12030152jat.108.1541872231837; Sat, 10 Nov 2018 09:50:31 -0800 (PST) Original-Received: from moondust.localdomain.nodomain.none (toroon474qw-lp130-08-70-26-73-61.dsl.bell.ca. [70.26.73.61]) by smtp.gmail.com with ESMTPSA id v14-v6sm2870475iom.25.2018.11.10.09.50.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Nov 2018 09:50:31 -0800 (PST) In-Reply-To: (Yuri Khan's message of "Sun, 11 Nov 2018 00:27:17 +0700") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::134 X-Mailman-Approved-At: Sat, 10 Nov 2018 13:34:20 -0500 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:118638 Archived-At: At 00:27 +0700 on Sunday 2018-11-11, Yuri Khan wrote: > > 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 quote= d. 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 th= at. 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. Thanks Yuri. This far I had already stumbled, although it's nice to see it set out more crisply than the fuzzy version of it in my head! > 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.) Aha! That info node (and those around it) are a wealth of useful information! Thanks.