From: carlmarcos--- via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
To: Emanuel Berg <incal@dataswamp.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Executing function only if another function is defined
Date: Mon, 25 Jul 2022 13:30:58 +0200 (CEST) [thread overview]
Message-ID: <N7p6xw_--3-2@tutanota.com> (raw)
In-Reply-To: <877d41h2ap.fsf@dataswamp.org>
Jul 25, 2022, 11:14 by incal@dataswamp.org:
> 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 ...
>
What don't you agree with exactly? The docstring in the function
definition would only be a brief description. If additional information
in required, that can be added later, as not to encumber the function with
too much text before one can start seeing the implementation.
> 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?
>
In case there is a superior way to test whether the function was
defined.
>> 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
>
next prev parent reply other threads:[~2022-07-25 11:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-24 11:35 Executing function only if another function is defined carlmarcos--- via Users list for the GNU Emacs text editor
2022-07-24 14:33 ` [External] : " Drew Adams
[not found] ` <SJ0PR10MB548801BBE63F2CC264989A84F3929@SJ0PR10MB5488.namprd10.prod.outlook.com-N7kcFo0----2>
2022-07-24 15:13 ` carlmarcos--- via Users list for the GNU Emacs text editor
2022-07-25 1:42 ` Emanuel Berg
2022-07-25 1:39 ` Emanuel Berg
2022-07-25 8:08 ` help as a function of a NEWS problem (was: Re: Executing function only if another function is defined) Emanuel Berg
2022-07-25 10:24 ` Executing function only if another function is defined carlmarcos--- via Users list for the GNU Emacs text editor
2022-07-25 11:14 ` Emanuel Berg
2022-07-25 11:30 ` carlmarcos--- via Users list for the GNU Emacs text editor [this message]
2022-07-25 11:45 ` Emanuel Berg
2022-07-25 11:51 ` carlmarcos--- via Users list for the GNU Emacs text editor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=N7p6xw_--3-2@tutanota.com \
--to=help-gnu-emacs@gnu.org \
--cc=carlmarcos@tutanota.com \
--cc=incal@dataswamp.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.