From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tim Lee Newsgroups: gmane.emacs.bugs Subject: bug#45820: menu-bar-mode: show drop-down menu instead of tmm-menubar in terminal Emacs Date: Tue, 12 Jan 2021 23:30:31 +0800 Message-ID: <29733eeb-d5b4-a133-2d44-f844b7768caf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------C89917B39C455BC528EFAA12" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32340"; mail-complaints-to="usenet@ciao.gmane.io" To: 45820@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 12 18:51:52 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kzNpg-0008HL-Oa for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 Jan 2021 18:51:52 +0100 Original-Received: from localhost ([::1]:55870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kzNpf-0003x5-Nj for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 Jan 2021 12:51:51 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzNl1-00084K-H8 for bug-gnu-emacs@gnu.org; Tue, 12 Jan 2021 12:47:09 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49701) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kzNl0-0007yU-Mc for bug-gnu-emacs@gnu.org; Tue, 12 Jan 2021 12:47:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kzNl0-0008Qm-Le for bug-gnu-emacs@gnu.org; Tue, 12 Jan 2021 12:47:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Tim Lee Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Jan 2021 17:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 45820 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.161047359432361 (code B ref -1); Tue, 12 Jan 2021 17:47:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 12 Jan 2021 17:46:34 +0000 Original-Received: from localhost ([127.0.0.1]:33012 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzNkX-0008Ps-MG for submit@debbugs.gnu.org; Tue, 12 Jan 2021 12:46:34 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:52602) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzLaS-0004af-3i for submit@debbugs.gnu.org; Tue, 12 Jan 2021 10:28:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35874) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzLaR-00071g-Q3 for bug-gnu-emacs@gnu.org; Tue, 12 Jan 2021 10:27:59 -0500 Original-Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]:37050) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kzLaO-0007WK-OG for bug-gnu-emacs@gnu.org; Tue, 12 Jan 2021 10:27:59 -0500 Original-Received: by mail-pg1-x531.google.com with SMTP id z21so1666983pgj.4 for ; Tue, 12 Jan 2021 07:27:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:message-id:date:mime-version:content-language; bh=OKCGFEand6CHOISgItLKS/jXNEYZKLIvPo+zpXrAXJw=; b=uF9asiUOi7JFXrF43h8mJqUW+NhRyu0GY+Iee4/eF98MnClqhmKXuapIBoPuPP3PRM jzpFAUKSR2rFJX1AV30JyNACbPNdMdXqngjRzOa0LoRL0bUWARvbCwCKZLgisa+hyLb+ MT0cqkAHbDWxLQ95RLXcCSlGDsKG4KpFzf8ChNRGkG5ZGd53xAgHGwksNUDkD3ePjavp p9ZRLUQZoKkAAP7eNnN6T+aFATT8syV77Hf1lgv8pjTMU7vCSKQ7euwOyEzo+Kt8oH/h kE0X+4EFJ5RPJvIP8/WblkMaWnUIpeg/scpuHNAs0affdZhLvSgHk3kVULoXPz1zYktn HJuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:message-id:date:mime-version :content-language; bh=OKCGFEand6CHOISgItLKS/jXNEYZKLIvPo+zpXrAXJw=; b=RztKU0GJkj6nAcI1DdfJ39F8/yEx7nrgZq1EviqsHH4tyBe5JdWMTbOzS5Zb0qvfZF SarhSzBGSSCntAksa5xy99BVZG3IsxJYbvXzts5bNJ3QrXnFwHOPYgiEfy6b0hB+V45h 2vx85gncMBAJensGLvNTEQUhFK2tsJcyDe1hBSdlRg5jYKu2hbJCVupNy+Ho6UDP/YCR yQeLKiH8Q77VQqrbj32DdyJeKFnDWKBUU6Y2p1WOohtOtO6WmdvspBMYG8AH9jC60/XU k1K0VEafNAFa1UkWP68WKXd0hrUaLBeqo8yZ3knBxucpftFM9ofeh1lgd7/NWRHAkrry dwPg== X-Gm-Message-State: AOAM5301BubZEXUmtVN+s1m/zVWH2gWrQGN8hhdujF0gq00cxJ2/rlTE YTih7QCoq+TcTCTZ0sG6WJT6bI2ag0k= X-Google-Smtp-Source: ABdhPJxj241XkW76t4r1t75UHMSwSvZtFqaAyzXUIwxp9ZVyjuI6Yc4ACFvcC12IwIRkimJcHvY62w== X-Received: by 2002:a65:488d:: with SMTP id n13mr5103239pgs.315.1610465273405; Tue, 12 Jan 2021 07:27:53 -0800 (PST) Original-Received: from [10.0.2.15] ([61.6.233.193]) by smtp.gmail.com with ESMTPSA id b129sm4073923pgc.52.2021.01.12.07.27.48 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Jan 2021 07:27:49 -0800 (PST) Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::531; envelope-from=progscriptclone@gmail.com; helo=mail-pg1-x531.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 12 Jan 2021 12:46:33 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:197816 Archived-At: This is a multi-part message in MIME format. --------------C89917B39C455BC528EFAA12 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit The problem: In terminal Emacs, clicking on an item in the menu bar will open "tmm-menubar". Expected behavior: "menu-bar-open" should be run instead (i.e. a drop-down menu should appear instead of tmm-menubar). For example, if I left-click on the "Edit" menu item in the menu bar, I expect the "Edit" drop-down to appear. Currently however, a left-click on a menu item will open tmm-menubar in a *Completions* window. This is surprising behavior. By default, in terminal Emacs, " " is bound to "tmm-menubar-mouse". There doesn't seem to be an easy way to change this to the drop-down menu instead. There exist a question about this issue on Emacs Stack Exchange site: https://emacs.stackexchange.com/questions/50478/replace-clicking-a-menu-bar-option-from-m-to-f10-behavior The proposed "solution" there is similar to this: (define-key global-map [menu-bar mouse-1]             (lambda (event)               (interactive "e")               ;; Adapted from the implementation of "menu-bar-open" in Emacs 25.2.2.               (let* ((x (car (posn-x-y (event-start event))))                      (menu (menu-bar-menu-at-x-y x 0)))                 (popup-menu (or (lookup-key-ignore-too-long global-map (vector 'menu-bar menu))                                 (lookup-key-ignore-too-long (current-local-map) (vector 'menu-bar menu))                                 (cdar (minor-mode-key-binding (vector 'menu-bar menu)))                                 (mouse-menu-bar-map))                             (posn-at-x-y x 0 nil t)                             nil                             t)))) However, there are serious flaws with this "solution": * Clicking on a menu bar item (e.g. "Help"), followed immediately by clicking outside the menus and drop-downs (e.g. clicking in the window) will not cancel the selected action. Instead, the highlighted action will actually run. * Clicking on a particular menu bar item (e.g. "Help") and immediately clicking on it again will not close the drop-down menu. (Emacs version: 25.2.2, Terminal: GNOME Terminal 3.28.2, OS: Ubuntu 18.04) --------------C89917B39C455BC528EFAA12 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

