From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Heime via Users list for the GNU Emacs text editor Newsgroups: gmane.emacs.help Subject: Re: Making alist that executes multiple commands Date: Sun, 24 Nov 2024 23:13:51 +0000 Message-ID: References: <87wmgss0k6.fsf@gmx.net> Reply-To: Heime Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7893"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Heime via Users list for the GNU Emacs text editor To: Stephen Berman Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 25 00:14:39 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 1tFLoN-0001td-Fw for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 25 Nov 2024 00:14:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFLnn-0000dr-T5; Sun, 24 Nov 2024 18:14:03 -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 1tFLnm-0000di-TP for help-gnu-emacs@gnu.org; Sun, 24 Nov 2024 18:14:03 -0500 Original-Received: from mail-40140.protonmail.ch ([185.70.40.140]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tFLnk-00037V-Va for help-gnu-emacs@gnu.org; Sun, 24 Nov 2024 18:14:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1732490037; x=1732749237; bh=vM3cHVCjXqcqF476jDDJcQ3ybH5/epIaoFme9q4LyPI=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=wPjEJPSg5jaY1r2GGCPTXk3tke3FH11QS+8TI8XBuYLOJ71eNgnKQHCWJQXlXJiK7 tBQddT5TVqAv7JCs9J9cYMJ+iCh9zU2wyJ74kNS411HwnKlq4wWZOQizJfW67y2DCo 9A9WPVvtFXqx47qtqfGqfYP1oV8UiFakhLECq44gUDKyAbjVcvYH/vEgwkJkpRDpWC T2bYllqQXQvWTfvudUrjPgDg4Sd3GvYlD+8I7/uIJHzmNnV1Mgj1ja2LTJdTtzrpzV hewWyNcLN+l9om/0T2p4fsvtLP4Ksm4uSxTsnPgtXbzb66aDCKVCBOdYlajcT3xb5e zJZLebv+jajwA== In-Reply-To: <87wmgss0k6.fsf@gmx.net> Feedback-ID: 57735886:user:proton X-Pm-Message-ID: 0106cb85ad766107f5308e9e8dc08befcf464d23 Received-SPF: pass client-ip=185.70.40.140; envelope-from=heimeborgia@protonmail.com; helo=mail-40140.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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:148380 Archived-At: On Monday, November 25th, 2024 at 10:56 AM, Stephen Berman wrote: > On Sun, 24 Nov 2024 21:51:38 +0000 Heime via Users list for the GNU Emacs= text editor help-gnu-emacs@gnu.org wrote: >=20 > > 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). > >=20 > > For ar I want to call functions alkotr-ar and alkotr-af > >=20 > > (let ( (lookup-alist > > '((ar . alkotr-ar) > > (go . alkotr-go)))) > >=20 > > (dolist (actm symbol-list) > > (let ((func (cdr (assoc actm lookup-alist)))) > > (if func > > (funcall func) > > (message "ACTM Unrecognised: %s%s" "'" actm))))) >=20 >=20 > Something like this: >=20 > (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))))))) >=20 > Steve Berman Have thought about this. Any criticisms about it? '((ar . (lambda () (alkotr-ar) (alkotr-af))) (go . (lambda () (alkotr-go) (alkotr-gc)))) What would you suggest for function commands requiring arguments,=20 e.g. (alkotr-ar ar) and (alkotr-af af)?