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

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

Supplying DOC string in a `defun' using `defvar'


From: Christopher Dimech
Subject: Supplying DOC string in a `defun' using `defvar'
Date: Tue, 1 Jun 2021 07:19:37 +0200

> Sent: Tuesday, June 01, 2021 at 3:26 PM
> From: "Stefan Monnier via Users list for the GNU Emacs text editor" 
> <help-gnu-emacs@gnu.org>
> To: help-gnu-emacs@gnu.org
> Subject: Re: Supplying DOC string in a `defun' using `defvar'
>
> > (defvar my-doc "Hello")
> >
> > (defun my-fun ()
> >   my-doc
> >   (ignore))
> >
> > It did not work, but I think it should.
>
> Try:
>
>     (defvar my-doc "foobar")
>     (defun (x)
>       (:documentation my-doc)
>       (+ x 42))

Have tried this but emacs is still saying "Not documented."




reply via email to

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