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.help Subject: RE: [External] : Re: Making a function than can only be used interactively Date: Mon, 4 Jul 2022 20:53:09 +0000 Message-ID: References: <87pmiljgah.fsf@gnu.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="20857"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Tassilo Horn , "help-gnu-emacs@gnu.org" To: Stefan Monnier , "carlmarcos@tutanota.com" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 04 22:53:51 2022 Return-path: Envelope-to: geh-help-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 1o8T4o-0005Gv-Q5 for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 04 Jul 2022 22:53:50 +0200 Original-Received: from localhost ([::1]:55090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o8T4n-00089H-B7 for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 04 Jul 2022 16:53:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53636) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8T4M-00088s-LW for help-gnu-emacs@gnu.org; Mon, 04 Jul 2022 16:53:22 -0400 Original-Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:45656) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8T4I-0008Vi-WB; Mon, 04 Jul 2022 16:53:22 -0400 Original-Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 264HZ8SV008060; Mon, 4 Jul 2022 20:53:12 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=2c7+6zmxAA69SLIDiLMMn6EM17DPQFhSn7aqNno3m0A=; b=Qiz3/uvKH1RFL65NunfOi+WBEcbQTZ08O3efGtYzQinznCFoPdlfR9U3P6NBJcrVCPO3 qeszflK1vGlP/PbnZj0jIGyG592HIQUD6gs71VDu6P60UgNVVZfpMoySiRl4C91siMGf xkXWGCSIoge9QF8aPQiUU1mSWWoSkRlWCpOWCsbbAx3fIR+P+FWY49jqOOjamvTAo+Ok FeapYud5iU6ziUL/f8HkAfm8K7etNbxjQzZq0gLAsTpIzS0KjpZDIchDhDgs8ErKzNM6 D7Kk3+TM8xlOkpcWT1ne5jxKcsMj1tD1u+IMSoBDjQTrtpERjfYSRg2ZY5nYhON+AVhM 0Q== Original-Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3h2dwam49r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 04 Jul 2022 20:53:12 +0000 Original-Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 264Korvr024107; Mon, 4 Jul 2022 20:53:10 GMT Original-Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2177.outbound.protection.outlook.com [104.47.55.177]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com with ESMTP id 3h32mhrpgh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 04 Jul 2022 20:53:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A96znLUnf0YeLCc7mdDTJLHAnvwWceHmBQF3+vbnxOj8OKQ3NRIVvqyUjhWlMPlGQCNGPVBy9J3VNFRckUlZWrgCC950mzK34Njy+ATVtul8M++nlfaJaw2Sk4baijQD87cIJUgYKNQywyLO+wKFj5WryZbaJtuZjniMhcwYu+ro0lFiS4IpOV99E712wrY9Jo0zoQJSAkLNTrV0ydN9znIQY1S3au+1mkFyrz0fOSHsFjOkND+n8DIicssangSHyHvGtCIbLxRxGuLq02vvWqfu0E8QIQgRvlnbVMMUlACm66g61Anyle2NNOqO0qiYDnTIgHGmCL4ci8Kri0+NsA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2c7+6zmxAA69SLIDiLMMn6EM17DPQFhSn7aqNno3m0A=; b=VDswF9alhLVs3+/EPy3S54mIzZBGPA3tjQlySRDLECpLflqlSqUi1PbPVOBMN+nRPkkxkD16lFUzprD5m+DtEBd3YLkkH2rwJ5jVvUdptX/lvmd1o/DU2uiI4foCcRwvahIHe/CJQhMx2Fqb1FpuivzJNJH6AzmkVvW6wGXEndc2DojdzQ2WnYwcYY+yHs0GGjGaaKJE7ej4y63ltl9tRqJrhSNesQ+LdBGksM835e7osQ03Dtrjms0TehkIFHM2ThMNNqn1m0WHTJbeJD6hqJXCLAD2fdQg1X5qILDxFLgdCZhMTuOa3xTMq6gPERBlBPaQpN1CHHoJaMApKEbVSQ== 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=2c7+6zmxAA69SLIDiLMMn6EM17DPQFhSn7aqNno3m0A=; b=zKa8jRdkr+ktQeNP6fvcSQwHZS7GAyRviU0mn+OvSP+tQFDBI6EmsXihUASLcPMNxWqjozmUjwIpLeau2AmUWj3AopXaoEcbTIcXri8KFUSaX8KDGkCwSnLp0dYgrxGgGK7ngG+djPvn2K27wDffTZFmQBasA4CMLEVx2OL0+sg= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by PH0PR10MB4807.namprd10.prod.outlook.com (2603:10b6:510:3f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15; Mon, 4 Jul 2022 20:53:09 +0000 Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::581b:ae2f:16b9:80fb]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::581b:ae2f:16b9:80fb%7]) with mapi id 15.20.5395.021; Mon, 4 Jul 2022 20:53:09 +0000 Thread-Topic: [External] : Re: Making a function than can only be used interactively Thread-Index: AQHYj937KKk1PV2KhUS71Pl1Wd6SE61usArA In-Reply-To: Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0e351644-2ed6-4cfd-711f-08da5dff33c6 x-ms-traffictypediagnostic: PH0PR10MB4807:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3LNDPnklxk43QnrSJf3uL9IRv7GhK7D2ENSwG6PQlBaVeCb6V2TQfh7j6OMeEzRuk53pQzBa7DDqdoREA/3roCo5Hy7oRUVjgqpNRVzPW4B5CWRxL0YBQdSoxmO8PgE0NkmLWqM2AKzseQzdt0ioXuYSfhxX0GXHrwoCs7bbESYbqWL5BFySAfLAt4gU/PwLzXmd+2sQUS40gEtLxG/fWOOcKFpC+uPmRgoZKDOMi0pa12ZzHoOpB5Fk8tuZuB9Y8vzjf55VjZpyD6gy3+QkYmPVEoNWBatnKVnyfxz5hX2cto48O4ri3ESptBTbIoNq/9fB8oSgLAy1blkLn2+QrvfNduwH1BW9YT8LTnpZJFNPLAA7n0UgvEbCyUi/wP3V4FY3z3VoTEiiv34LGecskHKs4TtcNz+GAsTb456BPvzAFIflPbQ3BeJQ9YG29PpObaNRqrwapQ4070ayYf4Qmp4YeHPgew5ygGjq1AWyosmJG5pwRtdwKigbANRCQGJ6FsVaH+SskZCJh47F7yozxXrFAVGOCPjA707PS63sRB+EYvbhKoVSkvHj5bKFNpsDBSyGc2LOCTDvACm7deGfQpXn8MyoaqSAm3RTMd4J6CfyfPX5UjrCz7F/ZQ0ibaMK50YGWdWhXql+UQ7xjQ34I5hrePoQklqLO+/QVFpE14hep4iSZ/X5kDV/hcgQs9QKjMXSujfY8f7Z9xTQFpifuCU5MUd4gT9gJLdOkWtzStRdmeRj3GqmBnMNzrLE5 r7NbNRI8gnvIgc2VPV1E7vtesmWBEvX0vb81zdoVQD071CofcylCEJcOt+WImXRGVdH 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:(13230016)(346002)(136003)(366004)(39860400002)(376002)(396003)(478600001)(316002)(41300700001)(122000001)(83380400001)(2906002)(33656002)(26005)(9686003)(7696005)(6506007)(44832011)(5660300002)(76116006)(66946007)(64756008)(66476007)(4326008)(66446008)(86362001)(66556008)(52536014)(8936002)(38070700005)(110136005)(186003)(38100700002)(8676002)(296002)(71200400001)(55016003)(54906003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?jBS6h62edjF5092x1RCzQYSE7Ly/5rT9UvF46OVxP6NIZ8cCcj+/vwNzjvCs?= =?us-ascii?Q?+GG+TfRU8nvMIoV2t/ww6xroeQbrHmWqhNS1d5Eqhsou35DqaVz2H423Z43j?= =?us-ascii?Q?eMZvZoyfhKT8LHivfuUX2bsjzitMYemw0Qh+Ua8xrYpAUX+5x2+EkX7DMJdK?= =?us-ascii?Q?M39Er9RrLP5RFKf31mUxwUeGMhxP2L/TZPQ6JCLfpYU8bvVRHi/whG5cKyIB?= =?us-ascii?Q?Dveg0a+MxcEf7iUq0iZg5xwZWUcbbbWinCMJdd/SglQiZ84cJEEWGQGhVX9J?= =?us-ascii?Q?neNwTj1cYD7OfxXESDNIIvZ6j+hNpR7Qr+6Vyvyh/YURqQlz7O9WWUtKq/Vh?= =?us-ascii?Q?DqXnV3+yJ9CyAc6scVbjkn35NzUrlpK8gG8nuzx+danJ/e6sna+JBtycXO9P?= =?us-ascii?Q?DHXpKPgT9IJs/5G73j8M7DeQdeO3pTySVMxQ+ixNwTHhuniIDJcmGFkiSLBa?= =?us-ascii?Q?AJTd/93m3++YxUGGCpfYQUHSOxtMSGhRQ+mD+zbyUa7Pqa2YLpGsR+dLauV1?= =?us-ascii?Q?FkSIJae8Qz4aQx+cNC204H+k2TfOIj2uvQPPROTpxBi/032utvm45UlM5t2M?= =?us-ascii?Q?IZoSiIuZXV5ptG46EMMUVYEyQ8zLRzfTHJ01ggB/As2cUva2yQahla/A4V0Z?= =?us-ascii?Q?M/ 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: 0e351644-2ed6-4cfd-711f-08da5dff33c6 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jul 2022 20:53:09.2252 (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: H6IP7rigrFg7V3C5mMhlf02Hup2C2mGwUMsX8hSBw3IUjoQSpaWeuvTnsEWTkpnxcoTtS71ElvrmQDsO+yeNvw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4807 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.517, 18.0.883 definitions=2022-07-04_19:2022-06-28, 2022-07-04 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 mlxlogscore=999 malwarescore=0 phishscore=0 adultscore=0 spamscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2207040091 X-Proofpoint-ORIG-GUID: rapYp3jtRGbwrYKKHyYEQHHmoX5cbM2Q X-Proofpoint-GUID: rapYp3jtRGbwrYKKHyYEQHHmoX5cbM2Q Received-SPF: pass client-ip=205.220.165.32; envelope-from=drew.adams@oracle.com; helo=mx0a-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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:138299 Archived-At: > > Only after byte-compile of a file? > > So there is no way to actually make a function interactive only? >=20 > Please define what it is you mean by "make a function interactive > only". >=20 > Do you mean that it should be illegal to write code that calls the > function directly, so whoever writes it can be sued? > Would it be acceptable for someone to just think about writing such > code as long as they don't actually write it? >=20 > More seriously, what are you trying to gain by "mak[ing] a function > interactive only"? Usually, the reason why one might want to make > a function "interactive only" is that code that calls this function is > probably incorrect and would likely be served better by some > other function. So the purpose is to help people write better code. > For this reason the declaration only has an effect in terms of > byte-compiler warnings: those who don't bother to byte-compile their > code presumably don't care about the quality of their code anyway. >=20 > Emacs doesn't offer any pre-defined way to really enforce that > a function is only used interactively, and in large parts this is > because, as a matter of design principle, Emacs makes no effort to stop > people from shooting themselves in the foot (instead, it tries to make > it easier for people not to shoot themselves in the foot). Indeed. (My crystal ball whispers there's an X-Y problem under the covers here somewhere...)