From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tak Kunihiro Newsgroups: gmane.emacs.bugs Subject: bug#50067: Context menus Date: Mon, 23 Aug 2021 12:11:27 +0900 Message-ID: <00A9BE5A-D661-42AF-A65B-3B80C7428121@misasa.okayama-u.ac.jp> 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> <87lf4tews5.fsf@mail.linkov.net> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37978"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Alan Third , Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , =?UTF-8?Q?=E5=9B=BD=E5=BA=83=E5=8D=93=E4=B9=9F?= , 50067@debbugs.gnu.org, Lars Ingebrigtsen To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 23 05:12:11 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 1mI0Nf-0009ai-QK for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 23 Aug 2021 05:12:11 +0200 Original-Received: from localhost ([::1]:55252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mI0Nd-0007l4-TX for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 22 Aug 2021 23:12:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mI0NW-0007kv-AB for bug-gnu-emacs@gnu.org; Sun, 22 Aug 2021 23:12:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56862) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mI0NV-00035D-VN for bug-gnu-emacs@gnu.org; Sun, 22 Aug 2021 23:12:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mI0NV-00051a-Oc for bug-gnu-emacs@gnu.org; Sun, 22 Aug 2021 23:12:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tak Kunihiro Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Aug 2021 03:12:01 +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.162968831319298 (code B ref 50067); Mon, 23 Aug 2021 03:12:01 +0000 Original-Received: (at 50067) by debbugs.gnu.org; 23 Aug 2021 03:11:53 +0000 Original-Received: from localhost ([127.0.0.1]:40175 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mI0NL-00051B-Uz for submit@debbugs.gnu.org; Sun, 22 Aug 2021 23:11:52 -0400 Original-Received: from mx0a-00602c01.pphosted.com ([205.220.162.67]:49530) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mI0NG-000510-Mr for 50067@debbugs.gnu.org; Sun, 22 Aug 2021 23:11:50 -0400 Original-Received: from pps.filterd (m0238149.ppops.net [127.0.0.1]) by mx0a-00602c01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 17MKvumJ021966; Mon, 23 Aug 2021 12:11:34 +0900 Original-Received: from mlsec.cc.okayama-u.ac.jp (mlsec.cc.okayama-u.ac.jp [150.46.12.254]) by mx0a-00602c01.pphosted.com with ESMTP id 3akkp20mur-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 23 Aug 2021 12:11:34 +0900 Original-Received: from jlsv301.okayama-u.ac.jp (unknown [150.46.12.5]) by mlsec.cc.okayama-u.ac.jp with smtp id 6d8c_1d53_0132e028_2b18_487c_a8e1_a91c7295b669; Mon, 23 Aug 2021 12:11:27 +0900 Original-Received: from smtpclient.apple (unknown [172.24.1.212]) by jlsv301.okayama-u.ac.jp (Postfix) with ESMTPSA id 341F4760414; Mon, 23 Aug 2021 12:11:28 +0900 (JST) In-Reply-To: <87lf4tews5.fsf@mail.linkov.net> X-Mailer: Apple Mail (2.3654.120.0.1.13) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 11 X-NAI-Spam-Score: 0.1 X-NAI-Spam-Rules: 5 Rules triggered GME_TWTRE=0.1, EDT_SA_AU_PASS=0, EDT_SA_DN_PASS=0, EDT_SA_TS_PASS=0, RV6962=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6962> : inlines <7226> : streams <1899591> : uri <3309952> X-Proofpoint-GUID: Xvj9abkIVU0StjrvE0yGINzMI2AZzIUw X-Proofpoint-ORIG-GUID: Xvj9abkIVU0StjrvE0yGINzMI2AZzIUw X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10084 signatures=668682 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 spamscore=0 clxscore=1015 bulkscore=0 suspectscore=0 phishscore=0 impostorscore=0 adultscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108230018 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:212462 Archived-At: >> I suggest to assign [drag-mouse-3] as well, as shown below. >>=20 >> (define-key map [mouse-3] context-menu-entry) >> (define-key map [drag-mouse-3] context-menu-entry) >=20 > There is no need to bind [drag-mouse-3] because [down-mouse-3] is = bound. I confirmed. I took the suggestion back. >> On Mac, I suggest to assign [C-double-mouse-1] as well as shown = below. >>=20 >> (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) >=20 > I leave this for the users of Mac to decide what would be better on = Mac. I agree. User can bind it later too. >> * Error detection system >>=20 >> 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'. >=20 > I agree, a better error reporting would be nice. Patches welcome. This is something I wanted to have for a long time. I do not have idea where to start. I hope someone works on this using this = opportunity. >> * Long click system >>=20 >> It=E2=80=99s time to discuss long-left-click also as trigger to >> show context menu. >>=20 >> https://lists.gnu.org/archive/html/emacs-devel/2017-11/msg00267.html >> https://lists.gnu.org/archive/html/emacs-devel/2020-09/msg01277.html >=20 > 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. I think this is useful especially on laptop computer with Mac. As inferred on other posts laptop computer with Mac does not have mouse-3. However, it is possible that I=E2=80=99m the only one. >> * Open by other frame >>=20 >> 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. >=20 > Sorry, I don't understand what menu do you mean, maybe in Dired mode? `ffap-at-mouse=E2=80=99 will open a file under pointer on `this = window=E2=80=99. Randomly I want to open it by `other frame=E2=80=99. It=E2=80=99s good if I can choose open the file on `this window=E2=80=99 = or `other frame=E2=80=99. Is there a way to detect meta key pressed when select one of menu items? >> * Details >>=20 >> It is handy to have buffer menu when right click mode bar. >=20 > 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) >=20 > This gives the error "void-variable map". This suggestion may be unrelated to context-menu. On mode bar, both mouse-1 and mouse-3 switches buffer.=20 I think mouse-3 should show something like (mouse-buffer-menu-map). >> Also it is handy to have frame menu when right click title bar. >=20 > I think this is a good idea. >=20 >> I do not know how to do so. >=20 > I do not know how to do this for the frame title bar. > But currently I'm doing this for the tab bar. OK. >> Also it is nice to show word candidates by ispell when click a word. >=20 > Maybe like flyspell-mode? I have an idea. Possibly, send patch in the future. >> ** context-menu-region >>=20 >> All commands belong to `Edit' in menu bar. >> I think `context-menu-edit' sounds better. >=20 > 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. >=20 >> Isn't it better to use `menu-bar-edit-menu' as a source rather than >> create a menu from scratch? >=20 > 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'. OK. I only wanted to suggest reducing maintenance cost. >=20 >> On paste when there is a region and delete-selection-mode is t, the >> region should be replaced by the text. >=20 > 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? When there is a region and yank text by `C-y=E2=80=99, the text would be replaced. I think when there is a region and point in on region, region should be replaced by text. No? >> ** no multiple horizontal lines >>=20 >> 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. >=20 > Right, double separators should be removed. OK. >> ** reuse existing menu >>=20 >> 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). >>=20 >> (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) >=20 > Adding the existing menu is not easy. There are some examples in > context-menu-global, context-menu-local, context-menu-minor. OK. I did not know it is not easy. I cannot find guid line how the menu should be created. Do you know where to look?