all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: "Kévin Le Gouguec" <kevin.legouguec@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Mixing named and anonymous faces in text properties
Date: Mon, 29 Apr 2019 17:31:05 -0400	[thread overview]
Message-ID: <jwvk1fc4i0a.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87sgu4wul0.fsf@gmail.com> ("Kévin Le Gouguec"'s message of "Fri, 26 Apr 2019 19:21:47 +0200")

> I since took a look at font-lock-prepend-text-property and cooked up the
> attached patch;

Thanks, I installed the slightly simpler version below,


        Stefan


@@ -1392,7 +1392,9 @@ font-lock-prepend-text-property
 Arguments PROP and VALUE specify the property and value to prepend to the value
 already in place.  The resulting property values are always lists.
 Optional argument OBJECT is the string or buffer containing the text."
-  (let ((val (if (listp value) value (list value))) next prev)
+  (let ((val (if (and (listp value) (not (keywordp (car value)))) value
+               (list value)))
+        next prev)
     (while (/= start end)
       (setq next (next-single-property-change start prop object end)
 	    prev (get-text-property start prop object))



  reply	other threads:[~2019-04-29 21:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-25 18:28 Mixing named and anonymous faces in text properties Kévin Le Gouguec
2019-04-26 16:39 ` Stefan Monnier
2019-04-26 17:21 ` Kévin Le Gouguec
2019-04-29 21:31   ` Stefan Monnier [this message]
2019-04-30  6:11     ` Kévin Le Gouguec

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=jwvk1fc4i0a.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=help-gnu-emacs@gnu.org \
    --cc=kevin.legouguec@gmail.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 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.