help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Printing as documentation


From: philip-agee
Subject: Printing as documentation
Date: Sun, 20 Jun 2021 13:53:36 +0200 (CEST)

I am really wondering about the utility of the two functions below, which seem

to be doing the same thing, at least from my perspective. 



-------



(defun brief ()
  "todo docstring"
  (interactive)

  (with-help-window (help-buffer)
        (with-current-buffer (help-buffer)
   (print "brief")))   )



-------



(defun detail ()
  "todo docstring"
  (interactive)

  (with-output-to-temp-buffer (help-buffer)
        (with-current-buffer (help-buffer)
   (print "detail")))   )

-------



From: philip-agee@africamel.net
To: philip-agee@africamel.net;
   Christopher Dimech <dimech@gmx.com>
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 the 
Red Cross

to quit or press (q), although the window gets closed, the buffer remains.



From: philip-agee@africamel.net
To: Christopher Dimech <dimech@gmx.com>
Subject: Printing as documentation
Date: 20/06/2021 09:43:32 Europe/Paris
Cc: help-gnu-emacs@gnu.org

It does work.  I have found 

with-output-to-temp-buffer too.  

In addition to print there is 

insert

Any comments on how to choose between the different commands?  


From: Christopher Dimech <dimech@gmx.com>
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: "*help*"
> 
> 
> 
> (defun myfunc ()
>   "todo docstring"
>   (interactive)
> 
>   (setq bufr (help-buffer))
>   (print "test" bufr) )
> 
> 
> 
> 
> 
> 
> From: philip-agee@africamel.net
> To: help-gnu-emacs@gnu.org
> Subject: Printing as documentation
> Date: 20/06/2021 06:41:31 Europe/Paris
> 
> 
> When I wish to see the self documentation I use
> 
> C-h f myfunc
> 
> I get a temporary help buffer displaying the docstring for myfunc.
> 
> Is it possible to to do the same kind of thing when calling a description 
> function "mydesc".
> so that the print function are show in a temporary  help buffer?
> 
> (defun mydesc ()
> "docstring for mydesc"
> 
> (print "The brown fox" help)
> (print "jumps over the fence" help) )
> 
> M-x mydesc
> 
> wiil then behave similar to doing
> 
> C-h f somefunc 
> 
> 
>






reply via email to

[Prev in Thread] Current Thread [Next in Thread]