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 10:26:22 +0000 Message-ID: <20151206102622.GA2113@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1449397525 3798 80.91.229.3 (6 Dec 2015 10:25:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 6 Dec 2015 10:25:25 +0000 (UTC) To: 22101@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Dec 06 11:25: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 1a5WVD-0008PI-EX for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Dec 2015 11:25:11 +0100 Original-Received: from localhost ([::1]:49273 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5WVC-0008Ek-CG for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Dec 2015 05:25:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5WV8-0008Cq-5u for bug-gnu-emacs@gnu.org; Sun, 06 Dec 2015 05:25:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a5WV5-00037v-29 for bug-gnu-emacs@gnu.org; Sun, 06 Dec 2015 05:25:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50628) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5WV4-00037r-VU for bug-gnu-emacs@gnu.org; Sun, 06 Dec 2015 05:25:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1a5WV4-0000t7-LO for bug-gnu-emacs@gnu.org; Sun, 06 Dec 2015 05:25:02 -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 10:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 22101 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14493974833381 (code B ref -1); Sun, 06 Dec 2015 10:25:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Dec 2015 10:24:43 +0000 Original-Received: from localhost ([127.0.0.1]:40336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a5WUk-0000sS-GB for submit@debbugs.gnu.org; Sun, 06 Dec 2015 05:24:42 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:55543) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a5WUQ-0000rz-AP for submit@debbugs.gnu.org; Sun, 06 Dec 2015 05:24:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a5WUO-0002ze-UE for submit@debbugs.gnu.org; Sun, 06 Dec 2015 05:24:22 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:49499) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5WUO-0002zY-Qk for submit@debbugs.gnu.org; Sun, 06 Dec 2015 05:24:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37298) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5WUN-0008AD-La for bug-gnu-emacs@gnu.org; Sun, 06 Dec 2015 05:24:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a5WUK-0002yg-J2 for bug-gnu-emacs@gnu.org; Sun, 06 Dec 2015 05:24:19 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:39815) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5WUK-0002yY-98 for bug-gnu-emacs@gnu.org; Sun, 06 Dec 2015 05:24:16 -0500 Original-Received: (qmail 41762 invoked by uid 3782); 6 Dec 2015 10:24:14 -0000 Original-Received: from acm.muc.de (p548A54DA.dip0.t-ipconnect.de [84.138.84.218]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 06 Dec 2015 11:24:14 +0100 Original-Received: (qmail 2196 invoked by uid 1000); 6 Dec 2015 10:26:22 -0000 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:109687 Archived-At: Hello, Emacs. In the elisp manual, mapconcat is described thusly: `mapconcat' applies FUNCTION to each element of SEQUENCE: the results, which must be strings, are concatenated. Between each ^^^^^^^^^^^^^^^^^^^^^ pair of result strings, `mapconcat' inserts the string SEPARATOR. ^^^^^^^^^^ Usually SEPARATOR contains a space or comma or other suitable punctuation. The results returned by FUNCTION need not be strings; they may be of any sequence type acceptable to `concat'. The same applies to SEPARATOR. Either the code or the documentation is wrong. I strongly believe it's the documentation. Here's a patch to fix it. I will apply this patch to the emacs-25 branch soon, if I don't hear any objections. 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. The argument @var{function} must be a function that can take one -argument and return a string. The argument @var{sequence} can be any +argument and return a sequence. 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. -- Alan Mackenzie (Nuremberg, Germany).