[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Supplying DOC string in a `defun' using `defvar'
From: |
Nick Dokos |
Subject: |
Re: Supplying DOC string in a `defun' using `defvar' |
Date: |
Tue, 01 Jun 2021 14:51:31 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Christopher Dimech <dimech@gmx.com> writes:
>> 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."
>
It should be
(defun my-fun (x)
...
Then try `C-h f my-fun'.
--
Nick
"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler
- [External] : Supplying DOC string in a `defun' using `defvar', (continued)
- [External] : Supplying DOC string in a `defun' using `defvar', Christopher Dimech, 2021/06/03
- Re: [External] : Supplying DOC string in a `defun' using `defvar', Stefan Monnier, 2021/06/03
- [External] : Supplying DOC string in a `defun' using `defvar', Christopher Dimech, 2021/06/03
- Re: [External] : Supplying DOC string in a `defun' using `defvar', Stefan Monnier, 2021/06/03
- [External] : Supplying DOC string in a `defun' using `defvar', Christopher Dimech, 2021/06/03
- Re: [External] : Supplying DOC string in a `defun' using `defvar', Jean Louis, 2021/06/03
- Re: [External] : Supplying DOC string in a `defun' using `defvar', Eli Zaretskii, 2021/06/03
- Re: [External] : Supplying DOC string in a `defun' using `defvar', Lars Ingebrigtsen, 2021/06/03
- RE: [External] : Supplying DOC string in a `defun' using `defvar', Drew Adams, 2021/06/01
Re: Supplying DOC string in a `defun' using `defvar', Jean Louis, 2021/06/01
Re: Supplying DOC string in a `defun' using `defvar',
Nick Dokos <=
Re: Supplying DOC string in a `defun' using `defvar', Michael Heerdegen, 2021/06/01