From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: john@ankarstrom.se (John =?utf-8?Q?Ankarstr=C3=B6m?=) Newsgroups: gmane.emacs.help Subject: Re: F10 =?utf-8?Q?=E2=86=92?= menu Date: Sun, 28 May 2017 16:33:45 +0200 Message-ID: <87poetrqye.fsf@ankarstrom.se> References: <83poexkmdm.fsf@gnu.org> <288974EA-D49A-4AA6-B9B4-3362972B22F2@gmail.com> <4AA9230C-7682-4ADB-9C0D-B77F9687107A@gmail.com> <87fufpt8pi.fsf@ankarstrom.se> <874139F0-9A0A-4726-813D-C0EAD9BBEBF7@gmail.com> 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 1495982062 31211 195.159.176.226 (28 May 2017 14:34:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 28 May 2017 14:34:22 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Jean-Christophe Helary Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun May 28 16:34:14 2017 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 1dEzGk-0007sC-PP for geh-help-gnu-emacs@m.gmane.org; Sun, 28 May 2017 16:34:11 +0200 Original-Received: from localhost ([::1]:44139 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEzGq-0005Mb-Bh for geh-help-gnu-emacs@m.gmane.org; Sun, 28 May 2017 10:34:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33670) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEzGN-0005ME-U2 for help-gnu-emacs@gnu.org; Sun, 28 May 2017 10:33:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dEzGJ-0003OC-1F for help-gnu-emacs@gnu.org; Sun, 28 May 2017 10:33:47 -0400 Original-Received: from pusjkin.ankarstrom.se ([172.104.152.215]:44474) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dEzGI-0003Nt-PK for help-gnu-emacs@gnu.org; Sun, 28 May 2017 10:33:42 -0400 Original-Received: from DESKTOP-2MQA95O (c83-253-24-36.bredband.comhem.se [83.253.24.36]) by pusjkin.ankarstrom.se (Postfix) with ESMTPSA id AA5CC3EC86; Sun, 28 May 2017 16:33:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ankarstrom.se; s=default; t=1495982020; bh=T6arlipW7chQYESHtv7b5Qa5K/kdQmQHlEyXJBXOMnU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Twwsafz4tec1I5VXl1uB1yYbDOAoQqBlqOk4TxyCgh7NFZ2fsqXkPHkcnOTSNnIHD WKTOEhZmGJET6B5xrQG5MQXLsH0nNmV9DJf5J0z7vT3tKrMBSRyJgAht9EhMuQc+hP 8BUQUZzCy1NAr+kQeP+i4L8ABqJaRuWXAEvPsreI= In-Reply-To: <874139F0-9A0A-4726-813D-C0EAD9BBEBF7@gmail.com> (Jean-Christophe Helary's message of "Sun, 28 May 2017 22:55:13 +0900") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 172.104.152.215 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:113215 Archived-At: Jean-Christophe Helary writes: >> On May 28, 2017, at 22:24, John Ankarstr=C3=B6m wro= te: > >> I looked at the documentation for `x-popup-menu': >>=20 >>> Pop up a deck-of-cards menu and return user=E2=80=99s selection. >>=20 >> , as defined above, would only return the user's >> selection without executing it. For example, when selecting >> Help > Emacs Tutorial, the following is returned: >>=20 >>> (help-menu emacs-tutorial) >>=20 >> I'm not sure on how you'd go about executing that, but I'm >> sure there's a way. > > Ok, I feel better :) I just need to investigate that, it's not > a problem with my system... I took a look at the source for `x-menu-bar-open', which is the function called by `menu-bar-open' (): --8<---------------cut here---------------start------------->8--- (defun x-menu-bar-open (&optional frame) "Open the menu bar if it is shown. `popup-menu' is used if it is off." (interactive "i") (cond ((and (not (zerop (or (frame-parameter nil 'menu-bar-lines) 0))) (fboundp 'accelerate-menu)) (accelerate-menu frame)) (t (popup-menu (mouse-menu-bar-map) last-nonmenu-event)))) --8<---------------cut here---------------end--------------->8--- It calls `popup-menu', which seems to do the pretty much the same thing as `x-popup-menu', but instead of just returning the selected item, it executes it: > Popup the given menu and call the selected option. Thus, to achieve the functionality you want (which seems to be opening the menu in the top-left corner of the window?), the following function would do it: --8<---------------cut here---------------start------------->8--- (defun menu-bar-open-top-left () (interactive) (popup-menu (mouse-menu-bar-map) (list '(0 0) (selected-frame)))) (global-set-key (kbd "") #'menu-bar-open-top-left) --8<---------------cut here---------------end--------------->8--- Hope that works for you. - John