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 21:24:39 +0000 Message-ID: <-Of1ukZDnMEs_SVnir4H5K16gZyeSQzumX2oqufViGBYgx6lWFHLhnFHoUC6_0NHmrd9FQ7I5-HyOlZWKDx1Go2wVfQ9Yb0WZrTPY2ihcbo=@protonmail.com> References: <87h6pvvh4i.fsf@gmx.net> <87cz0jvfjo.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="16405"; 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 23:25:35 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 1qNK6X-0003y8-No for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 22 Jul 2023 23:25:33 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qNK5z-0006dJ-VX; Sat, 22 Jul 2023 17:24:59 -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 1qNK5y-0006cv-AI for help-gnu-emacs@gnu.org; Sat, 22 Jul 2023 17:24:58 -0400 Original-Received: from mail-40138.protonmail.ch ([185.70.40.138]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNK5w-000303-9M for help-gnu-emacs@gnu.org; Sat, 22 Jul 2023 17:24:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1690061093; x=1690320293; bh=x9NpWnCNdUEAWPG4MsGiZoDGoXG/AQrFfBPo3aWTI38=; 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=LWm/bYtyI1P0JJ+KhbaAqTA3QZ0DYP24CW0wxGN5ygKyJVsfHy5P7Z4ZCSjIUgMcs aMrSQk2+adJSZ8wiOUnFatUvOQJltRxPTtY5JdJwhLd83VJO/4AuQ0QR0OqEnP+srL jJk52+VGe4TJflgO3g6AeunNXuQ1dkg8Xm15/LrdHpr1iZabUHiGDQy9D+nx/mimqm 65smaSeoWdAaarB9ONlvZZ0qnviWaUZI9qPQlLA5dUrF/pKh/x7BTOCX9op5zwOYBv 9SLPgw7EItOKTZhsh2pV4kFoMHHRlDbWeuteZBJp751Yd+bnamiKA1pn7DHtjZ9KPm ipV17KrHSyvCQ== In-Reply-To: <87cz0jvfjo.fsf@gmx.net> Feedback-ID: 57735886:user:proton Received-SPF: pass client-ip=185.70.40.138; envelope-from=heimeborgia@protonmail.com; helo=mail-40138.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:144394 Archived-At: ------- Original Message ------- On Sunday, July 23rd, 2023 at 8:48 AM, Stephen Berman wrote: > On Sat, 22 Jul 2023 20:24:16 +0000 Heime heimeborgia@protonmail.com wrote= : >=20 > > ------- Original Message ------- > > On Sunday, July 23rd, 2023 at 8:14 AM, Stephen Berman stephen.berman@gm= x.net wrote: > >=20 > > > On Sat, 22 Jul 2023 19:18:03 +0000 Heime heimeborgia@protonmail.com w= rote: > > >=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 insi= de > > > > > 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 > > > 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 > >=20 > > I do not understand the reason it expects an argument. >=20 >=20 > In the Emacs Lisp info manual there is the node `(elisp) Buttons', whose = first subnode is` (elisp) Button Properties', whose first entry is the > `action' property: >=20 > =E2=80=98action=E2=80=99 > The function to call when the user invokes the button, which is > passed the single argument BUTTON. By default this is =E2=80=98ignore= =E2=80=99, > which does nothing. >=20 > > Would there be > > a more suitable way to print some text after pressing the button ? >=20 >=20 > If you want to use a button, then I guess not, since it needs an action > (or mouse-action) property to do something on pressing the button. >=20 > Steve Berman In other words, insert-button needs a function with a single argument so it= can pass ignore. Yes ?