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: How to get all commands defined in a specified file (or files)? Date: Mon, 11 Nov 2024 20:38:42 +0000 Message-ID: References: <87zfm5woji.fsf@mbork.pl> <86ttcdikwz.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="13237"; mail-complaints-to="usenet@ciao.gmane.io" To: Eli Zaretskii , "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 11 21:39:50 2024 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 1tAbCP-0003I1-Oc for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 11 Nov 2024 21:39:50 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tAbC4-0001jW-8H; Mon, 11 Nov 2024 15:39:28 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tAbC1-0001j3-Ry for help-gnu-emacs@gnu.org; Mon, 11 Nov 2024 15:39:25 -0500 Original-Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tAbBz-0003PE-O7; Mon, 11 Nov 2024 15:39:25 -0500 Original-Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4ABHoS6J028863; Mon, 11 Nov 2024 20:38:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=o1Ebl2hrWn2E7vW2uPeSSpQFO+1GDVKR1les03dYnRM=; b= Kq1Nl3IKmxBimXICtDgKbO1iTh37Y/HNaLqFP8cYNZK0qwskQVO4VF4IfW+X/BQH oa2GqcERSSnh0tuxdz/6uQ4UMkmPdK+tYseQggoLWEWne7grXXkQ+l9JT2Hv7jUu /d6iJvlw58svt4WvZpls/wFDqRZJm3WZOxWSWvGQLLfORXFjmfkLYrySpsxzyal9 QNQSIwWUiYFWWBpP8rDDAddmsiGAMTrZ492n+1zD+LQCXgVm6RMRcrN+w9ecwW2T U6jZFpWajcp5k44Zph7L4bIjfn8AFz1PDQKVILMW7QBMFTnUzQif+8dW6cn3hFMB VhwQt2MXDnbjHKzImliXcQ== Original-Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42t0mbb6uf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Nov 2024 20:38:46 +0000 (GMT) Original-Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4ABJJpvS028362; Mon, 11 Nov 2024 20:38:45 GMT Original-Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2168.outbound.protection.outlook.com [104.47.59.168]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 42tbp6gbv7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Nov 2024 20:38:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WX96LS76YDmbGpF22Oe2DwrjWUkoGyEDPHNQLUD3W/KihuJ86hALUwOqs7KClYAH2HygwUPLcHE5ysCNlnGk6NApfnx4dCzjbfQsK5ijWkVQS5EZ/6xMJE5bWhkK71ghiqVH3KZRwpw67781cSghyM9n8oKrygnr9Ly2gcWP3CE6xaQL7Mf3OFCKH3FGPF4dOemVi4foz6ssQhtxctdCsKPLXEI4Qw5wtXGM5FnBgJmQ0BuXdfZGkD/ktGcg7sdL1N+e1lT5+FuajbnrvzWUcFsEweyfCIzISZpm4pwHOKNGrldkkFO/XFlhOR+CP7Eb5ToPp/ieyGGsvelUQONKPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=o1Ebl2hrWn2E7vW2uPeSSpQFO+1GDVKR1les03dYnRM=; b=uhDuEou4VqjgNywuA/j0g89zaRYtTRf66LRXjGhXcmmDpYs4FNKdrH01wnMqL4d7SRLFv9vAINmS3BNwRv8sJlOaPxJVlJ2FmS3t+GM3x9cBYWCV14snCYGjwospRmrPABOffzaMhH4pHlsYW5kDGg2uPmQmA1fj1Q/DMuq7FHqTGW8eML/n6kErP1ia06bE1/zf+6Ct7OKGmogaczqireluIBW1jtMne4qPEcUw4mW2J+a40TX7B3ajn621hPRzV9tsv4MX9Ig7RVp5ZD35rrU9iPwdE3kH71S/H31eMa7bcpL1rxgmqYKZHnNjpl6Kqfg6oRGX+rOgBm1FKgqT9g== 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=o1Ebl2hrWn2E7vW2uPeSSpQFO+1GDVKR1les03dYnRM=; b=ivaOJknBMYTbHn0ysDMq4kcFz2JhzKIhq+hlMD3WEJDf3KShbjdlxme8IMK7+sVNzEc0uOeaZGYnRd2BlxG4PtiF0m2uiizYQoC9WQUlgZJVSOpvJO35NUAxE2EJckm93lPmL40QSkPJOhfhqZlKpkNd1K+V/SCgSnEKG5tagO4= Original-Received: from BLAPR10MB5219.namprd10.prod.outlook.com (2603:10b6:208:321::22) by SJ0PR10MB5859.namprd10.prod.outlook.com (2603:10b6:a03:3ef::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.27; Mon, 11 Nov 2024 20:38:42 +0000 Original-Received: from BLAPR10MB5219.namprd10.prod.outlook.com ([fe80::8179:21ba:b158:7d50]) by BLAPR10MB5219.namprd10.prod.outlook.com ([fe80::8179:21ba:b158:7d50%6]) with mapi id 15.20.8137.027; Mon, 11 Nov 2024 20:38:42 +0000 Thread-Topic: [External] : Re: How to get all commands defined in a specified file (or files)? Thread-Index: AQHbNHcBVZVGqWWcRUeuzZHRLbaWPLKyic2w In-Reply-To: <86ttcdikwz.fsf@gnu.org> Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BLAPR10MB5219:EE_|SJ0PR10MB5859:EE_ x-ms-office365-filtering-correlation-id: 22255760-6776-41d6-9dca-08dd0290d4b6 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?j9p3pG5yFbsNSe8Mfcsq4eKK6vjunoB5BOIry4yw7raNEwggfBSwqnuIrczJ?= =?us-ascii?Q?CUvJeb/S8IK/VzXdao32Ru62cIjLn6MEJpSottie6XOk8XCUEXLGh3PGPdO/?= =?us-ascii?Q?HKJ89lfuP/aYpRUcZQ2AmGWIa5G3InhmYokWNNEVNGXhcSyxzyKCZ19HnrTk?= =?us-ascii?Q?2TLC7FCgIzKBNTyjOyI6Uan6R+KlTw8U/9Ff5uzJnV15XyzDKrJEucdJSwx/?= =?us-ascii?Q?r/XOkGRA9G9vLNP19y5W4xwqjmoYhbxKZJOMUGmB18O8BRWVIL1k+vjDUrRB?= =?us-ascii?Q?ToiJa0vyp/aOM7ZPhKznFH6st8hGuig3ldVpd+kG2i7ht/ITsqk1D+qlYXs8?= =?us-ascii?Q?UXJ8B5oKHQEC7SkjtLAJgyJSvEfiJehlRZU9hYLhebixoAJHd8U3UWtTVril?= =?us-ascii?Q?0EOuMdkxJLmGPugBiKPzYe9Z0q2ZZ1O0DHn/XlyVEghWCsvuTpOVfLr8nQKh?= =?us-ascii?Q?9LkizdpdbPI0pxW2cQNUKcKmN7CQqHxPNsBeTJTKsNjvbHsJUacXPFTHSofg?= =?us-ascii?Q?AZhcAB/Fma5pFvGGa0fh7kNfMWuhH87T5hvJIL6KR/TrDA2zy9f+WyKnpECm?= =?us-ascii?Q?ffn7y3CARwOSwnhuia9rbu6LbXkD5/oXpUqLX55Cj2N1m28+l2VDJNXRUUOu?= =?us-ascii?Q?8suKD x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BLAPR10MB5219.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?v8Gwc+l/HV6VkxfFNifl1OlmbFBmgQ7zE48PbzcYtlHjKalSTW6pXp63pDLy?= =?us-ascii?Q?sUbxdjlpGe9fJUf30Arksh66lKvOI9250yD+L4yrvXFa0+o00uZDeivfoyBZ?= =?us-ascii?Q?OS9IgcNTz9FNM9YgJoXJ7yCwDK3U1+m5b6cEkfbLn96i9D7XcYehumsmbcWL?= =?us-ascii?Q?8ukrp2pCMWEF89nSfRWRzzLAxyBO2f2OmXlosXEjfF7ORzAH6yi2mZHQCTNU?= =?us-ascii?Q?5DNL5wBoccJIDM/en1B4OeCd2gXlvms16W1cp4H+0Lm5gxVHTEP84VLeTffF?= =?us-ascii?Q?AX1Y/6LQgLp4NkGmv3oHjpeTrgDVoBmhxk3CilejS+q9mCtjkMu7CxtKpCRk?= =?us-ascii?Q?2h+cJTkRsCBE6TIqI0gtWmoWGpOIe+om8/7bmYhSwOrFnbcmCNQEA3dLVvWp?= =?us-ascii?Q?R4tP6gXqwqAuRmeYHJfVacCFqCnELi7F0E9F/Q60tiqb6KSfg9iXdCn2qllF?= =?us-ascii?Q?B+Nv8CAyTOg+YybXUepIsznPAI39D4PvEaJHuBl5nfwAyVWQVmWND8cBbP/v?= =?us-ascii?Q?EM094W91ftwI0TXubPmUGOAX4wuZmrKpAyOGqmEovgY8a6d/JtJnY7HkIPU+?= =?us-ascii?Q?ww90DGt0BxtAVG7jZqRQGijPx4duOHrMpwvkjEuROEpKGSGClC0OiMD2UkYI?= =?us-ascii?Q?fG X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: WHkL+5bIwzD+w5Ti++fGswjyCgAwUv/pl5+SlxPr09FqnERLyqtm34pAjcHPWDlO+WSf+0hoS1eBYT9M3IJVh/0C7FeoeDaaAQTXLYJr7SQbcSLuHD5IJ5zCd4oqEbfFWhV7j4NGGCpairdzoZa0JpoE3X3F5os3URJdzLBSxDQHESpo9O/n3qeFLo8QaS7ZJ7No3P/nXWGQxlYWTH/+d8rDpTzfUV85qvRbiMGCTMNGt5Xj3ZmzoI10+4uX59e5UGQ6wZvw5iCyeuoSAyYivRabvStm3TYQrTN9Uz/Ir3yjEsKxFzBbKZQAQJ154zXU3wn7xKyG6qeMpi23h25HcN4+i1YkRGGDQ+80eqzVWv2SNoFypE8TiAdJn+3tTsgkzKeT4b891Tw4FUrSTJHc7U79L2Dczoe6kYBFygAS/c76DAeqzLrB44oMYejDOjnaW+we/s0WrnecWNARyPL7rc3YqNL46eX/0VTaNsqlPvgScuPjBL7Xb1iSWSzpfPIa4Y2OexDqiX5zD5jWzWrvGY2MphFe2sq8giMrnmueiicOMOrP9sXGURE7Bu6GvzF/S/iRah9ip7wUbX42Rcm95OLh+nsuvpZVTlQPWOEQ/X8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5219.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 22255760-6776-41d6-9dca-08dd0290d4b6 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Nov 2024 20:38:42.3185 (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: 7xTKXsump25p+xg4oz0eOWc8R4eUBcoHXT7UqZXcjk8Iwwb9poEyxsM5kJpbvupQoCP6PcaumlX85/QyD7rRgA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5859 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-11-11_08,2024-11-08_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 malwarescore=0 mlxlogscore=999 spamscore=0 phishscore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2411110165 X-Proofpoint-GUID: SQEBtN9kbpbngikWzyVdtYBQE0sQcLbX X-Proofpoint-ORIG-GUID: SQEBtN9kbpbngikWzyVdtYBQE0sQcLbX 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:148317 Archived-At: > > say that I'd like to define a `execute-extended-command' alternative > > which would only allow to run commands defined in a specified file. > How > > can I get all such commands? I know about `symbol-file', but I don't > > know how it works (and it's complicated enough that I'm not sure I > want > > to study it ATM;-) - I tried to instrument it for edebug, but a quick > > run revealed only that it's pretty mysterious). I also looked at the > > property plist of a function name and saw that the filename is not > kept > > there. Any hints? >=20 > We have a facility to mark commands as relevant to a major mode or a > list of major modes. If your file defines a major mode, you can use > this for doing what you want. See the command > execute-extended-command-for-buffer. A more general facility is the > variable read-extended-command-predicate. Maybe also... Has the file been loaded, so the commands are already defined? Or are they at least autoloaded? Does the file use a library-specific prefix for all of its function names? If so, you can filter all commands (`commandp') according to that library prefix.