From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.help Subject: Re: Making alist that executes multiple commands Date: Sun, 24 Nov 2024 23:56:41 +0100 Message-ID: <87wmgss0k6.fsf@gmx.net> References: Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31509"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Heime To: Heime via Users list for the GNU Emacs text editor Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 24 23:57:37 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 1tFLXt-00084H-7r for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 24 Nov 2024 23:57:37 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFLX8-0007Lk-Th; Sun, 24 Nov 2024 17:56:50 -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 1tFLX6-0007LG-Eu for help-gnu-emacs@gnu.org; Sun, 24 Nov 2024 17:56:48 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tFLX4-0001K4-Jl for help-gnu-emacs@gnu.org; Sun, 24 Nov 2024 17:56:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1732489002; x=1733093802; i=stephen.berman@gmx.net; bh=52q9jnElwHhHcoCTz5pGEY9kEL3dHhFo5C6WYAzO8vo=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=IzSCtMTMgMEVmJ8aP8tWT+i17+w3a112n18JQRSh8zE98dD26p9vTmDW5YgY5zPz B+Og8kkOAsqzyiUDnECAvJFncjxD9SGz09T4OYnwQsWWz2grHcjPY+jmBT1FgDEfL nIZhrKrpYVG1Q+CFGolO7MpP0KvKcpZP+rRdzlqa9TfQkObDl1h9W40e3zk4VJBc/ 3/ghoDdXF8dbVBJJ3ZMlCCLV34M4NNpOvDm2pmpUUc7NT5CseIOfu0GAZB3w9I6Rm VfrsKYcy7lLAkZCWv3PPxEMzR5Up2OZmn/zGZitph37/ngCwNnuaNwRSB8h48Lb8/ nSZW617qU322jOnfmQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from strobelfssd ([94.134.95.109]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MXXyP-1tDSOk3y2h-00P9PZ; Sun, 24 Nov 2024 23:56:42 +0100 In-Reply-To: (Heime via Users list for the's message of "Sun, 24 Nov 2024 21:51:38 +0000") X-Provags-ID: V03:K1:vQlfR3ZaXEyoGM9zUCcVDJqx39aNXOHEZaRS6BBAsBwAl8T31GI 62LvBTrVPn6Ad+eN+YzPJnZNUAJfZpSOCgES0WbweXRr/bdaTJ88p+mxJJecjyjvZyJ1gMF jU9Y0ozJ9d4QXvChFgvfDR3/gHXPSjvwWiiqRePZFGW+OGjxS7uzPkZM0/ep+BrluKs3DzM jLABPLMHd/7X/12qap/Og== UI-OutboundReport: notjunk:1;M01:P0:Xnn5HTu41zU=;YfpjuoOhq6E6jhibU4aJIHK05QT /ii9z403yBLFXMKZzeRCflwrSgGyPlQSra7in6QzqrdPgohqrNF0u1VQEBv5hWSupWAz9fPHS xLu3KvbXvtuv8F8qehy0EFzD3D+KF09rFybUSClpsMs56V9lhAOKdra5u/aiCGigkUf++Ko88 llJDG1mvFgut2fEfN1cQc5etShWJm5lmy8rzoD3A2LCGH0UbJYhvrbqtUN2fETE3rnc/fKIJr UvGWdrlk0ZnezN1S74VFQMut1B42I6qq1W61cqKOxfNJqocYuwwjKnT4U9Me3z39xkOiQtvGf fCn+KdMILzzgV5+xpaqZPB/F3rqvogCwVpPoVu5Y7/OnQrwxggdjWqNGTxMKhpr22s66CxfT1 7BJb2Yha8tivzQGinlW9S3w+FYatv+AUI6emizyCp7dmMMKvOLMacJ5dYMh6cpB+da49cbHI2 XjTE/cWe7gp68MQrQY5qTfL4wgDSJFfTIcgV+mWkDDjy04ckfbuxYJFcOmjbnSJ+N5n1VuTHU Wv7zJn++rTfcHeHleWwyObA/lLEdBUGBXAjKNc9rxypjt3LsdVNMnMJFLt0RLYzfD0GUNV8Gx 7KEz7rPZMl2OO2T5J52qNhNzch4WWwCB2pbe+RUwXXwDx6H+TBgb4bQ0NdMPkX3kXC+9O098d ekVIFDUHsJY00jvDAgFxlMI7nBeaCyBcBDvZAh5DOdh2UeaFwgrIP/L0AYAHDcf6kdguKVM8E qJ+4IypzWUN46n/Scl7BJsT4qnosl10jr+etSafpdt9g5q9SD99ooVg4s+howEhDzeNjIN0W Received-SPF: pass client-ip=212.227.15.15; envelope-from=stephen.berman@gmx.net; helo=mout.gmx.net 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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:148379 Archived-At: On Sun, 24 Nov 2024 21:51:38 +0000 Heime via Users list for the GNU Emacs = text editor wrote: > What changes can I make to the following to allow me to execute more > commands than just one (as in alkotr-ar and alkotr-go). > > For ar I want to call functions alkotr-ar and alkotr-af > > (let ( (lookup-alist > '((ar . alkotr-ar) > (go . alkotr-go)))) > > (dolist (actm symbol-list) > (let ((func (cdr (assoc actm lookup-alist)))) > (if func > (funcall func) > (message "ACTM Unrecognised: %s%s" "'" actm))))) Something like this: (let ((symbol-list '(ar go)) (lookup-alist '((ar alkotr-ar alkotr-af) (go alkotr-go alkotr-gc)))) (dolist (actm symbol-list) (let ((fnlist (cdr (assoc actm lookup-alist)))) (while fnlist (let ((func (pop fnlist))) (if (functionp func) (funcall func) (message "ACTM Unrecognised: %s%s" "'" actm))))))) Steve Berman