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: Buttons in help buffer that displays contents of variables Date: Sat, 22 Jul 2023 22:14:05 +0200 Message-ID: <87h6pvvh4i.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="2610"; 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 Sat Jul 22 22:14:43 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 1qNIzy-0000Qa-R5 for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 22 Jul 2023 22:14:42 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qNIzW-0007kt-BO; Sat, 22 Jul 2023 16:14:14 -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 1qNIzV-0007kX-6x for help-gnu-emacs@gnu.org; Sat, 22 Jul 2023 16:14:13 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNIzT-0001x2-HU for help-gnu-emacs@gnu.org; Sat, 22 Jul 2023 16:14:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1690056846; x=1690661646; i=stephen.berman@gmx.net; bh=qW+vHbwNhmAeRLtHAYJ9wDA80blYpM+zPFZljdoI214=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=dnBeFCPE9x4dYtwbBNwT78yCajCayBm1Az/HbtwdMUzezonclSsd7dqwSZ22Xb1irmT3UJT cHPLgQCKxdNsYpEvyF4gQCXVfeO6ee+s0xVaWC6y77LtqgixI230AM3vHyNXkO5Q3FgOl5h/3 dlOZeU9Q4wR4BM3oXtq4S+TI/IZPRfufNXaMZ3wMYS2nB7Mns2q1NU2GE1kG9OYKT39ci2/tX ZWjobE1vZE1h//XexcQc0F6mPA/RbS59r+4pBkvy4ulE1vvzNIIygmSGR7Kx9Be8ZA8p5WewM Gvnezskctz9mMpY3NpiFpS7q4AmVRm/ZmnKxm3N75oQIHfEmczdQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from strobelfssd ([94.134.196.80]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MC30Z-1qBRYp2FnZ-00CNrP; Sat, 22 Jul 2023 22:14:06 +0200 In-Reply-To: (Heime's message of "Sat, 22 Jul 2023 19:18:03 +0000") X-Provags-ID: V03:K1:8xz/q8IrtQe3lekaffkuQSjV4NHiVlP242P8YJW7nIidyscwxNI YcXTH9P+uQQDzEp3Eow/kt/1Wip7Na7JHKo9AtPZ6mKUBRCorK8iSwcPGoZwT8TWH6oVHNs SQamj8EJ4bHcu/b/8zhxvx5Wb2BMYOMGoa4/bFxKOTkaMbgsSpLRcHDBGNhpTz+H6hLJwxk H9td+5jGceP/lAm8DFbbg== UI-OutboundReport: notjunk:1;M01:P0:U4BD9W/domE=;IsAoCm42lSX9cDOchDuVtkcv3Bb XCNZ6yQgjpATeD125pho/BVeUOlnp8N3Ow//l7Bxs6b0nI3RVQuB8cEJVVDU3Q+ugqz2FZENt QX9gV4WfnH9j7nifJG3SHliymiEtrlf7jIXsITgxfx2TqlGIcOGv1x+PIB95CAcchXJs3fN6R musIyLhTYoWXucxEtRqJGkxaHAbdnMObYhkslAFSo05jJIjlq5aZ4kQmeYiaVErMq3j6t/H8P cpy8MwmrqgWG9uRsio8SVjtWB8wLK7JUD3EbeCVv+6QzcAzd5SDkBX7a4IVn5hg11YqVg4JAR CtUqLN4cVtv7E40yKBc5j8SZjVI6LsZkyQbHVGxosuMz8BGXiZBf4laH9/bTdIUTa0IYj6F8o +rlt1U2IXYoTaaykswDGZXcZOCEtWr+odE+xBxDeHXttYgI4wQYFWzmV52WS0M7b6RhAYz9lT idDhTPBLyGHtNqc4G7PSiTbwQjgeWuvU50y9r9oM16cEQAZLmxNf/K6dNMzDylvb5EWaP9Htl nascoMAg0kphyU0cBqTw3+t3hZe9hryaGnpVqprLlmsDyZDxasRqkiQ7lmvH7/xDelHTp+xFD 0bd2J0tD+s5q5U4HjVSOMaWQ7HDV8D33l1Sbrl28RkzwvcwMZXNRG6EOTrKDNmmgzfmiBw3Mi t/y881uT5SISHfDQN4lovkk9YS31lYwAfD7qz7xQyj4L/+DBUMGXBakSP4ydsR9grzGdGGKA0 PMUJ8XDTDe86wYB6xxjGugmINjWdcEKwbdtOQ8IBCBJOAJ9PudBVClUMqU5OAhTXWNaohZo5 Received-SPF: pass client-ip=212.227.15.19; 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_H2=-0.001, SPF_HELO_NONE=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:144391 Archived-At: On Sat, 22 Jul 2023 19:18:03 +0000 Heime wrot= e: > ------- Original Message ------- > On Sunday, July 23rd, 2023 at 2:40 AM, Heime wrote: > > >> I want to use a button to display the contents of a variable inside >> a help buffer, but the following gives >> >> (wrong-number-of-arguments ((t) nil "Function to be executed when the b= utton >> is clicked..." (interactive) (message "Button clicked!")) 1) >> my-action(#) >> > > Why does pressing the button give me such error ? > >> >> (defconst myvar "Text of Front A") >> >> (defun my-action () >> "Function to be executed when the button is clicked." >> (interactive) >> (message "%s" myvar)) >> >> (defun qrh () >> "Some description." >> >> (interactive) >> >> (with-help-window (help-buffer) >> (insert-button "Front A" 'action 'my-action 'follow-link t))) 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: (defun my-action (_) "Function to be executed when the button is clicked." (interactive) (message "%s" myvar)) Steve Berman