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: Nicolas P. Rougier (inria)
Subject: Re: Reading text properties from a yanked text
Date: Sun, 27 Nov 2022 08:29:08 +0100
User-agent: mu4e 1.8.11; emacs 28.2


Eli Zaretskii [2022-11-27 at 09:10] wrote:
Because once again what you pass to text-properties-at is a different string. You are confusing how a string looks on display when inserted into a buffer with another string that just happens to have the same text.

Try this instead:

(with-temp-buffer
  (insert (propertize "Hello" 'face 'bold))
  (kill-region (point-min) (point-max))
  (insert (format "(text-properties-at 0 \"%s\")"
                  (current-kill 0)))
  (text-properties-at 0 (buffer-substring 24 29)))


Thanks to all of you. I think I'm understanding it now. My confusion comes from a more complex code that I'm trying to debug and I stumble on this specific case/confusion. Back to debug then.

Nicolas

--
Nicolas P. Rougier —— www.labri.fr/perso/nrougier
Institute of Neurodegenerative Diseases, Bordeaux



reply via email to

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