From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: philip-agee@africamel.net Newsgroups: gmane.emacs.help Subject: Printing as documentation Date: Sun, 20 Jun 2021 09:52:59 +0200 (CEST) Message-ID: References: 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="9011"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: philip-agee@africamel.net, "Christopher Dimech" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 20 09:53:47 2021 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 1lusH4-0002CG-Tj for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 20 Jun 2021 09:53:46 +0200 Original-Received: from localhost ([::1]:40410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lusH3-0000zl-Vt for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 20 Jun 2021 03:53:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59562) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lusGQ-0000zb-9l for help-gnu-emacs@gnu.org; Sun, 20 Jun 2021 03:53:06 -0400 Original-Received: from msg-1.mailo.com ([213.182.54.11]:51614) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lusGN-0001pF-6I for help-gnu-emacs@gnu.org; Sun, 20 Jun 2021 03:53:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=africamel.net; s=mailo; t=1624175579; bh=y5b6wxpa+N2HytklFE2p/UTZyoecFkqoYeIUeV60Q6s=; h=X-EA-Auth:From:To:Cc:Date:Subject:MIME-Version:X-Mailer: Message-ID:In-Reply-To:Content-Type; b=0++jtT5GibBHIGgXP3hvZWXZJoMvdXGF3BHQAg8DPWuHWI/OhDXWd5LMSbTQ51vN2 VTyr6OFFFyF8hiL8tll2JoJvxcdEHzml6tYAkn0puHC7NYiaBKNd55m7wNuxK93f16 /PEYwSbv+4hufE5BBMHXTqpsA/ZlQ4Dtwcf4lcU4= Original-Received: by www-8.mailo.com with http webmail; Sun, 20 Jun 2021 09:52:59 +0200 (CEST) X-EA-Auth: 4BY1FMxj+ftifa9cdxxFSm0u0KGXe5VHv2zLv4lHFIfp1FyggQfJlYWFoH6rBHFMeSIYU6r2AOPexi/HxGc3REVqDGLUSvVj X-Priority: 3 X-Mailer: COMS/EA21.01/r20210601 In-Reply-To: Received-SPF: pass client-ip=213.182.54.11; envelope-from=philip-agee@africamel.net; helo=msg-1.mailo.com 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, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.help:131085 Archived-At: I am not sure if the *help* is working correctly because when I press on th= e Red Cross to quit or press (q), although the window gets closed, the buffer remains. From: philip-agee@africamel.net To: Christopher Dimech Subject: Printing as documentation Date: 20/06/2021 09:43:32 Europe/Paris Cc: help-gnu-emacs@gnu.org It does work.=C2=A0 I have found=20 with-output-to-temp-buffer too.=C2=A0=20 In addition to print there is=20 insert Any comments on how to choose between the different commands?=C2=A0=20 From: Christopher Dimech To: philip-agee@africamel.net Subject: Printing as documentation Date: 20/06/2021 09:33:42 Europe/Paris Cc: help-gnu-emacs@gnu.org Try using (defun typex () "todo docstring" (interactive) (with-help-window (help-buffer) (with-current-buffer (help-buffer) (print "test"))) ) > Sent: Sunday, June 20, 2021 at 5:54 PM > From: philip-agee@africamel.net > To: help-gnu-emacs@gnu.org > Subject: Printing as documentation > > Have tried the following code, but is giving me > invalid function: "*he= lp*" >=20 >=20 >=20 > (defun myfunc () > =C2=A0 "todo docstring" > =C2=A0 (interactive) >=20 > =C2=A0 (setq bufr (help-buffer)) > =C2=A0 (print "test" bufr) ) >=20 >=20 >=20 >=20 >=20 >=20 > From: philip-agee@africamel.net > To: help-gnu-emacs@gnu.org > Subject: Printing as documentation > Date: 20/06/2021 06:41:31 Europe/Paris >=20 >=20 > When I wish to see the self documentation I use >=20 > C-h f myfunc >=20 > I get a temporary help buffer displaying the docstring for myfunc. >=20 > Is it possible to to do the same kind of thing when calling a descriptio= n function "mydesc". > so that the print function are show in a temporary=C2=A0 help buffer? >=20 > (defun mydesc () > "docstring for mydesc" >=20 > (print "The brown fox" help) > (print "jumps over the fence" help) ) >=20 > M-x mydesc >=20 > wiil then behave similar to doing >=20 > C-h f somefunc=20 >=20 >=20 >