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 13:53:36 +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="40861"; 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 13:54:18 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 1luw1q-000AOq-3e for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 20 Jun 2021 13:54:18 +0200 Original-Received: from localhost ([::1]:37176 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1luw1p-0000Mj-56 for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 20 Jun 2021 07:54:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55260) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luw1L-0000MX-Ta for help-gnu-emacs@gnu.org; Sun, 20 Jun 2021 07:53:47 -0400 Original-Received: from ip-8.mailobj.net ([213.182.54.8]:45918 helo=msg-3.mailo.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luw1I-0005My-4Z for help-gnu-emacs@gnu.org; Sun, 20 Jun 2021 07:53:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=africamel.net; s=mailo; t=1624190017; bh=OVAucU/PBnMvm3SazMMNV28yjmyXcZ2qel2fzFiYdP8=; h=X-EA-Auth:From:To:Cc:Date:Subject:MIME-Version:X-Mailer: Message-ID:In-Reply-To:Content-Type; b=3vlTi70iXmSYpDMpMyqSzvn2nTrjFmSQrGsJtAIa9Qa/SnD039blMaNCWhpmXmmyO laNG8Ih/9NwzyoSqyhQiaUjA+uzzojTEr1ZgVfoqRMF3xT5rOBtuPX0vuVrct80d07 iPc9b/Pqmjr7CeR5bt8j/Z234cdC/qJgBybYrDQs= Original-Received: by www-8.mailo.com with http webmail; Sun, 20 Jun 2021 13:53:36 +0200 (CEST) X-EA-Auth: UWc4DS/LCU7qNKVj8xmLE0Ck3kET0VA6J3WoBO5oydM0PmI7j4B18DIGd34NZ8+z26sF4fRuX7XeV9HR5chyLUK/5x9/2SQh X-Priority: 3 X-Mailer: COMS/EA21.01/r20210601 In-Reply-To: Received-SPF: pass client-ip=213.182.54.8; envelope-from=philip-agee@africamel.net; helo=msg-3.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:131094 Archived-At: I am really wondering about the utility of the two functions below, which s= eem to be doing the same thing, at least from my perspective.=20 ------- (defun brief () =C2=A0 "todo docstring" =C2=A0 (interactive) =C2=A0 (with-help-window (help-buffer) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (with-current-buffer (help-buff= er) =C2=A0=C2=A0 (print "brief"))) =C2=A0 ) ------- (defun detail () =C2=A0 "todo docstring" =C2=A0 (interactive) =C2=A0 (with-output-to-temp-buffer (help-buffer) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (with-current-buffer (help-buff= er) =C2=A0=C2=A0 (print "detail"))) =C2=A0 ) ------- From: philip-agee@africamel.net To: philip-agee@africamel.net; =C2=A0=C2=A0=C2=A0Christopher Dimech Subject: Printing as documentation Date: 20/06/2021 09:52:59 Europe/Paris Cc: help-gnu-emacs@gnu.org I am not sure if the *help* is working correctly because when I press on t= he 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 >