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:43:32 +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="3551"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: "Christopher Dimech" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 20 09:43:59 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 1lus7a-0000ja-RC for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 20 Jun 2021 09:43:58 +0200 Original-Received: from localhost ([::1]:39294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lus7Z-00089o-SU for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 20 Jun 2021 03:43:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lus7G-00089g-5N for help-gnu-emacs@gnu.org; Sun, 20 Jun 2021 03:43:38 -0400 Original-Received: from ip-8.mailobj.net ([213.182.54.8]:37182 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 1lus7D-0002yY-Ri for help-gnu-emacs@gnu.org; Sun, 20 Jun 2021 03:43:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=africamel.net; s=mailo; t=1624175012; bh=oXle8+l7Gnouv3vOLBh9nt0kqmyrRzmDYR5S/Kj0+m0=; h=X-EA-Auth:From:To:Cc:Date:Subject:MIME-Version:X-Mailer: Message-ID:In-Reply-To:Content-Type; b=2Z0kvNecaUY4O4coFCyU7EjSTMryhqwJDQkvXWXJVruafccdF+J3l9JfvHHPv0Tyw PDw3irSnBxK6JlbPcoa2nTzkoBgucICwdyFPeLglLxU8aJbFIvoYZLEzjWHroh6jpf Hc3M46FQf3xKZQ1d7Ne/JGn6OOpI8pjOonpLROsg= Original-Received: by www-8.mailo.com with http webmail; Sun, 20 Jun 2021 09:43:32 +0200 (CEST) X-EA-Auth: 2b4/5TSQSJUK1q8m8Kqb4SISsXWKzvsvtSZory0wS/pA+Wxm/zDGw9GKewlAITK1uY/V737Hvkvqg/zZiUhoW+xMwEM0h28l 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:131084 Archived-At: 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 >