aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorStefan Kangas2021-10-05 15:36:31 +0200
committerStefan Kangas2021-10-05 15:38:38 +0200
commitd652efcd087099c71cd76c4bbf2bbf04314844b4 (patch)
tree828ea43e01d213d00ec2832d7c877d246f9328e6 /doc
parent4bf532ee82473740cfd43c66ecbfe6cfddf99df9 (diff)
downloademacs-d652efcd087099c71cd76c4bbf2bbf04314844b4.tar.gz
emacs-d652efcd087099c71cd76c4bbf2bbf04314844b4.zip
Make 'mapconcat' argument 'separator' optional
* src/fns.c (Fmapconcat): Make third 'separator' argument optional. (Bug#50965) * doc/lispref/functions.texi (Mapping Functions): Update documentation for above change. * test/src/fns-tests.el (fns-tests-mapconcat): New test. * doc/misc/cl.texi (Obsolete Setf Customization): Don't use third mapconcat argument in example. * lisp/emacs-lisp/subr-x.el (string-join): Doc fix.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/functions.texi9
-rw-r--r--doc/misc/cl.texi2
2 files changed, 5 insertions, 6 deletions
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi
index c856557c3cb..3163300184a 100644
--- a/doc/lispref/functions.texi
+++ b/doc/lispref/functions.texi
@@ -961,14 +961,14 @@ side-effects only---the values it returns are ignored, not collected
961into a list. @code{mapc} always returns @var{sequence}. 961into a list. @code{mapc} always returns @var{sequence}.
962@end defun 962@end defun
963 963
964@defun mapconcat function sequence separator 964@defun mapconcat function sequence &optional separator
965@code{mapconcat} applies @var{function} to each element of 965@code{mapconcat} applies @var{function} to each element of
966@var{sequence}; the results, which must be sequences of characters 966@var{sequence}; the results, which must be sequences of characters
967(strings, vectors, or lists), are concatenated into a single string 967(strings, vectors, or lists), are concatenated into a single string
968return value. Between each pair of result sequences, @code{mapconcat} 968return value. Between each pair of result sequences, @code{mapconcat}
969inserts the characters from @var{separator}, which also must be a 969inserts the characters from @var{separator}, which also must be a
970string, or a vector or list of characters. @xref{Sequences Arrays 970string, or a vector or list of characters; a @code{nil} value is
971Vectors}. 971treated as the empty string. @xref{Sequences Arrays Vectors}.
972 972
973The argument @var{function} must be a function that can take one 973The argument @var{function} must be a function that can take one
974argument and returns a sequence of characters: a string, a vector, or 974argument and returns a sequence of characters: a string, a vector, or
@@ -986,8 +986,7 @@ string.
986 986
987@group 987@group
988(mapconcat (lambda (x) (format "%c" (1+ x))) 988(mapconcat (lambda (x) (format "%c" (1+ x)))
989 "HAL-8000" 989 "HAL-8000")
990 "")
991 @result{} "IBM.9111" 990 @result{} "IBM.9111"
992@end group 991@end group
993@end example 992@end example
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi
index 1e5d40b0377..04e2c71a2b9 100644
--- a/doc/misc/cl.texi
+++ b/doc/misc/cl.texi
@@ -5030,7 +5030,7 @@ The above @code{incf} example could be written using
5030@ignore 5030@ignore
5031(defmacro concatf (place &rest args) 5031(defmacro concatf (place &rest args)
5032 (gv-letplace (getter setter) place 5032 (gv-letplace (getter setter) place
5033 (macroexp-let2 nil v (mapconcat 'identity args "") 5033 (macroexp-let2 nil v (mapconcat 'identity args)
5034 (funcall setter `(concat ,getter ,v))))) 5034 (funcall setter `(concat ,getter ,v)))))
5035@end ignore 5035@end ignore
5036@end defmac 5036@end defmac