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.bugs Subject: bug#47992: [External] : bug#47992: 27; 28; Phase out use of `equal` in `add-hook`, `remove-hook` Date: Sun, 4 Jul 2021 17:08:00 +0000 Message-ID: References: <87mttdh57n.fsf@gnus.org> <877di6udfy.fsf@web.de> <87wnq6opfo.fsf@gnus.org> <875yxqrekx.fsf@web.de> <87sg0uokh8.fsf@gnus.org> <87eece66tc.fsf@web.de> <87r1ge42wk.fsf@gnus.org> 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="35486"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Daniel Mendler , "47992@debbugs.gnu.org" <47992@debbugs.gnu.org>, "monnier@iro.umontreal.ca" , "jakanakaevangeli@chiru.no" To: Lars Ingebrigtsen , Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 04 19:09:51 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 1m05cs-00090l-M7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Jul 2021 19:09:50 +0200 Original-Received: from localhost ([::1]:45964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m05cr-0006Z5-NP for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Jul 2021 13:09:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56484) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m05c6-00043x-Hk for bug-gnu-emacs@gnu.org; Sun, 04 Jul 2021 13:09:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59892) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m05c6-0007hB-7s for bug-gnu-emacs@gnu.org; Sun, 04 Jul 2021 13:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m05c5-0006Xk-VN for bug-gnu-emacs@gnu.org; Sun, 04 Jul 2021 13:09:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Jul 2021 17:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47992 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 47992-submit@debbugs.gnu.org id=B47992.162541849325098 (code B ref 47992); Sun, 04 Jul 2021 17:09:01 +0000 Original-Received: (at 47992) by debbugs.gnu.org; 4 Jul 2021 17:08:13 +0000 Original-Received: from localhost ([127.0.0.1]:43205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m05bJ-0006Wk-5O for submit@debbugs.gnu.org; Sun, 04 Jul 2021 13:08:13 -0400 Original-Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:27530) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m05bF-0006WZ-B6 for 47992@debbugs.gnu.org; Sun, 04 Jul 2021 13:08:11 -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 164H3TF6010453; Sun, 4 Jul 2021 17:08:03 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=uwg3oCviNDIxzPfmYRwBoxnedvVpFtXLxqeC7HqTr3g=; b=mBCg3WcmKHYHGVJ74cBbqm7eSUD9WZ2Hd/pmGxaGpu4vbk68k+3MalwvDdxckopjz3zg q+FoSP7Ptw2zckATLqLHsJ7EM1ab8LJvoOAFu8AEIeonjKMr5i4iGFXAFWB5qYyAPsbc PI94ya+OGRLMPRep8+BqgD6RMHi3VuZ/cQGIrW/wU3r5GzHLCxdvsVXKU4fQDUpIgoV2 fukRpR+KWRkkSKts5NnzFHElIhUAWs9pTfBa9rcH0H0cq+zUc++Zv2Znveh0xmX/ARIV PM6O0Ac5sj0e8PIiySIKMXcdHpg3ZcmAZo935811lzgPTIRGh/VFWYLvVFrh7HPz94ln +w== Original-Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 39jep1hbyr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 04 Jul 2021 17:08:03 +0000 Original-Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 164H0OGP169120; Sun, 4 Jul 2021 17:08:02 GMT Original-Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2170.outbound.protection.outlook.com [104.47.59.170]) by aserp3030.oracle.com with ESMTP id 39jdxdj0v9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 04 Jul 2021 17:08:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cR2t4o2J5XVQ7flWOgPP5CLWA+YGoVWMgwBIAVePkGtpQteRFSqg0xMH1UyEwLsxoHNtYE00s3pRwzrZYLahJc/SBDVfnT0xH0UQGo+HI+Zo3b8hrZU8CbOX4x2oFdA9D9jMY5wsoiMVWQ+MLjxDq9lRLDhkqgxkHqUr+3hfa4LzZFovOAqAvGpMWD2jCU74fYAEIhazxqcmUl0YKKZfBjyQ403zBY1zxulvTOQgXcWUtTr0db7El6eKRrbUoPz2/QmjMnBSNosuOE7dxIZP2lPR0nkohtqlUZR+xnOVad/guske+PcvB1eSXvDAyEN1eXWgxb7Yt+SQgpULYSBMDA== 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=uwg3oCviNDIxzPfmYRwBoxnedvVpFtXLxqeC7HqTr3g=; b=Ts15SCyKB8BjDdkrLbuPxdcZ6K7cAi1vQ7okX8Ttsmh/ie6gERl9qFP6Dq+zoWAbXPzEH3+bSnPTR9MZ5crSc65jxFHH2rczeF6oXNBOaGSgGm3REu7ueu4VvzEcAbVxw4nuY9ybwAW60PN4NtZl+uwHMNyYnLd7qS56hGh81EulkuQAT5M+1od6Vcb1H2p0NxWOVTDDo/wsDuMbv8MihNvvSgCGSPlR4flJzIRvoN8YnbjRF4Kep6uhqyvVRbvh5CB4cVEE6LUPTRqjmpXCL3QSEeypV0TsdkRSwtOm1gLgkB4Rzclm9S4FXnWxek6W+mEGZ8ck7edJ7TjAvU0m3g== 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=uwg3oCviNDIxzPfmYRwBoxnedvVpFtXLxqeC7HqTr3g=; b=Js079/QeBqw6s0edXEqQHNGDSLYwjWhg+pFgSr2+xin1RrhuAqQ8FryA3auYuaatCmkDqBt6nEKf80jMCFvbX1+9Xvs5ENZQA8E4ZUZv7dQHIMbp90DRWoFAIhPQCd1n1mVChI3vcdsbNiGkSNBLt1GiKJD2U/5DStLsLa2OYKk= Original-Received: from SA2PR10MB4474.namprd10.prod.outlook.com (2603:10b6:806:11b::15) by SN6PR10MB2671.namprd10.prod.outlook.com (2603:10b6:805:46::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.24; Sun, 4 Jul 2021 17:08:00 +0000 Original-Received: from SA2PR10MB4474.namprd10.prod.outlook.com ([fe80::2d9c:ca1d:2bc0:c861]) by SA2PR10MB4474.namprd10.prod.outlook.com ([fe80::2d9c:ca1d:2bc0:c861%4]) with mapi id 15.20.4287.033; Sun, 4 Jul 2021 17:08:00 +0000 Thread-Topic: [External] : bug#47992: 27; 28; Phase out use of `equal` in `add-hook`, `remove-hook` Thread-Index: AQHXcNmwC8N3p0vqvUegTRbrzXJfwasy+tJw In-Reply-To: <87r1ge42wk.fsf@gnus.org> Accept-Language: en-US Content-Language: en-US authentication-results: gnus.org; dkim=none (message not signed) header.d=none;gnus.org; dmarc=none action=none header.from=oracle.com; x-originating-ip: [73.170.83.28] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e1617d76-9499-404f-ab29-08d93f0e4728 x-ms-traffictypediagnostic: SN6PR10MB2671: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Gvx/FpXQP72M4+vxj6unZkcqcILiaFK4mrYvUituU7uAsfGsCF7pGafTBZKYxbgoCHihm7g1V+5zK+JtXQ9aQm0y30rldfRCMez9W37Ems2u5BPwS601t7texp+avhhc2RvlnRv0n07bD6doX2MeFyUWuAuKfgy1LXtF3ASr0QyMH/sJBQynZHgcYGQ93D95nsMEuo4rtcV9MwqguUUXiisfRDnp7jAccBUcMn9kMyvBoVH3LEChxMo8nWVxSlWM8Y/x2nBBSEqFZBEzqjXClU/y6Occp2Kbc1+nZ50ACgXCeRwsEMyymPVwgTzlxh5JLIf6ITRt2bUjcTrMVaz4Gr8DrPehEYnIu46ldSFpgPF3e2yp3uynt0q1jgaRZygCD8yfJ+7NmEBdFzDK7t3i+yR5CpFWu4JxHbgfsOpcWeidVIOvsUguWb/CmUX2XwR8Prf50b5zA9odre2QWhwCkUeCNEJw0734s7VoaEDuAsHRg6nSmxEw/F3iGHv/UYcZCaQ77AtrrzgrDbrqQTIjFibLcqHwjcM6a6WK8PIP6i7k4MeOoYFsOu6/oQM4gIPh7AkmsXgCs3JcHtJprVoLrdytKF/J9eHU7ubbBfRwm3HaxvV9pXZX7omoLdwUnpC9jj1Anv44rOFETdDUxvbMGkplVM+ErIWr1FVOMC9uyyXvuDny5DQ5700m5OyuZMFVU63f4Fbhdwlj2bdS3wEgYQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA2PR10MB4474.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(396003)(376002)(366004)(136003)(39860400002)(2906002)(26005)(55016002)(4326008)(38100700002)(66556008)(66476007)(64756008)(9686003)(8676002)(71200400001)(186003)(8936002)(83380400001)(52536014)(7696005)(5660300002)(6506007)(478600001)(33656002)(66446008)(76116006)(86362001)(44832011)(122000001)(316002)(54906003)(110136005)(66946007)(81973001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: 7BUvwxLyL5xo3p5R6Pbp+GitMkTjMis5lQvgXLpP6K44u4nKQtYRF1XhqG2h03JS+oijND73A1pTJXmJ5YEFM97plSOiNRQ2fXQTmgOOrPbKci+jLVRWsy6Qa/g2o6see1Q/wapdg3NjbJrfV8dyLAnh3KZOG4g1qEmXhwGYjs0CSMn5ZjhSz9TxAkEzOhENJ+GGqCJbp9yyeBKyTzQc8VQ5xYQ8fv0KayMAlnW7tZ+UTde4mbPvc9Fd3wf18MfxwLNQrcrpc3qkZdkrlcDspr8urs3IsjIpJ9W2eCcqhP+G41GHUVZCekcS+icOTfR4DuM7nJQsCmf6iD+fuaS4VZj4NIyE4mOV3r8JnocBc78b15h2RdaHsyqoAG5OtMSjSv8mrq4rzQ4xc0VI6pYK/1fXxPqMn/Gnou+/QW2OQ4AFq37pOthG2CXM83fUxbxBtMftZKjj7nFBcslx1YA7Aplxh/NXwznYFDlb7B4qP9VMdxeh8uaYANCAyA3di4wVyldpoNsy4eVBeZK7+EOx61+FyGC14QozR3hc6pB92Bm4V/fqFTsK6nKe5LbbaypnaA0vCTY9yGc5U3h6+vB9BO7KNBXW1l72V5VmQMRLtOObuukarfVCPpCrx5rFgsLwvGX21uumvlG4GtFBi0wXy/sLrCsqNnrbULjZhrQLWswt7aWElcfSGr38PF6a1PRq782s6k7ZQ4CpG/ONxDxWUMsInaU37jq+VTjvFBqYjDJMuwTbNxaTvkFXRX 3CVmDP+y/PkOyx4X102XcXHlfA1fC5aaj7US42hJmfBzVYmiZL5dlhkAub/7ONhNCQ5B9u5BkX7fzU89x/I9weSi0E4XskOWn0 x-ms-exchange-transport-forked: True X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA2PR10MB4474.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e1617d76-9499-404f-ab29-08d93f0e4728 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jul 2021 17:08:00.4022 (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: 4EXTML2mdDpn2USgoEezGVGEUtP94BpifPnbwhqM6muTY8EJdlpoFcaiZ5r+3+CcK1EGRnj5DYS2fu2FHF3B9Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR10MB2671 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10035 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=695 suspectscore=0 spamscore=0 adultscore=0 malwarescore=0 mlxscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107040107 X-Proofpoint-GUID: DpLncbhSIFTn_dAYFNUp0I3E6C_fXWTH X-Proofpoint-ORIG-GUID: DpLncbhSIFTn_dAYFNUp0I3E6C_fXWTH 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:209418 Archived-At: > > But what advantage would these offer, > > compared to standard naming? >=20 > By "standard naming" you mean "define a function, > and then use it in `add-hook'?" Experience shows > that people avoid doing so (for various reason), > so creating a new form to cater to this use case > makes sense. FWIW, I disagree. There's no real need for such a "new form". I think the use case you've imagined for it is a s t r e t c h . Users will just as likely avoid making any of your new forms as they avoid named functions now. The "various reasons" amount to laziness (which is often the right approach), and that will be the same reason for not naming lambdas in the new way you envision. There's a reason lambdas are anonymous functions. Here's maybe another hint that it isn't needed: Has anyone ever requested such a feature? And if there really were such a need, you could just check for non-nil `eq'uality of a lambda's doc string, instead of adding yet another "new form" that will likely ~never be used. And even that feature - using a doc string with a lambda - is rarely used. As the doc string of `lambda' itself says: But documentation strings are usually not useful in nameless functions. Let's not add another ~useless "new form" for lambdas. They already have a doc string, which I'm guessing is as much a name as what you have in mind. If you really want to test with `eq', just use `eq' together with function `documentation'. That'll save you implementing the same kind of thing for yet another "name". Same test: (1) are both "names" present (non-nil), and (2) if if so, are they `eq'? And the same problem will persist: few will ever bother to provide such a "name", even if it might help them with `add|remove-hook'. You have a solution in search of a problem, I think. Users just learn the hard way (but the doc of `add|remove-hook' could be improved to help them learn) that they don't want to use lambdas as hook functions.