unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Alex Branham <alex.branham@gmail.com>, Marcin Borkowski <mbork@mbork.pl>
Cc: 21074@debbugs.gnu.org
Subject: bug#21074: [PATCH] Add docs for two tabulated-list functions
Date: Sat, 19 Jan 2019 10:25:13 +0200	[thread overview]
Message-ID: <83k1j1awba.fsf@gnu.org> (raw)
In-Reply-To: <87zhs1hfo7.fsf@gmail.com> (message from Alex Branham on Tue, 15 Jan 2019 13:41:28 -0600)

> From: Alex Branham <alex.branham@gmail.com>
> Cc: 21074@debbugs.gnu.org
> Date: Tue, 15 Jan 2019 13:41:28 -0600
> 
> On Tue 15 Jan 2019 at 13:06, Eli Zaretskii <eliz@gnu.org> wrote:
> 
> >> From: Alex Branham <alex.branham@gmail.com>
> >> Date: Tue, 15 Jan 2019 12:19:13 -0600
> >>
> >> This patch adds documentation for tabulated-list-get-{id, entry} to
> >> doc/lispref/modes.texi.
> >
> > Thanks, but what is the rationale for adding these two, specifically?
> 
> I was surprised to see they weren't in there the other day when I was
> playing around with tabulated-list-mode. "How do I get the ID of the
> entry at point" is a pretty common question, I'd guess. Since I saw this
> bug on the bug tracker today I figured I'd submit a patch. If it doesn't
> belong in the manual feel free to ignore the patch (but then this bug
> should probably be closed).

Ah, I wasn't aware there was a previous context for this bug.  (Please
in the future say something to put things in their context, otherwise
one needs to deduce from the bug number that it might have been
discussed previously, and go look up that discussion.  I usually just
ignore the bug number.)

After looking into this for some time, I think we should document
functions of tabulated-mode that are frequently used by its clients,
of which there are some in the Emacs tree.  The above 2 functions
aren't the only ones undocumented in the manual.  So either we
document them all, or we'd need more serious rationale for documenting
just those 2.  Would you like to see what other tabulated-mode
functions are candidates for addition to the manual?

In any case, a few minor comments for the patch:

> +@defun tabulated-list-get-id &optional pos

In the code, this is a defsubst, not a defun.

> +This function returns the entry ID of the entry at @var{pos},
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Just "... returns the ID of the entry" is more clear and concise.

> +                                                               which
> +defaults to point if omitted or @code{nil}.

This "which" makes the text ambiguous: it could refer to the ID or to
POS.  So I suggest to write a separate sentence:

  If omitted or @code{nil}, @var{pos} defaults to position of point.

> +                                             This will be an ID object
> +from @var{tabulated-list-entries}.

An element of tabulated-list-entries could be a function, and what
does this return in that case?  This should be spelled out in the
manual, otherwise the reader will be left out wondering.

> +@defun tabulated-list-get-entry &optional pos
> +This function returns the entry at @var{pos}, which defaults to point
> +if omitted or @code{nil}.  This will be a vector for the ID at
> +@var{pos} from @var{tabulated-list-entries}

This is not detailed enough.  E.g., it says nothing about what will be
the elements of the vector.  The doc string is more detailed, but it
is too terse, and the manual should expand on that.  The description
should also make clear what happens if the corresponding element of
tabulated-list-entries is a function.

> +                                            . If there is no entry at
                                               ^^
Two spaces between sentences, please.

Thanks.





  reply	other threads:[~2019-01-19  8:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-16  9:05 bug#21074: 25.0.50; Incomplete docs for tabulated-list-mode Marcin Borkowski
2019-01-15 18:19 ` bug#21074: [PATCH] Add docs for two tabulated-list functions Alex Branham
2019-01-15 19:06   ` Eli Zaretskii
2019-01-15 19:41     ` Alex Branham
2019-01-19  8:25       ` Eli Zaretskii [this message]
2019-01-21 16:12         ` Alex Branham
2019-01-21 16:32           ` Eli Zaretskii
2019-01-22 21:03         ` Alex Branham
2019-02-01  9:28           ` Eli Zaretskii
2019-02-02 16:03             ` Alex Branham
2019-02-02 16:33               ` Eli Zaretskii
2019-02-02 17:28                 ` Alex Branham
2019-02-02 18:06                   ` Eli Zaretskii
2019-02-05 20:08                     ` Alex Branham
2019-02-05 20:26                       ` Eli Zaretskii
2019-02-05 20:50                         ` Alex Branham
2019-02-06  3:32                           ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83k1j1awba.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=21074@debbugs.gnu.org \
    --cc=alex.branham@gmail.com \
    --cc=mbork@mbork.pl \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).