all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <incal@dataswamp.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Executing function only if another function is defined
Date: Mon, 25 Jul 2022 13:14:38 +0200	[thread overview]
Message-ID: <877d41h2ap.fsf@dataswamp.org> (raw)
In-Reply-To: N7oseAp--3-2@tutanota.com

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	other threads:[~2022-07-25 11:14 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 [this message]
2022-07-25 11:30       ` carlmarcos--- via Users list for the GNU Emacs text editor
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=877d41h2ap.fsf@dataswamp.org \
    --to=incal@dataswamp.org \
    --cc=help-gnu-emacs@gnu.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.