From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#22101: Emacs-25: inaccuracy in documentation of `mapconcat' in .../lispref/functions.texi Date: Sun, 6 Dec 2015 21:41:42 +0000 Message-ID: <20151206214142.GA2703@acm.fritz.box> References: <20151206102622.GA2113@acm.fritz.box> <83vb8bef6p.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1449438023 3320 80.91.229.3 (6 Dec 2015 21:40:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 6 Dec 2015 21:40:23 +0000 (UTC) Cc: 22101@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Dec 06 22:40:12 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1a5h2R-0000la-Sx for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Dec 2015 22:40:12 +0100 Original-Received: from localhost ([::1]:51381 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5h2R-0005kd-3V for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Dec 2015 16:40:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56291) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5h2N-0005jN-5i for bug-gnu-emacs@gnu.org; Sun, 06 Dec 2015 16:40:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a5h2J-0002NC-Un for bug-gnu-emacs@gnu.org; Sun, 06 Dec 2015 16:40:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51338) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5h2J-0002N8-Qu for bug-gnu-emacs@gnu.org; Sun, 06 Dec 2015 16:40:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1a5h2J-0002If-2P for bug-gnu-emacs@gnu.org; Sun, 06 Dec 2015 16:40:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Dec 2015 21:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22101 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22101-submit@debbugs.gnu.org id=B22101.14494379788805 (code B ref 22101); Sun, 06 Dec 2015 21:40:02 +0000 Original-Received: (at 22101) by debbugs.gnu.org; 6 Dec 2015 21:39:38 +0000 Original-Received: from localhost ([127.0.0.1]:41046 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a5h1u-0002Hv-7m for submit@debbugs.gnu.org; Sun, 06 Dec 2015 16:39:38 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:55062) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a5h1r-0002Hm-Qw for 22101@debbugs.gnu.org; Sun, 06 Dec 2015 16:39:36 -0500 Original-Received: (qmail 54672 invoked by uid 3782); 6 Dec 2015 21:39:34 -0000 Original-Received: from acm.muc.de (p579E9725.dip0.t-ipconnect.de [87.158.151.37]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 06 Dec 2015 22:39:33 +0100 Original-Received: (qmail 2793 invoked by uid 1000); 6 Dec 2015 21:41:42 -0000 Content-Disposition: inline In-Reply-To: <83vb8bef6p.fsf@gnu.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:109696 Archived-At: Hello, Eli. On Sun, Dec 06, 2015 at 06:04:46PM +0200, Eli Zaretskii wrote: > > Date: Sun, 6 Dec 2015 10:26:22 +0000 > > From: Alan Mackenzie [ .... ] > > diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi > > index 8835667..1b949f2 100644 > > --- a/doc/lispref/functions.texi > > +++ b/doc/lispref/functions.texi > > @@ -861,13 +861,15 @@ Mapping Functions > > @defun mapconcat function sequence separator > > @code{mapconcat} applies @var{function} to each element of > > -@var{sequence}: the results, which must be strings, are concatenated. > > -Between each pair of result strings, @code{mapconcat} inserts the string > > +@var{sequence}: the results, which must be sequences, are > > +concatenated. These result sequences are usually strings, but may > > +also be lists of numbers or vectors of numbers. Between each pair of > > +result sequences, @code{mapconcat} inserts the sequence > > @var{separator}. Usually @var{separator} contains a space or comma or > > other suitable punctuation. > IMO, this errs on the other side: it seems to allow sequences that > will be rejected by mapconcat or by concat that it calls. I suggest > the following alternative wording: > @code{mapconcat} applies @var{function} to each element of > @var{sequence}; the results, which must be sequences of characters > (strings, vectors, or lists), are concatenated into a single string > return value. Between each pair of result sequences, > @code{mapconcat} inserts the characters from @var{separator}, which > also must be a string, or a vector or list of characters. > The argument @var{function} must be a function that can take one > argument and return a sequence of characters: a string, a vector, or > a list. The argument @var{sequence} can be any kind of sequence > except a char-table; that is, a list, a vector, a bool-vector, or a > string. > WDYT? I like very much the way the omission of a comma in "or a vector or list of characters" attaches the "of characters" to both "vector" and "list". :-) I have an uneasy feeling that the two paragraphs might be a bit dense for a newish Lisp programmer, who's just come across `mapconcat' for the first time, and needs to know what it does. I have an urge to insert a "(@pxref{Sequence Type})" somewhere, but can't really see where - maybe right at the end - or maybe at the end of the first paragraph. The problem is "string" is concrete and means what it means, but "sequence" is a rather vague sounding abstract word (even though Emacs gives it a precise meaning). Yes, I think "(@pxref{Sequence Type}) should be inserted at the end of the first paragraph. What do you think of that? -- Alan Mackenzie (Nuremberg, Germany).