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: Make command use specific functions for button action Date: Wed, 03 Jul 2024 00:04:49 +0200 Message-ID: <87le2jzbzy.fsf@gmx.net> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20089"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Heime via Users list for the GNU Emacs text editor To: Heime Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 03 00:05:35 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 1sOld0-00053W-Qs for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 03 Jul 2024 00:05:34 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sOlcW-0006z6-1B; Tue, 02 Jul 2024 18:05:04 -0400 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 1sOlcT-0006wa-Fc for help-gnu-emacs@gnu.org; Tue, 02 Jul 2024 18:05:02 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sOlcR-0001vY-Bb for help-gnu-emacs@gnu.org; Tue, 02 Jul 2024 18:05:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1719957890; x=1720562690; i=stephen.berman@gmx.net; bh=jBA/ax0EMLWrr2uI2QhXOj/TJQsl1gPY0KtLH9yxkX4=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=geqFjR4Wq5hwtiVbVRPwVogjGnzzMegE+D4+5S4i8f6b+snfX3QuS6fX/B8kzp4q dw9u774KTalLim1KYqtw6Ky7kmLqkSOZ8sG6mdaC/eiy2dwD8aFceEjDo4TyMqAKd 75v3c4UAV8P9sZiNxD7mWxT8oOCrtFq/jhcuKpD5ws+7ugJBKZkHcum6NaeXr6EGA F7LPF/cO5ay4MsbxjUpYZNU5Qtlpvk1oCyVNy1P5HItRysH9K1edwm7VEQ1t5Avnv 80Fb4fjuDYg4b0LBFWxIC+BJRMngEtonFgzq7Xq56/uJPMgl5Hla2EQu0oeL2Z70a bh+YOKXUpi6MgJkUxg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from strobelfs ([94.134.94.237]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mf078-1rwpf13qOI-00dufA; Wed, 03 Jul 2024 00:04:49 +0200 In-Reply-To: (Heime's message of "Tue, 02 Jul 2024 19:54:18 +0000") X-Provags-ID: V03:K1:eRcKI725ddyQh2rH1CG9FsuX4IhtDmgOA5sAt3X9Q4CWxMmVUej OQATKbzoI5OiCRtLWL4UuQ2RuM9t2PnkfVQfh3CNBj9Ifl2hjtemaS6osEJ925uUe32Mt6x awgRkRfS1+Hm8y6mZY97zKrP/iZaySz6jhZCTZfijXe9R8tUpQHHyoZj5qPB5H8bPcxrHsH 4+92wBaGDc266knJKBRfA== UI-OutboundReport: notjunk:1;M01:P0:otBsq++21z8=;+7bz4hpHio4lupilwLV65lsdzX8 a/bqyY16ov3F0oHI4tD+VOxoTv7ebo9smklxjYaDgyphcPIjvEDmh/nCsdJEGk/DGECH9w2M2 t23+rfo38J+zxVebuwTzj+NvQiStNMXan/dSdKeS21q6FAlmNAQPC+tHTevcfqqF235L05+Lj GTlZGyC4UCTT3lKq4SZd9SudA186bQ8mmuJ/hzLelO+e+Mg0fbTLqqNfVxdY3LcXDOfXTZdtl E+4203VVXI4XUJHhgZTCzlRKKgoCNFqbRpjn2mTYyBMj9niKqFNUe3UPJWG/GQSyKDxVQELcf w7RO+k7d1MHjaaDraYNwSwv8MK32lU2SIaEF7JeON4wQgsr7lABQ+kQ3WQcVHc+Zy0kV0q4u3 ByZaeuiCckLN9vu2LhY2Th7r9fYkO3jZF0iGn/QzUT1+tiPte8x4voqB1GUyV61a/OoHZkokH mDABfyJ1j1qiMf+dW8DprHkLMjgVmNb97+o1z9XX/Yt42s2MIkCmHj4oEqqCyLxfVBDKvKelz zcklCkyc0KIoJ6FTuAH63r2n9+E7EW2ueyg0cZk1pTv56c19QjrEglenF8N0S4MW8TDvox1kU fnV9czzjkJx+ZcGOayKqnQteGtcLMtuY8q4b1yyoewptdOsKjBOmJCh4BhFNRX0Tf07Y0447S 346d5iPiq/Te0jRnlRyjV/GjvZKaPCNyat7VtIVPFRxWK/yHKblhyTsipFk6+VFrnKnLH7q/8 PqK7xRI/nz0jteWaFs/DPBhBNBVnF2Wq4HRb/C9hmWrFATWhgSWQ0IWRZLlqUVN1AbG9xiov Received-SPF: pass client-ip=212.227.17.22; envelope-from=stephen.berman@gmx.net; helo=mout.gmx.net X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 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_H2=-0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:147055 Archived-At: On Tue, 02 Jul 2024 19:54:18 +0000 Heime wrote: > I have this function that displays two buttons, and calls the > corresponding functions lsk1g and lsk1d. I would really like to have > the capability to instruct mondu to use specific function names > rather than the hardwired lsk1g and lsk1d. > > For instance I want to make a call to mondu that will use lsk2g and > lsk2d rather than lsk1g and lsk1d. > > (defun mondu ( monbf ) > > (with-current-buffer (get-buffer-create monbf) > > (insert " DU \n\n") > > (insert " ") > (insert-button "[-]" 'action 'lsk1g) > (insert " lsk1g ") > > (insert-button "[-]" 'action 'lsk1d) > (insert " lsk1d ") ) > > (pop-to-buffer monbf) ) Pass a list of symbols of the functions you want on each invocation: (defun mondu (monbf funs) ... (let ((fun1 (nth 0 funs))) (insert-button "[-]" 'action fun1) (insert-button (concat " " (symbol-name fun1) " "))) ...) (mondu "Mondu" '(lsk2g lsk2d)) Steve Berman