The problem: In terminal Emacs, clicking on an item in the menu bar will open "tmm-menubar".

Expected behavior: "menu-bar-open" should be run instead (i.e. a drop-down menu should appear instead of tmm-menubar).

For example, if I left-click on the "Edit" menu item in the menu bar, I expect the "Edit" drop-down to appear. Currently however, a left-click on a menu item will open tmm-menubar in a *Completions* window. This is surprising behavior.

By default, in terminal Emacs, "<menu-bar> <mouse-1>" is bound to "tmm-menubar-mouse". There doesn't seem to be an easy way to change this to the drop-down menu instead.

There exist a question about this issue on Emacs Stack Exchange site: https://emacs.stackexchange.com/questions/50478/replace-clicking-a-menu-bar-option-from-m-to-f10-behavior The proposed "solution" there is similar to this:

(define-key global-map [menu-bar mouse-1]
            (lambda (event)
              (interactive "e")
              ;; Adapted from the implementation of "menu-bar-open" in Emacs 25.2.2.
              (let* ((x (car (posn-x-y (event-start event))))
                     (menu (menu-bar-menu-at-x-y x 0)))
                (popup-menu (or (lookup-key-ignore-too-long global-map (vector 'menu-bar menu))
                                (lookup-key-ignore-too-long (current-local-map) (vector 'menu-bar menu))
                                (cdar (minor-mode-key-binding (vector 'menu-bar menu)))
                                (mouse-menu-bar-map))
                            (posn-at-x-y x 0 nil t)
                            nil
                            t))))

However, there are serious flaws with this "solution":

  • Clicking on a menu bar item (e.g. "Help"), followed immediately by clicking outside the menus and drop-downs (e.g. clicking in the window) will not cancel the selected action. Instead, the highlighted action will actually run.
  • Clicking on a particular menu bar item (e.g. "Help") and immediately clicking on it again will not close the drop-down menu.
(Emacs version: 25.2.2, Terminal: GNOME Terminal 3.28.2, OS: Ubuntu 18.04)


--------------C89917B39C455BC528EFAA12--