Hi,
I don't see how it's specific to propetize. I can attach face differently,
for
(setq my-test-string "hello")
"hello"
(add-text-properties 0 5 '(face (:inherit (:foreground "orange")))
my-test-string)
nil
my-test-string
#("hello" 0 5 (face (:inherit (:foreground "orange"))))
;; insert it and you'll get orange text
(setq my-test-string "hello")
"hello"
(add-text-properties 0 5 '(face (:foreground "red" :inherit
(:foreground "orange"))) my-test-string)
nil
my-test-string
#("hello" 0 5 (face (:foreground "red" :inherit (:foreground "orange"))))
;; insert it and you'll get orange text
(setq my-test-string "hello")
"hello"
(add-text-properties 0 5 '(face (:inherit (:foreground "orange")
:foreground "red" )) my-test-string)
nil
my-test-string
#("hello" 0 5 (face (:inherit (:foreground "orange") :foreground "red")))
;; insert it and you'll get red text
(setq my-test-string "hello")
"hello"
(add-text-properties 0 5 '(face ((:foreground "red") (:inherit
(:foreground "orange")))) my-test-string)
nil
my-test-string
#("hello" 0 5 (face ((:foreground "red") (:inherit ...))))
;; insert it and you'll get red text
(setq my-test-string "hello")
"hello"
(add-text-properties 0 5 '(face ((:inherit (:foreground "orange"))
(:foreground "red"))) my-test-string)
nil
my-test-string
#("hello" 0 5 (face ((:inherit ...) (:foreground "red"))))
;; insert it and you'll get orange text
(setq my-test-string "hello")
"hello"
(add-face-text-property 0 5 '( :foreground "red" :inherit (:foreground
"orange")) nil my-test-string)
nil
my-test-string
#("hello" 0 5 (face (:foreground "red" :inherit (:foreground "orange"))))
;; insert it and you'll get orange text
(setq my-test-string "hello")
"hello"
(add-face-text-property 0 5 '(:inherit (:foreground "orange")
:foreground "red") nil my-test-string)
nil
my-test-string
#("hello" 0 5 (face (:inherit (:foreground "orange") :foreground "red")))
;; insert it and you'll get red text
As you can see, it's a matter of properties. No matter how you add them,
using
propertize, add-text-properties or add-face-text-property.
Date: Wed, 28 Nov 2018 21:01:36 +0100
It would be helpful to know from precisely which part of the
(insert (propertize "hello" 'face '(:foreground "red" :inherit
(:foreground "orange"))))
(insert (propertize "hello" 'face '(:inherit (:foreground "orange")
:foreground "red")))
displays "hello" in red.
So this is only about what propertize does? And only when some of the
later properties override earlier ones?
I don't see how it follows from the passage in the Lisp manual I
cited ("Faces occurring earlier in the list have higher priority")
It doesn't, because what you cited is not related to propertize, it's
related to how we process faces that come from several different
sources that affect the same piece of text.
--
Cheers,
Boris