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

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

Re: Executing function only if another function is defined


From: Emanuel Berg
Subject: Re: Executing function only if another function is defined
Date: Mon, 25 Jul 2022 13:14:38 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

carlmarcos--- via Users list for the GNU Emacs text editor wrote:

> (defun docboost (fname doc-boost)
>   "Appends a string to the documentation of a function.
> FNAME     Name of function
> DOC-BOOST Documentation"

Nice!

It should be automated to appear like that by default and
automatically, and incorrect docstrings shouldn't not just be
"considered" bugs, they should be bugs ...

Well, automated - one would still have to write (and read)
the information manually ...

However the first argument's name is perhaps not so good as
its inclusion of "name" implies it is a string, better to call
that just "fun" perhaps. And not just for fun ...

The second argument's isn't so good either as the "boost"
suffix doesn't add anything. Maybe call it "doc" or
"str" instead?

> (if (functionp fname)
>   (put fname 'function-documentation
>        (concat (documentation fname t) doc-boost))))

`when'

> Is `functionp' appropriate for testing whether `fname'
> was defined?

I don't see why not?

> Adding a newline before printing the additional
> documentation would be a sensible thing to do. How to do it
> within docboost?

"\n"

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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