emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading text properties from a yanked text


From: Gregory Heytings
Subject: Re: Reading text properties from a yanked text
Date: Sat, 26 Nov 2022 23:26:07 +0000



1. I evaluate the line below to get a bold "Hello" and I copy the result in the kill ring.

(insert (propertize "Hello" 'face 'bold))

2. If I try to get the properties of the yanked text, I get nil. However, the text is displayed bold and a (text-properties-at (point)) returns '(face bold) when point is on the H letter.

(text-properties-at 0 "Hello")

3. This version works as expected (but this is not what I need): (text-properties-at 0 (propertize "Hello" 'face 'bold))

Why do I get a nil result in case 2 (using Emacs 28.2) even though the text is displayed bold?


I think I see what you mean (but I'm not sure).

Is your recipe the following one?

emacs -Q
M-x text-mode RET
M-: (insert (propertize "Hello" 'face 'bold)) RET
C-SPC
M-b
M-w
M-: (text-properties-at 0 "<press C-y>") RET

in which you see the text in bold in the minibuffer before pressing RET? (Instead of M-: you could also type (text-properties-at 0 "<press C-y>") followed by C-x C-e somewhere else.)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]