From: Drew Adams <drew.adams@oracle.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 11571@debbugs.gnu.org
Subject: bug#11571: 24.0.97; doc string of `dired-get-subdir-min'
Date: Sun, 9 Feb 2014 14:25:27 -0800 (PST) [thread overview]
Message-ID: <7806d41c-d4e6-45f6-bbca-4abbf0a8ba9e@default> (raw)
In-Reply-To: <871tzdgcmg.fsf@building.gnus.org>
> > Actually, the real bug is that `dired-get-subdir-min' has no doc
> > string, so the doc string of `cdr' is used in its stead. The
> > whole point of defining and using a separate function for this,
> > instead of just coding with `cdr', is to enable readers of the
> > code - and a fortiori the doc - to think in terms of the data
> > structure of directories and not just abstract cons cells. There
> > should be doc at the proper level of abstraction here.
>
> Help says:
>
> ---
> dired-get-subdir-min is an alias for `cdr' in `dired.el'.
> (dired-get-subdir-min LIST)
> Return the cdr of LIST. If arg is nil, return nil.
> Error if arg is not nil and not a cons cell. See also `cdr-safe'.
> ---
>
> I think that's fine.
No, it is not fine. That doc is 100% unrelated to "dired",
"getting" something, "subdir", and "minimum".
If it were fine, then it would be even finer to get rid of this
function, with its supposedly descriptive name, and use just cdr.
If that is the fix you make, fine with me. If you keep the
function then users deserve its doc to explain what it is about.
Clearly, it is not just "about" returning the cdr. The function
is named, presumably, to suggest what it is for: its purpose or
behavior WRT DIRED AND SUBDIRS.
Hard to believe that when someone goes to the trouble of
spelling out in the bug report why better doc is needed here
you cannot read and understand that.
> However:
>
> ;; can't use macro, must be redefinable for other alist format in
> dired-nstd.
> (defalias 'dired-get-subdir-min 'cdr)
>
> Which is kinda er.
>
> I don't know what nstd is, and the function doesn't seem to be
> redefined anywhere, so is this just legacy gunk? Should
> `dired-get-subdir-min' just be replaced by `cdr' in all the
> calling sites?
Yes, that can be the first question, if you want to get into it.
If you do not want to file a separate (code) bug for that, fine.
But if this function is kept then please document it properly.
next prev parent reply other threads:[~2014-02-09 22:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-27 21:37 bug#11571: 24.0.97; doc string of `dired-get-subdir-min' Drew Adams
2012-05-27 21:41 ` Drew Adams
2012-09-16 23:49 ` Drew Adams
2014-02-09 3:59 ` Lars Ingebrigtsen
2014-02-09 22:25 ` Drew Adams [this message]
2019-11-01 18:44 ` Stefan Kangas
2019-11-01 20:54 ` Drew Adams
2019-11-05 15:09 ` Stefan Kangas
2019-11-05 16:21 ` Drew Adams
2019-11-08 13:30 ` Stefan Kangas
2019-11-08 18:04 ` Drew Adams
2019-11-10 21:17 ` Stefan Kangas
2019-11-02 14:51 ` Lars Ingebrigtsen
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=7806d41c-d4e6-45f6-bbca-4abbf0a8ba9e@default \
--to=drew.adams@oracle.com \
--cc=11571@debbugs.gnu.org \
--cc=larsi@gnus.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.