unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Gregory Heytings <gregory@heytings.org>
To: Rajeev Narang <rajeev.jnk@sivalik.com>
Cc: 47391@debbugs.gnu.org, emacs-devel@gnu.org
Subject: Re: bug#47391: 27.2; static list return from function and nconc
Date: Thu, 25 Mar 2021 15:55:37 +0000	[thread overview]
Message-ID: <fa05cc9782e01e96343d@heytings.org> (raw)
In-Reply-To: <87r1k32sir.fsf@hm.sivalik.com>

[-- Attachment #1: Type: text/plain, Size: 489 bytes --]


>
> (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?

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-diff; name=0001-lisp-htmlfontify.el-hfy-invisible-Return-a-new-list-.patch, Size: 837 bytes --]

From 268e15ea8d94d4e258d576408b6026bbc5e1fda3 Mon Sep 17 00:00:00 2001
From: Gregory Heytings <gregory@heytings.org>
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


  parent reply	other threads:[~2021-03-25 15:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-25 14:54 bug#47391: 27.2; static list return from function and nconc Rajeev Narang via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-25 15:28 ` Philipp Stephani
2021-03-25 15:43   ` Stefan Monnier
2021-03-25 15:55 ` Gregory Heytings [this message]
2021-03-25 15:58   ` Stefan Monnier
2021-03-25 16:03     ` Gregory Heytings

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=fa05cc9782e01e96343d@heytings.org \
    --to=gregory@heytings.org \
    --cc=47391@debbugs.gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=rajeev.jnk@sivalik.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).