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: Tue, 13 Jul 2021 00:19:30 +0000 Message-ID: References: <20200914061111.3trmuzhdvv7nwdcc@Ergus> <87y2acv2tw.fsf@mail.linkov.net> <83zguragqj.fsf@gnu.org> <87pmvnuyug.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="21542"; 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 Tue Jul 13 02:21:17 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 1m36Am-0005NJ-Jq for ged-emacs-devel@m.gmane-mx.org; Tue, 13 Jul 2021 02:21:16 +0200 Original-Received: from localhost ([::1]:37460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m36Ai-0005wd-Hy for ged-emacs-devel@m.gmane-mx.org; Mon, 12 Jul 2021 20:21:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46090) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m369E-00059J-D5 for emacs-devel@gnu.org; Mon, 12 Jul 2021 20:19:41 -0400 Original-Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:47074) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m369B-0001iG-WD; Mon, 12 Jul 2021 20:19:39 -0400 Original-Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16D0HSGv016366; Tue, 13 Jul 2021 00:19:33 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-2020-01-29; bh=O0TcwbNZTlA8hbSrZBZD8tBdbFbRUPgnMFdQXVAXRJo=; b=mymWBLrH3yauvVqW3m//rFNm/vt3u3D7AhyESew/XAsDnEhRuyA5BpaDrhXd5+iDVFe9 rTOiASvnCG7Ol3IBkVu/0pzC7nTJ/HTm8Tl1U3neCsS9P522RpYF0MWNfJm2B89JoQZK 4EB5AZ4JyP0zexcimqOh8e/etgEmhtI3BVSdFDk3OlW6K4exsscy7ahK7wb54lI72HxR IrgKydEunXDaL8ERbQh670Oo2CXaAji4gDs8pvdITxCTRC5Jt6my5nOTo9QsXwl8l+9n jzJ/rMplmXCrnxEI0h2NCrCZHE/FGh136ZnZNZlgyh25BmK8gTQhzYJwPKcqOt295UUQ hg== Original-Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 39rqm0s50q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Jul 2021 00:19:33 +0000 Original-Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16D0GeHo152653; Tue, 13 Jul 2021 00:19:32 GMT Original-Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2049.outbound.protection.outlook.com [104.47.66.49]) by aserp3020.oracle.com with ESMTP id 39q3c95sk7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Jul 2021 00:19:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GXIqKFhBIYWExFg5x/pMKpWadnwOYWsZDyTJjSvdR4cvi1TsnP+ZOuQBCo4bLMEB5SOeITmdyYdZwIOs27H0KxQ4YdYZWaXKZiFvZgtZoC70n8nulFM78maPYxpsdnRXw1sW0iIZumfxFjgcDnlZ46Lq75tdP3uGQ56ui7sxJOA71raUCYt4JuJQXATsmLIUcqrrhCP6IezxJ74dhRr2ZyTPKyWO2NYNP8BGZ6GgEU++pGX3XK2QekzeiqG63Mq2Z7SyDVYnkXRgCYtO5L0B829o+jhxLVtdoYGdFhDkPNyyRlplbxHAsjl3YiLdiP5LUjff6GMn9L7h91bwA0Zl1A== 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=O0TcwbNZTlA8hbSrZBZD8tBdbFbRUPgnMFdQXVAXRJo=; b=jVHgn0bWS/JcDosAu8IRa2hXkLg46dkyKg/K526tl9PHNoa9qxNoqZPxTA012fH+1XRBonnSzezFrb62mlt7n3lwzJUpJLahrycJayk+gODutn/llP4jGhCW3CNaspxrvMWij34ISc8GhZbGt8PO7nSCXbiRVK4wZSDCiHQCCkNGi6ueaMJbQgIBsEtp7uB9+LomQIc7WsDHQMXPRRON5/gFW2quTMspVQ/zu6/pLiXzr3BsoatUZ8oIrHZVWASAWAIW+pD/8pG3qWfL7XcgYZgNv7G++OtTe2XQyhKL2bZWypYx9vtGkS2yr8Kg/Pt0957lBh2r5rj/kKgwwfz0Xg== 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=O0TcwbNZTlA8hbSrZBZD8tBdbFbRUPgnMFdQXVAXRJo=; b=P9aLtqD7lInjESIkLS08SbLZKvzn46JGB4BgMQDX7j6yAuVOptmjUZe0T0z7n67fPlca8/4u4T6ZINcdfx6oGHUuHRAnUw0e2ojWl9SJ/Ile/Exdr3l/HJH9p/Sg+eLx6n+SsLOhftESv8Kb+ZYXP/QLCKlk4b7fm+B8NhTlBbI= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by BY5PR10MB3778.namprd10.prod.outlook.com (2603:10b6:a03:1f5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.22; Tue, 13 Jul 2021 00:19:30 +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.4308.026; Tue, 13 Jul 2021 00:19:30 +0000 Thread-Topic: [External] : Re: Context menus and mouse-3 Thread-Index: AQHXd2gXvt4LM89VNUSV7/+m3TCVras//GZg In-Reply-To: <87pmvnuyug.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: 579d3da3-16c7-47fc-3aad-08d94593e1e7 x-ms-traffictypediagnostic: BY5PR10MB3778: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: yg+CQjHoIWTBSFi6+T8c2rG91LFu53pBfNE8MDImtoNCjxYCamlZqD3qiGp62vz3A/eZdLV7Ai2MZfysyFCUn9qbo35APry2FplYq87g6I0FjBFZj4sfo3wwym4SEICzxCFia+QK002Y0w+9MYJz7qljqnSxH/vcyPOOCDTfii9aIlFs81W+BXxHaeYtMuxIOgvvhyH5dRsMoPQNeFYOgSQmR5o5O6wzALfSrfwwblDIYu/lC4hSx9MrwRz1LgppCMmQFCyhG1jEb/EkH3OIoJI5D7M0DAfQVxR387GuN7U+zDHR9d9bp2qHm9HneWq6Q/RvPn4+ThNNAYZoYlL8qg56d8i2XCyuSZ/5btXMPTFy2zgsp212MCtUupm7kuFJzB17aTfud3c+FSpSLAyFgp4pv4b1Ka5lsOoJN5rxymnDjmqMOPvmLhIOMyHrCFFIUngGf7EEj/pMElz+zIzzduHouoATqsjeGcy1tO0xHTRdANKIJ+56Y1Z8fZKXPHPxQ2bzWYTt7rx7i2j6b2LZSDSYPfeCF/JBnNzsryBl45WRCU+5I4IfWt/zaFJRNz7vGBqEpTkBz9NjqjKbxcmdoTRghbDpNTeTcTEzE75gkpeS2bIX7UEJuNzU8HCDqZvJko1wcsD7D5SqYxwZA4Fasg== 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:(346002)(376002)(396003)(39860400002)(366004)(136003)(66556008)(7696005)(66476007)(52536014)(55016002)(26005)(5660300002)(66946007)(2906002)(76116006)(64756008)(66446008)(38100700002)(122000001)(110136005)(44832011)(54906003)(7416002)(71200400001)(6506007)(4326008)(83380400001)(9686003)(316002)(8936002)(86362001)(478600001)(186003)(8676002)(33656002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?qQYYL5mzuglc7zUXWGBGn9xDHSr+OOzidmWtRkbozHhssOWXeb3Txt4XJlY3?= =?us-ascii?Q?No8oh7wTqwjubBEYbEmNJFwDnEHN4a1Aeq5Q6UCO9e4DhC62/mG4cPLWnbQc?= =?us-ascii?Q?Ex9ecKbBjh9Py2xdsYg6X+k5NFHoNQjCqZ1RWzXjPMeo3BmQC6Varcq94WwN?= =?us-ascii?Q?6GFAVAVk5sDojmyliS7HOhc6X1pSqeOr+rVfwMp93rLntssZtH5KPsASIg+K?= =?us-ascii?Q?Pqc5uAQ45UBiJQ3IHx4+CnmEmWJdEfEW50EFHjATjGJITHkUmlwnC1DP2vH0?= =?us-ascii?Q?YBD+3zCrubDJGS1/T/3Dy99furMYhqChboeVNEEs7joRZzWSv1CJI9pjAc6m?= =?us-ascii?Q?f8nNBeiqi861Nl7tp49SXym6DdUSw5X5Cjz2P2W8s275pBrHQ3rjPxiMXF1b?= =?us-ascii?Q?l0ngeUf5qYD1KFTsfNnzehuGK9ZDrK0SzMHa40bguRH/fUXDmdnoNYl+LKwF?= =?us-ascii?Q?p9po3++DQVK1jbyVvsFnwUvF8/BW+vLBNo59dcIyHK1sqrT2HLKWqRoQlVwv?= =?us-ascii?Q?bK+HDjyslyB8F1OA9wUhRIcdqvdQtpNTpvsgpuMuzG1OJuEKqmN6unVg9rmI?= =?us-ascii?Q?on8apAGA5l1lEfikcP/aif9tuETLzbIo4ovu3OulgChdgtQrzze2eM0Q06eN?= =?us-ascii?Q?Du 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: 579d3da3-16c7-47fc-3aad-08d94593e1e7 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jul 2021 00:19:30.0708 (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: SqxaD458L8sXHZAgy1CMThLcKkK0WB+DKUiQpX8vuQjJ5UtTuzJukultuWVjU3vefuoj4zpgGWDtfjqET8gGBQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB3778 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10043 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 mlxscore=0 suspectscore=0 phishscore=0 adultscore=0 mlxlogscore=779 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107130000 X-Proofpoint-GUID: oTPDkwiQ6egvMPPFKoQhO-tqGaGwZhZe X-Proofpoint-ORIG-GUID: oTPDkwiQ6egvMPPFKoQhO-tqGaGwZhZe 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, RCVD_IN_MSPIKE_BL=0.001, RCVD_IN_MSPIKE_L3=0.001, 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:271191 Archived-At: > Nowadays every other app... Nowadays every other app is still not Emacs. Emacs is not just an app like every other app. > uses down-mouse-3 to pop up a context menu, > but in Emacs mouse-3 operates on the region. By default, yes, Emacs does. And that's good. Emacs selection-extension or deletion with a right-click is a good feature. > So the solution is... No. So there are many "solutions" possible. But solutions to what? The "problem" that Emacs isn't like "every other app"? No. Solutions (ways) to provide users with a right-click context menu. And the best of those solutions give users: 1. A way to get either the longstanding Emacs default behavior or a context menu - au choix, when they right-click. That means decide at the moment you click. 2. A way to choose only context menus, foregoing Emacs selection-extension/deletion behavior. Library `mouse3.el' offers those user choices. Wrt #1: By default you don't get a context menu with a single right-click - you get the Emacs selection-extension/deletion behavior. A second click gives you the menu. So you can get either, with the menu access costing you just a second click at the same place. Wrt #2: A user option lets you get the menu with a single right-click. In that case, you lose the usual selection-extension/deletion behavior (but Emacs gives you other ways to extend/delete a selection). ___ There's no use of a delay (which is the bane of Emacs CUA fiddling) - except this: whatever delay you've already defined for your mouse as defining a double-click. * If within that delay then Emacs (as always) gives you a double-click behavior, which by default is the same as the longstanding Emacs behavior: kill/delete the (extended) selection, according to `mouse-drag-copy-region'. * If more than the double-click delay then you get the menu. (If you opt for a right-click to always give you the menu immediately, then there's no second click behavior and no double-click behavior.) > similar to mouse-1-click-follows-link: to pop up a context menu > after a delay, otherwise the immediate click operates on the region. See above. I think the mouse3.el approach is saner and better fits both Emacs itself and users used to, and still preferring, only a context menu. > Every mode can define own [context-menu] in their mode-maps, > then users will be able to customize mode's [context-menu] > using mode hooks. Even text-properties could define > the [context-menu] in their local bindings that will be used > by '(current-local-map)' or better '(current-active-maps)'. With mouse3.el there's no need for any of that - no hooks, and no need for a special [context-menu] pseudo-function key binding. It's simple to define context menus for modes (or for anything). > To be able to override the [context-menu], local bindings could use > text-property maps with another binding named [overriding-context-menu] > that will replace the whole composite [context-menu], so e.g. > flyspell-mode could put it on misspelled words, etc. And no need for any of that - overriding with text-property maps, additional pseudo-function bindings, etc. Instead, just bind variable `mouse3-save-then-kill-command' to the behavior you want - in any context or from any bit of code. It can do anything you like, including provide another menu (minor mode behavior or whatever).