From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#50067: Context menus Date: Sun, 22 Aug 2021 11:28:02 +0300 Organization: LINKOV.NET Message-ID: <87lf4tews5.fsf@mail.linkov.net> References: <74BC00E9-2509-47DA-9428-1523FF7F3B33@acm.org> <87v942pvcj.fsf@mail.linkov.net> <004A628A-99CC-4C62-8AE2-921C4C38D42A@acm.org> <87h7fkh8z8.fsf@mail.linkov.net> <060413B6-E0EF-491D-986F-3988C255729F@misasa.okayama-u.ac.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18780"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , Tak Kunihiro , 50067@debbugs.gnu.org, Lars Ingebrigtsen , Alan Third To: Tak Kunihiro Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 22 10:41:15 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 1mHj2Y-0004bY-D5 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 22 Aug 2021 10:41:14 +0200 Original-Received: from localhost ([::1]:46296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mHj2W-0000Vq-Jf for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 22 Aug 2021 04:41:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37652) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mHj1O-0006tk-NP for bug-gnu-emacs@gnu.org; Sun, 22 Aug 2021 04:40:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54849) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mHj1O-0002rS-Ey for bug-gnu-emacs@gnu.org; Sun, 22 Aug 2021 04:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mHj1O-0000QS-BX for bug-gnu-emacs@gnu.org; Sun, 22 Aug 2021 04:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Aug 2021 08:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50067 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 50067-submit@debbugs.gnu.org id=B50067.16296215781596 (code B ref 50067); Sun, 22 Aug 2021 08:40:02 +0000 Original-Received: (at 50067) by debbugs.gnu.org; 22 Aug 2021 08:39:38 +0000 Original-Received: from localhost ([127.0.0.1]:38160 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mHj10-0000Pf-5f for submit@debbugs.gnu.org; Sun, 22 Aug 2021 04:39:38 -0400 Original-Received: from relay9-d.mail.gandi.net ([217.70.183.199]:60219) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mHj0y-0000PS-FH for 50067@debbugs.gnu.org; Sun, 22 Aug 2021 04:39:37 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 586BEFF804; Sun, 22 Aug 2021 08:39:25 +0000 (UTC) In-Reply-To: <060413B6-E0EF-491D-986F-3988C255729F@misasa.okayama-u.ac.jp> (Tak Kunihiro's message of "Sat, 21 Aug 2021 13:43:53 +0900") 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:212401 Archived-At: > I’m new to 28 and it will take a while to adopt to it. > I’m sending comments so far. Thanks for the comments. > * Binding > > I suggest to assign [drag-mouse-3] as well, as shown below. > > (define-key map [mouse-3] context-menu-entry) > (define-key map [drag-mouse-3] context-menu-entry) There is no need to bind [drag-mouse-3] because [down-mouse-3] is bound. > On Mac, I suggest to assign [C-double-mouse-1] as well as shown below. > > (define-key map [C-down-mouse-1] #'ignore) > (define-key map [C-mouse-1] context-menu-entry) > (define-key map [C-double-mouse-1] context-menu-entry) > (define-key map [C-triple-mouse-1] context-menu-entry) > (define-key map [C-drag-mouse-1] context-menu-entry) I leave this for the users of Mac to decide what would be better on Mac. > * Error detection system > > It is good if the context-menu system is ready for > an error that occurs on one of context-menu-functions. > For now, when there is error, Emacs only tells > ` is undefined'. I agree, a better error reporting would be nice. Patches welcome. > * Long click system > > It’s time to discuss long-left-click also as trigger to > show context menu. > > https://lists.gnu.org/archive/html/emacs-devel/2017-11/msg00267.html > https://lists.gnu.org/archive/html/emacs-devel/2020-09/msg01277.html I tried to implement this, but soon found that long-left-click is unusable, because such artificial delay is a hassle - no one would have patience to wait even half a second until the menu finally appears. But this could be implemented anyway when users will demand this. > * Open by other frame > > File would be opened by this window. Sometimes I want to open it by > other frame. It is good if which window to open, is selectable after > showing context-menu. I do not know how to do so. Sorry, I don't understand what menu do you mean, maybe in Dired mode? > * Details > > It is handy to have buffer menu when right click mode bar. I don't see where buffer-menu-open currently is used on the mode-line. > (define-key map [remap buffer-menu-open] context-menu-entry) This gives the error "void-variable map". > Also it is handy to have frame menu when right click title bar. I think this is a good idea. > I do not know how to do so. I do not know how to do this for the frame title bar. But currently I'm doing this for the tab bar. > Also it is nice to show word candidates by ispell when click a word. Maybe like flyspell-mode? > ** context-menu-region > > All commands belong to `Edit' in menu bar. > I think `context-menu-edit' sounds better. I already tried to use your idea to name it `context-menu-edit'. But the problem is that other functions like context-menu-undo are also related to editing. OTOH, some items in context-menu-region don't do editing such as "Select All" is not editing, "Copy" is not editing, etc. > Isn't it better to use `menu-bar-edit-menu' as a source rather than > create a menu from scratch? I already tried this idea but this menu is already available in the global menu that already can be enabled by adding context-menu-global to context-menu-functions. But maybe `context-menu-edit' could be added as well from `menu-bar-edit-menu'. > On paste when there is a region and delete-selection-mode is t, the > region should be replaced by the text. Please explain how the region should be replaced by the text, when mouse-yank-at-click or mouse-yank-primary is used to paste where the mouse is clicked. Should it delete the region and paste where mouse is clicked on another part of the buffer? What if the mouse is clicked in another window? > ** no multiple horizontal lines > > Sometimes I see double lines on the context menu. I think that there is > no useful case to have double lines. To allow only one horizontal line > would look cool. Right, double separators should be removed. > ** reuse existing menu > > I cannot figure out how to include pre-existing menu such for > (mouse-buffer-menu-map). To lean how to manipulate menu is not easy. > It's nice to have an example something like below (does not work). > > (defun context-menu-buffer (menu) > "Add a buffer menu entry to MENU." > (let ((map (mouse-buffer-menu-map))) > (define-key-after menu [buffer] map)) > menu) Adding the existing menu is not easy. There are some examples in context-menu-global, context-menu-local, context-menu-minor.