Subject: Re: [PATCH] Clarify that mapconcat's FUNCTION can return nil

From: Hong Xu <[email-masked]>
Date: Wed, 12 Feb 2025 14:31:31 -0800

On 2025-02-12 Wed 14:27 GMT-08, Hong Xu <[email-masked]> wrote:

> * src/fns.c (Fmapconcat): Explain that FUNCTION can return nil.
> ---
>  src/fns.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/src/fns.c b/src/fns.c
> index bee44b222c5e..f02a1b6838da 100644
> --- a/src/fns.c
> +++ b/src/fns.c
> @@ -3400,9 +3400,11 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string.
>  Optional argument SEPARATOR must be a string, a vector, or a list of
>  characters; nil stands for the empty string.
>  
> -FUNCTION must be a function of one argument, and must return a value
> + FUNCTION must be a function of one argument, and must return either:

For some reason there is an extra space here. I've corrected this with
the attached patch.

>From 42b5c39abd1765efc286178d041c57623d722d0d Mon Sep 17 00:00:00 2001
From: Hong Xu <[email-masked]>
Date: Wed, 12 Feb 2025 14:25:34 -0800
Subject: [PATCH v2] Clarify that mapconcat's FUNCTION can return nil

* src/fns.c (Fmapconcat): Explain that FUNCTION can return nil.
---
 src/fns.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/fns.c b/src/fns.c
index bee44b222c5e..fc7039c1592b 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -3400,9 +3400,11 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string.
 Optional argument SEPARATOR must be a string, a vector, or a list of
 characters; nil stands for the empty string.
 
-FUNCTION must be a function of one argument, and must return a value
-  that is a sequence of characters: either a string, or a vector or
-  list of numbers that are valid character codepoints.  */)
+FUNCTION must be a function of one argument, and must return either:
+
+  nil, which is treated as an empty string, or
+  a value that is a sequence of characters, which is either a string,
+  or a vector or list of numbers that are valid character codepoints. */)
   (Lisp_Object function, Lisp_Object sequence, Lisp_Object separator)
 {
   USE_SAFE_ALLOCA;
-- 
2.48.1

-- 
Hong