Subject: bug#47391: 27.2; static list return from function and nconc

From: Gregory Heytings <[email-masked]>
Date: Thu, 25 Mar 2021 15:55:37 +0000

>
> (defun fn () '(1 2))
>
> (nconc (fn) '(3))
> -> (1 2 3)
>
> (nconc (fn) '(3))
> -> (1 2 3 3) ? should be (1 2 3)
>

Why do you think this is a bug?  The docstring of "nconc" says: 
"Concatenate any number of lists by _altering_ them.  Only the last 
argument is not altered, and need not be a list."  (append (fn) '(3)) 
always returns (1 2 3).

>
> If this is not a bug, then hfy-invisible, hfy-face-to-style-i may need 
> to be fixed.
>

Does the attached patch fix the bug you see?

From 268e15ea8d94d4e258d576408b6026bbc5e1fda3 Mon Sep 17 00:00:00 2001
From: Gregory Heytings <[email-masked]>
Date: Thu, 25 Mar 2021 15:51:05 +0000
Subject: [PATCH 2/2] * lisp/htmlfontify.el (hfy-invisible): Return a new list
 at each invocation (bug#47391)

---
 lisp/htmlfontify.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el
index bfbe0ee165..cd7df5dfdf 100644
--- a/lisp/htmlfontify.el
+++ b/lisp/htmlfontify.el
@@ -822,7 +822,7 @@ VAL is ignored."
   "This text should be invisible.
 Do something in CSS to make that happen.
 VAL is ignored here."
-  '(("display" . "none")))
+  (list '("display" . "none")))
 
 (defun hfy-combined-face-spec (face)
   "Return a `defface' style alist of possible specifications for FACE.
-- 
2.30.2