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

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

[External] : Supplying DOC string in a `defun' using `defvar'


From: Christopher Dimech
Subject: [External] : Supplying DOC string in a `defun' using `defvar'
Date: Wed, 2 Jun 2021 18:14:54 +0200

> Sent: Thursday, June 03, 2021 at 3:08 AM
> From: "Stefan Monnier" <monnier@iro.umontreal.ca>
> To: "Christopher Dimech" <dimech@gmx.com>
> Cc: help-gnu-emacs@gnu.org
> Subject: Re: [External] : Supplying DOC string in a `defun' using `defvar'
>
> >> Have you tried to click on that "/d"?
> >
> > It introduced  -*- lexical-binding: t; -*- at the top of the file
>
> Indeed.
>
> > Is that enough or would I need additional setup commands?
>
> Does (:documentation <foo>) work now?
>
>
>         Stefan

It does work.  So now I can pass a variable as documuntation.

The next thing is to first write a brief description as a normal string
- as normally done with defun, then append the detail string after that.

(defvar detail "this is a detailed description")

(defun myfun (x)
  (:documentation (concat "Brief\n" detail))
  (+ x 42))

This is working.  Would you be satisfied with the approach?






reply via email to

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