all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Michael Heerdegen <michael_heerdegen@web.de>,
	Richard Stallman <rms@gnu.org>
Cc: "ludvig-faddeev@gmx.com" <ludvig-faddeev@gmx.com>,
	"48768@debbugs.gnu.org" <48768@debbugs.gnu.org>
Subject: bug#48768: [External] : bug#48768: Introducing ability to append to docstring
Date: Tue, 1 Jun 2021 14:44:16 +0000	[thread overview]
Message-ID: <SA2PR10MB4474183EC2F8F766CA947011F33E9@SA2PR10MB4474.namprd10.prod.outlook.com> (raw)
In-Reply-To: <87bl8py8x6.fsf@web.de>

> >   > A useful capability would allow one to append to a defun docstring
> >   > using a defvar.
> >   > User could write a brief description for the docstring, and later
> >   > append more details
> >   > from a defvar.
> >
> > Could you show an example of what this would look like, in use?
> >
> > I'm trying to guess -- though I don't have confidence in my guess --
> > and I think this might be a useful feature but would be easier to use
> > with a different interface.
> 
> We already have the `function-documentation' symbol property, no?
> 
> I wonder what use cases the OP has in mind for that that interface we
> have is not sufficient and why the suggested interface would be more
> appropriate.

Not to mention that you can add to an existing doc string
using advice (old advice or new nadvice, AFAIK).
___


In the days before nadvice, the doc addition appeared
in-line, as part of the doc you see when you use `C-h f'.
Now (unfortunately) we instead insert a link in the
`C-h f' help display, and only if you click that link
do you see (only) that added doc in *Help*.

IOW, you don't get an integrated view of the doc.  One
could argue that this is a plus, not a minus, as it
separates what is provided by the advice.  I think this
is a loss, but I can see that it could be good for each
behavior (integrated or separate) to be possible.
Unfortunately, we only have the separate-display (link)
behavior, not the integrated-doc behavior.

There's one such link for each bit of advice for the
function, and there's no indication that any given bit
of advice provides more doc.

E.g. In my setup command `dired' has two bits of advice,
and this is (the start of) what `C-h f dired' shows:

,----
| dired is an interactive autoloaded compiled Lisp function in
| 'dired.el'.
| 
| It is bound to C-x d, menu-bar file dired.
| 
| (dired DIRNAME &optional SWITCHES)
| 
| :around advice: 'ad-Advice-dired'
| :around advice: 'ls-lisp--dired'
| 
| "Edit" directory DIRNAME--delete, rename, print, etc. some files in it.
| Optional second argument SWITCHES specifies the `ls' options used.
| (Interactively, use a prefix argument to be able to specify SWITCHES.)
| ...
`----

'ad-Advice-dired' and 'ls-lisp--dired' are help links.

That first bit of advice, named `ad-Advice-dired',
only adds doc to the doc string.  Clicking that link
shows (only) that additional doc.

The second bit of advice adds no doc - it is provided
by vanilla Emacs itself (in ls-lisp.el).  Clicking
that second link shows only this in *Help*:

,----
| ls-lisp--dired is an interactive compiled Lisp function in
| 'ls-lisp.el'.
| 
| (ls-lisp--dired ORIG-FUN DIR-OR-LIST &optional SWITCHES)
`----
___

I thought Emacs has a general policy for its code
not to use advice, but `ls-lisp.el' does use it:

  (advice-add 'dired :around #'ls-lisp--dired)





  reply	other threads:[~2021-06-01 14:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-01  0:07 bug#48768: Introducing ability to append to docstring ludvig-faddeev
2021-06-01  4:53 ` Richard Stallman
2021-06-01 14:08   ` Michael Heerdegen
2021-06-01 14:44     ` Drew Adams [this message]
2021-06-01 15:36 ` Lars Ingebrigtsen
2021-06-01 16:03   ` ludvig-faddeev

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=SA2PR10MB4474183EC2F8F766CA947011F33E9@SA2PR10MB4474.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=48768@debbugs.gnu.org \
    --cc=ludvig-faddeev@gmx.com \
    --cc=michael_heerdegen@web.de \
    --cc=rms@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.