all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: npostavs@users.sourceforge.net
To: Sebastien Chapuis <sebastien@chapu.is>
Cc: 27433@debbugs.gnu.org
Subject: bug#27433: 25.2; add-face-text-property with APPEND to t mess up with initialized list
Date: Sat, 24 Jun 2017 11:50:56 -0400	[thread overview]
Message-ID: <87wp81peov.fsf@users.sourceforge.net> (raw)
In-Reply-To: <87h8zagwxy.fsf@chapu.is> (Sebastien Chapuis's message of "Wed, 21 Jun 2017 05:40:09 +0800")

retitle 27433 add-face-text-property with APPEND=t destructively modifies the original property list
severity 27433 minor
quit

Sebastien Chapuis <sebastien@chapu.is> writes:

> Hello, I have found a bug reproducible with emacs -Q (tested with
> emacs 25.2.2 and 25.2.1)
>
> I made a small use case that you can find here:
> - https://gist.github.com/sebastiencs/3b1f33a028d2b8d1ee41c44f5338f8e7
> or here:
> - http://paste.lisp.org/display/349159
>
> I provided explainations in the code.
> When I use edebug, the variable 'list-attributes' in the function
> 'my-icons-in-terminal' is directly set to (:family "icons-in-terminal
> (:background "red") (:background "red") ...), even if it is initialized
> with '(:family "icons-in-terminal).

> ;; If I initialize the variable list-attributes to (list :family "...") instead of '(:family) in my-icons-in-terminal,
> ;;   it doesn't appear.

I think we can fix it by using append instead of nonc, or perhaps we
should just document the side effect?

---   i/src/textprop.c
+++   w/src/textprop.c
@@ -421,7 +421,7 @@ add_properties (Lisp_Object plist, INTERVAL i, Lisp_Object object,
 		if (set_type == TEXT_PROPERTY_PREPEND)
 		  Fsetcar (this_cdr, Fcons (val1, Fcar (this_cdr)));
 		else
-		  nconc2 (Fcar (this_cdr), list1 (val1));
+                  Fsetcar (this_cdr, CALLN (Fappend, Fcar (this_cdr), list1 (val1)));
 	      else {
 		/* The previous value is a single value, so make it
 		   into a list. */





      reply	other threads:[~2017-06-24 15:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-20 21:40 bug#27433: 25.2; add-face-text-property with APPEND to t mess up with initialized list Sebastien Chapuis
2017-06-24 15:50 ` npostavs [this message]

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=87wp81peov.fsf@users.sourceforge.net \
    --to=npostavs@users.sourceforge.net \
    --cc=27433@debbugs.gnu.org \
    --cc=sebastien@chapu.is \
    /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.