From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Nicolas P. Rougier (inria)" Newsgroups: gmane.emacs.devel Subject: Re: Reading text properties from a yanked text Date: Sun, 27 Nov 2022 08:29:08 +0100 Message-ID: References: <83lenwrkjo.fsf@gnu.org> <83bkosrhxy.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5443"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.8.11; emacs 28.2 Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 27 08:31:36 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ozC8V-0001FM-Sw for ged-emacs-devel@m.gmane-mx.org; Sun, 27 Nov 2022 08:31:35 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozC7q-0002sR-1o; Sun, 27 Nov 2022 02:30:58 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozC7f-0002s8-7U for emacs-devel@gnu.org; Sun, 27 Nov 2022 02:30:46 -0500 Original-Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozC7b-0002gG-3p; Sun, 27 Nov 2022 02:30:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=references:from:to:cc:subject:date:in-reply-to: message-id:mime-version:content-transfer-encoding; bh=jAO0xT78RqZhugsf282thV/K76nR6yidRdz/yQJjzm4=; b=SsUfU7UbARiqoiioZBuCJcDgFpsKmOLoeNv4YFaLgSXUTrkK9uEUM2Xa 7zOOobbIjIeXwZ1ee3VLRVSOsYvUGCu8hKA9IstVSopUIbVC55c15Qs98 22F68yyu8Id9c5aupd5FQ5+5qc/y6kWsqI6ZDFlVfwcONH6EOhlVIvRaN o=; Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=nicolas.rougier@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="5.96,197,1665439200"; d="scan'208";a="40900504" Original-Received: from 91-160-114-139.subs.proxad.net (HELO M-E7-NPR) ([91.160.114.139]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2022 08:30:36 +0100 In-reply-to: <83bkosrhxy.fsf@gnu.org> Received-SPF: pass client-ip=192.134.164.104; envelope-from=nicolas.rougier@inria.fr; helo=mail3-relais-sop.national.inria.fr X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:300618 Archived-At: Eli Zaretskii [2022-11-27 at 09:10] wrote: > Because once again what you pass to text-properties-at is a=20 > different > string. You are confusing how a string looks on display when=20 > inserted into > a buffer with another string that just happens to have the same=20 > text. >=20 > Try this instead: >=20 > (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=20 confusion comes from a more complex code that I'm trying to debug=20 and I stumble on this specific case/confusion. Back to debug then. Nicolas --=20 Nicolas P. Rougier =E2=80=94=E2=80=94 www.labri.fr/perso/nrougier Institute of Neurodegenerative Diseases, Bordeaux