all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: 22101@debbugs.gnu.org
Subject: bug#22101: Emacs-25: inaccuracy in documentation of `mapconcat' in .../lispref/functions.texi
Date: Sun, 6 Dec 2015 10:26:22 +0000	[thread overview]
Message-ID: <20151206102622.GA2113@acm.fritz.box> (raw)

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).





             reply	other threads:[~2015-12-06 10:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-06 10:26 Alan Mackenzie [this message]
2015-12-06 16:04 ` bug#22101: Emacs-25: inaccuracy in documentation of `mapconcat' in .../lispref/functions.texi Eli Zaretskii
2015-12-06 21:41   ` Alan Mackenzie
2015-12-07 10:54   ` Alan Mackenzie
2015-12-07 15:51     ` 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

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

  git send-email \
    --in-reply-to=20151206102622.GA2113@acm.fritz.box \
    --to=acm@muc.de \
    --cc=22101@debbugs.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.