From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Heime Newsgroups: gmane.emacs.help Subject: Re: Buttons in help buffer that displays contents of variables Date: Sat, 22 Jul 2023 20:24:16 +0000 Message-ID: References: <87h6pvvh4i.fsf@gmx.net> 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="12355"; 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 Sat Jul 22 22:25:11 2023 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 1qNJA6-0002zE-RT for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 22 Jul 2023 22:25:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qNJ9W-0000Ky-TK; Sat, 22 Jul 2023 16:24:35 -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 1qNJ9V-0000K0-LW for help-gnu-emacs@gnu.org; Sat, 22 Jul 2023 16:24:33 -0400 Original-Received: from mail-40132.protonmail.ch ([185.70.40.132]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNJ9T-0006wM-Ko for help-gnu-emacs@gnu.org; Sat, 22 Jul 2023 16:24:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1690057467; x=1690316667; bh=qswayZMCZKDVoFUN5nxmumkcY1BneshFx1Krz+YiDmA=; 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; b=lsohlgMhamSOMzi5FO8t/523UX7w8JkekQrt20jiTcP/VmLtxOcmrbkIYvjlscjvr 89ZQ/E+2U4hupiNzhZX/4oIZ13bLZQAXNw/2yhdGsVee9vxMdgkFoDNfDJoO8+dflI u+1SQTgynA2aSDgK4q3KBki9iKUWdaLamRKE5L/A7s1cuzix6B+3dhTjgLomq8Ll5I P9jxX+Db5I6g/ly0e2mfWHu8Z+oUXPkn9xiEPtsuDztAP+4STbSrV4g2aBSZ+yyxvY tDuX5sZRoQLoW6CPLbUiqhXR0Fg9e1XfYoNABAnEzc/mcEg+bbzz9dgTR3i7MtBDog 6664EmD9cHpdw== In-Reply-To: <87h6pvvh4i.fsf@gmx.net> Feedback-ID: 57735886:user:proton Received-SPF: pass client-ip=185.70.40.132; envelope-from=heimeborgia@protonmail.com; helo=mail-40132.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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:144392 Archived-At: ------- Original Message ------- On Sunday, July 23rd, 2023 at 8:14 AM, Stephen Berman wrote: > On Sat, 22 Jul 2023 19:18:03 +0000 Heime heimeborgia@protonmail.com wrote= : >=20 > > ------- Original Message ------- > > On Sunday, July 23rd, 2023 at 2:40 AM, Heime heimeborgia@protonmail.com= wrote: > >=20 > > > I want to use a button to display the contents of a variable inside > > > a help buffer, but the following gives > > >=20 > > > (wrong-number-of-arguments ((t) nil "Function to be executed when the= button > > > is clicked..." (interactive) (message "Button clicked!")) 1) > > > my-action(#) > >=20 > > Why does pressing the button give me such error ? > >=20 > > > (defconst myvar "Text of Front A") > > >=20 > > > (defun my-action () > > > "Function to be executed when the button is clicked." > > > (interactive) > > > (message "%s" myvar)) > > >=20 > > > (defun qrh () > > > "Some description." > > >=20 > > > (interactive) > > >=20 > > > (with-help-window (help-buffer) > > > (insert-button "Front A" 'action 'my-action 'follow-link t))) >=20 >=20 > The error says the function my-action expects one argument, but you > defined it with an empty argument list. If you don't want to use the > argument, you can use `' as a placeholder for the required argument, > which will be ignored by the byte compiler: >=20 > (defun my-action () > "Function to be executed when the button is clicked." > (interactive) > (message "%s" myvar)) >=20 > Steve Berman I do not understand the reason it expects an argument. Would there be a more suitable way to print some text after pressing the button ?