From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: [External] : Re: Context menus and mouse-3 Date: Fri, 16 Jul 2021 20:05:09 +0000 Message-ID: References: <20200914061111.3trmuzhdvv7nwdcc@Ergus> <87y2acv2tw.fsf@mail.linkov.net> <83zguragqj.fsf@gnu.org> <87pmvnuyug.fsf@mail.linkov.net> <83zguq8n5o.fsf@gnu.org> <87im1dydhx.fsf@mail.linkov.net> <874kcw28zk.fsf@mail.linkov.net> <83lf686qqv.fsf@gnu.org> <87lf67fcvu.fsf@mail.linkov.net> <83lf6669dg.fsf@gnu.org> <87o8b2nkys.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37611"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "philipk@posteo.net" , "rms@gnu.org" , "spacibba@aol.com" , "emacs-devel@gnu.org" , "monnier@iro.umontreal.ca" , "arthur.miller@live.com" , "dgutov@yandex.ru" , "ghe@sdf.org" To: Juri Linkov , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jul 16 22:06:05 2021 Return-path: Envelope-to: ged-emacs-devel@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 1m4U60-0009Xe-MS for ged-emacs-devel@m.gmane-mx.org; Fri, 16 Jul 2021 22:06:04 +0200 Original-Received: from localhost ([::1]:35170 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4U5z-0004qc-OL for ged-emacs-devel@m.gmane-mx.org; Fri, 16 Jul 2021 16:06:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4U5K-000494-IA for emacs-devel@gnu.org; Fri, 16 Jul 2021 16:05:22 -0400 Original-Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:10594) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4U5H-0000QY-5c; Fri, 16 Jul 2021 16:05:22 -0400 Original-Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16GJvLnQ024012; Fri, 16 Jul 2021 20:05:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=LxjWZyodyEoHLU2h1faunE5YTeoPbuDfvitrD1qQvqo=; b=dcgTb/M8D0JHmUaZB1hVE8LuFikAL/dTdta/pKUGbtSAoVDzxg7uZsJT/jj0nsHYLLpb vM+4tSmc9kcyQ2h/UESgU2E5umT0X6E2GHDAT+T5sfJ/D6RzDcDJF6DnD3jiJ0tsbVK+ QMP0E0wPLzdYv22npX2IWQT8Mk+2xD/qyka5XYI4+H6dJRpVeaNA0qaTJMwn7b4T3+Bj 6UrhybiY5kzYnhEd3l71cdArfR3T860lWxrOkS9KlVkdcjMBNBbn6lIauCjfsn5MyOrS beiIK9Qg2+VDBoOLfpIplGYEaxRL67Ee5a244qCVqg4TStetI7F7VvG/1QUr/q1Vmi5Z Sw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2020-01-29; bh=LxjWZyodyEoHLU2h1faunE5YTeoPbuDfvitrD1qQvqo=; b=Gue1MOoo/ecX2wqT8nwlgNBC9iN4mf/6uOPls8useAJdiF975dpyYBPRTwrzTOkxQ+Qs Ci4z01SJ96a3RPAwuKslGRdUd6c8EtT7rDc/eNIaVHjf2BV5NtBLGdk/5xmS88fVDRO0 GsSb7LZG/uKHZZsR3fD3iDmnak52p0mWxHdC8+t/mwVpf5a4xSwbvbeOQE+DkD7ISi55 OeFqGIE/kzDa61tA7tIZm13rHqdJMs9U4X8aqFPNi6FljVZ+TAsTb35+HubfA53tLueo t6PRzbweQ7DC62gIvF+P1FrkcDbls6P2hjAAkYKp6uj/3yhBNnVnT2HVsACup0JIBFt9 BQ== Original-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 39tw3pt4x8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 16 Jul 2021 20:05:13 +0000 Original-Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16GJxsX4136094; Fri, 16 Jul 2021 20:05:12 GMT Original-Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2103.outbound.protection.outlook.com [104.47.55.103]) by userp3020.oracle.com with ESMTP id 39twqrnctv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 16 Jul 2021 20:05:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YAAFEvX0e+61QpZrRpoOr+nJerwcPywlrfJ7yz7f2d8tziWeHKvFParsWx6exblu9mcjlK+qCH8a5INgwf+5s1Q7BbT38qEM/gGkMfA0N81EuY/c8rY+P9u86FyawEnyTjoXnUsX1miqFgGWUGyBDrSp5wKPWLLkwRt8sYNwIZ8Tz0gMx09ctoxRfZ3WOYRJoMEIK/kU/UxJFDj+/Vkn0PqIzqnEz3CieaAw6FblxOAdvhWZQ+E7nA+MP+o10pqRvoSq47gjIgQFJ/fx2WWJOfEqc5V6xtckXQAbsqu7Lq/4ChvJfY+SKUVYdwbOjIwU6bW6JmO4JJKoLDFce51TfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LxjWZyodyEoHLU2h1faunE5YTeoPbuDfvitrD1qQvqo=; b=exB/s9VMzlQUqJ1oe7kkoRKcJdgC4zgApryC/17LtB9QnJxOlqEQx1+aAjI2ApQXMvLFqTm0oYJT+DSPjTX1NC1K0V5KUERQCik9/K0d+IpA9hpyKrLd82FoBTGbv6AkbpCGk7ijYXRhId9KuLVbhsNOn99gpKgE64eKsFRONhfT/mtoVgC75p0E1UYorCTw2NzWRq38TYINJhYxTl1MiPXOyvrfod0vKvvB0cIv6/YjdJaWQH2fJdnqTJGUm+cJapJn4nObQDhmOGp1Zz66qu9Sh5AgLJIljkdT2ZjN6teHl3Zsvc6lZ/duk3hI5ICddv/pW1dsKUdvv17cJZa/AQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LxjWZyodyEoHLU2h1faunE5YTeoPbuDfvitrD1qQvqo=; b=YiPPtwBx3eK214xakNxT2/HlyXHKDb2ombbwC7WymodI9BQoQHMI2owOghhZnmRtXyDwgbE2AEIc4ySoGwY1O6/MMoVa1qDJsO3D8ooQke8/c7/76msGeHR+OoGivqx/wAXc4VUJ42ncocEGkkzt266Eh6lBFwSWdMFGsnSZuak= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by BY5PR10MB4164.namprd10.prod.outlook.com (2603:10b6:a03:210::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.23; Fri, 16 Jul 2021 20:05:10 +0000 Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::1d3c:d31b:8add:1958]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::1d3c:d31b:8add:1958%5]) with mapi id 15.20.4331.026; Fri, 16 Jul 2021 20:05:10 +0000 Thread-Topic: [External] : Re: Context menus and mouse-3 Thread-Index: AQHXenS6BjX19E4l+0G0AW2O1vyr5atF9lvQ In-Reply-To: <87o8b2nkys.fsf@mail.linkov.net> Accept-Language: en-US Content-Language: en-US authentication-results: linkov.net; dkim=none (message not signed) header.d=none;linkov.net; dmarc=none action=none header.from=oracle.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 59f2e60c-882c-4f3c-8451-08d9489503d4 x-ms-traffictypediagnostic: BY5PR10MB4164: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: WNxTk0GULm7Z6fndE/LPge7vUUwPgiUtSJJ1EvaiGaJF23pKBsIHO8MX4ksLHhH9VgC72sHHIu00ZkflBAY7wDI4Qc6OneY5+LrfQXuJtyp0fxNuLa6qdUIZUCLB7ZCnQr3vtoo2SyzBGxRWxhY7UGilEebaFlBh47aoszF3AHQ+VhLel+/snJ+5omFqnZA22n4yBakIMGDq7sIAw/fMF8IqVpC+dSxVlbHtJ+TwamdD6R+LYt3yu25bI0uhUI8AQo4tRHqHZkcTYH8x3RRF+NFPBADW6Ie4enBuH++3xHa+i12LNSOrsB/GLgBYKC0s6J2RdmfmvHds+t8ordmJN6W9F/p1+dyJ2WnnFw/pm7plwJVHixMLgQhTvV2RMu7DYBVAArsa5sbKjaiGvx5S59ic2kt4acVvC/9j9D0Dcl1Sq5sWqcgm8fjlvG0YQA22hniFikPSXibKsvK0BUoAh2MmOnJ4Esn4sojwhPj7NjiC52++kATHmi2+QO/7k5ZVShwlqqQ8K0h+D3Xj/Fdtz3iHSzbOmNX67owvXXyy+/ufnwCxYM74goRHKdLT+brnIE3321kCkfb7ikvVsrtbPxc/CiYe000SaB1Lhj7izaRaWi3cYVbLSDBtGTp9VySTrheS6ChN+6CN45U3ntz/S1YD1SfkueMHPWGa9tJ6k/Bvv2eHKFAF/c5ob9WwDKA39w1urKwIZnvqy7KIX3IuKg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(7696005)(6506007)(508600001)(66556008)(2906002)(7416002)(66476007)(66446008)(5660300002)(44832011)(33656002)(8936002)(64756008)(186003)(8676002)(26005)(83380400001)(86362001)(110136005)(316002)(76116006)(38100700002)(4326008)(122000001)(71200400001)(52536014)(9686003)(55016002)(54906003)(66946007)(38070700004); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?NSheazXOokD/AN6TQ87693H3/K6aPvQm90pxt4akQUpBS3ly3RblF731OnnG?= =?us-ascii?Q?6VTnTZ0DoLd7Ns5tNtdz5RENlzHcEYtDLv33VWXj+VXSWwOG4PXom+Sc7Ikj?= =?us-ascii?Q?szkLuwA0hvrdXgEs5PJZP4U2Tsl6sKHO60hX2fTzF5vD1Go3HoCUh6TGZJO4?= =?us-ascii?Q?ECIYpE9xj+MTXMAJ+E90BEnF6xqqq+ZpG33SExRS1vifRpBx1bh6sp/gsLxU?= =?us-ascii?Q?3Wl+5v4pfyGP7hde/2iqEtXUbuyZrW2Yk4lRDjwxQ2oex21VWR5Tz0bRTo4V?= =?us-ascii?Q?lzRH6ZIQNoSBazxz9CCt9YAHRYRV7YmroJDedeurNjbsqhfKV8r6j7kx9vyw?= =?us-ascii?Q?YDn6xAKPPfWRLl6R3Mgq3BkhEjHFXpstVF1XXiHeQiHRPpqjFbbIItJUMHRI?= =?us-ascii?Q?josb1QbPb+zVG3HxiMARkdBYWiVrDWt54tnbEiOreiqz2aUwrtCp7P4Q7LSi?= =?us-ascii?Q?5z7j4IdstRtE1ENJ2S/008rqrQn3Mih1FoTKcAw3l94jCn7uPo+1O54ZXxps?= =?us-ascii?Q?PSLhXWnqAKuVuxKWgwy1R6U5CXPNzWADfa9DN9soNg69qwoOCJgWby/89uIM?= =?us-ascii?Q?ZUzUpCemchH/XY1810OLCEyySkGFiSSKXqxULWlGPZGlCnnwrMJA/S+mPcMc?= =?us-ascii?Q?YC x-ms-exchange-transport-forked: True X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 59f2e60c-882c-4f3c-8451-08d9489503d4 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jul 2021 20:05:10.0007 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: HWq0xMz5GdtWSSGQqYcisDHlCx23JOg43Ke+hgdJGDHtn3CqUSeTG2gBW8bTIISbgl509XO6DYAkvrtE7EqSaw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4164 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10047 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 mlxscore=0 adultscore=0 phishscore=0 mlxlogscore=999 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107160125 X-Proofpoint-GUID: O7H-BLQ35CDU22F8tEJ9Ez_JXZ6Stw2- X-Proofpoint-ORIG-GUID: O7H-BLQ35CDU22F8tEJ9Ez_JXZ6Stw2- Received-SPF: pass client-ip=205.220.177.32; envelope-from=drew.adams@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:271317 Archived-At: > >> >> And some modes like org-mode, flyspell-mode, etc. already redefine > >> >> down-mouse-3 to pop up context menus. > >> > > >> > But those modes define those context menus on special parts of > >> > display, where pasting etc. makes less sense, no? > >> > >> When the buffer is not read-only, I see no reason to disallow > >> pasting text because e.g. in flyspell-mode it makes sense > >> to paste a correction to a misspelled word, etc. > > > > IMO, when mouse-3 is clocked on a misspelled word, it makes much more > > sense to assume the user wants to fix that word than that the user > > wants to paste. > > > > But here's an idea: how about merging the two menus into one in these > > cases? We could add a top-level menu with the two alternatives, each > > one would then drop down one of the two possible menus. > > Alternatively, just make a long menu by concatenating the contents of > > the two original ones. > > > > WDYT? >=20 > Tak Kunihiro had a very good idea of using a hook-like variable > that contains a list of functions that return parts of the whole > context-menu, then these parts will be collected into the final menu. FWIW - `mouse3.el' has these variables: `mouse3-region-popup-entries' `mouse3-noregion-popup-entries' `mouse3-region-popup-x-popup-panes' `mouse3-noregion-popup-x-popup-panes' Whether the first two or the second two are used is controlled by option `mouse3-popup-x-popup-panes-flag'. The difference corresponds to the two possibilities offered by `x-popup-menu'. The default is nil, so you can use keymaps and extended menu items to define the `mouse-3' menu. The alternative is easy to use but offers fewer possibilities. The 2 `region' vars are used when the region is active. The 2 `noregion' vars are used otherwise. ___ As for the choice of whether global menus should be included in a `mouse-3' menu: Why decide that at design time, hard-coding the behavior? `mouse3.el' lets users decide, with option `mouse3-popup-include-global-menus-flag'. If non-nil then: If the menu bar is visible then the major-mode menu is the global menu to include on the `mouse-3' menu. If the menu-bar is not shown then the menu-bar menus are the menus to include on the `mouse-3' menu. ___ By default, the `mouse-3' menu has predefined submenus. Users and code can modify the contents, of course. (If the alternative panes approach is used, then the operations are available in the single-level menu.) These are the predefined submenus. All except the first are for when the region is active and nonempty. `mouse3-noregion-popup-misc-submenu' Miscellaneous operations on a thing at mouse pointer: Email, open, visit, Dired, find, describe, highlight etc. `mouse3-region-popup-change-text-submenu' Change the selected text: Fill, indent, transpose regions, upcase, etc. `mouse3-region-popup-check-convert-submenu' Check, correct, or convert the selected text. `mouse3-region-popup-copy-submenu' Copy selected text: text props, kill, to register etc. `mouse3-region-popup-highlight-submenu' Highlight, unhighlight, copy/yank text props. `mouse3-region-popup-misc-submenu' Miscellaneous operations on selected text: Count, narrow, eval, shell, write to file, etc. `mouse3-region-popup-print-submenu' Print, PostScript print, BNF PostScript operations. `mouse3-region-popup-rectangle-submenu' Selected rectangle: kill, delete, open, yank, clear, etc. `mouse3-region-popup-register-submenu' Selected text to register: copy to, delete to, etc. `mouse3-region-popup-remove/replace-items' Remove/replace selected text: kill, delete, yank. `mouse3-region-popup-remove/replace-rect-submenu' Remove/replace selected rectangle: Clear, replace from last killed, string, register. `mouse3-region-popup-search/replace-submenu' Isearch, query replace etc.