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

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

Re: Printing documentation string of another function


From: Stephen Berman
Subject: Re: Printing documentation string of another function
Date: Wed, 10 Apr 2024 21:36:29 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

On Wed, 10 Apr 2024 17:17:00 +0000 Heime <heimeborgia@protonmail.com> wrote:

> With the following implementation, I cannot get the documentation string
> of the appropriate function to display.
>
> (defun avus-doc (seltr)
>   "Print the documentation string of a particular function."
>
>   (interactive
>     (list
>       (let ( (cseq '("Greek"   "Flokki")) )
>         (completing-read "Doc: " cseq nil t "Greek"))))
>
>   (pcase seltr
>     ("Greek"     (documentation 'avus-greek))
>     ("Flokki"    (documentation 'avus-flokki))) )

`(documentation 'avus-greek)' just returns the doc string, it does not
display it.  You have to add code to do that, e.g.:

(defun avus-doc (seltr)
  "Print the documentation string of a particular function."
  (interactive
   (list
    (let ((cseq '("Greek" "Flokki")))
      (completing-read "Doc: " cseq nil t "Greek"))))
  (let ((doc (pcase seltr
               ("Greek"     (documentation 'avus-greek))
               ("Flokki"    (documentation 'avus-flokki)))))
    (tooltip-show doc)))

Steve Berman



reply via email to

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