From unknown Sat Jun 21 12:10:05 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#9871 <9871@debbugs.gnu.org> To: bug#9871 <9871@debbugs.gnu.org> Subject: Status: `query-replace' and friends break text properties Reply-To: bug#9871 <9871@debbugs.gnu.org> Date: Sat, 21 Jun 2025 19:10:05 +0000 retitle 9871 `query-replace' and friends break text properties reassign 9871 emacs submitter 9871 =C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec severity 9871 normal tag 9871 wontfix thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 25 18:28:11 2011 Received: (at submit) by debbugs.gnu.org; 25 Oct 2011 22:28:11 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RIpTf-0007yp-6y for submit@debbugs.gnu.org; Tue, 25 Oct 2011 18:28:11 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RIpTd-0007ye-I1 for submit@debbugs.gnu.org; Tue, 25 Oct 2011 18:28:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RIpRw-0003sb-2s for submit@debbugs.gnu.org; Tue, 25 Oct 2011 18:26:25 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:48721) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIpRw-0003sX-1M for submit@debbugs.gnu.org; Tue, 25 Oct 2011 18:26:24 -0400 Received: from eggs.gnu.org ([140.186.70.92]:50922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIpRv-0001kF-5w for bug-gnu-emacs@gnu.org; Tue, 25 Oct 2011 18:26:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RIpRt-0003s2-SQ for bug-gnu-emacs@gnu.org; Tue, 25 Oct 2011 18:26:23 -0400 Received: from mail-fx0-f41.google.com ([209.85.161.41]:39484) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIpRt-0003rs-Hh for bug-gnu-emacs@gnu.org; Tue, 25 Oct 2011 18:26:21 -0400 Received: by faat2 with SMTP id t2so1332551faa.0 for ; Tue, 25 Oct 2011 15:26:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=UUVYpFYs+Pkox8bfPsk1RZI4YHWVeiWxMcHSI+tNZZQ=; b=RfU1PHcGg8lQ5D1VHmRWYfeZ/7r5dd1cRrmuiO9lz9RYNaNOYkK1hSEj+HBs5MBSlz r1S8y3tYtDPI9OIAQ8tAYjIMbxNHOc7h1N1MOEEZrSr1cdVACIHvKNaZg7LOx4cH0pTu 8bm36LE6jaL/EkAC2LaqBiox86Gi/Xrv+Qoqo= Received: by 10.223.63.206 with SMTP id c14mr54098654fai.7.1319581580563; Tue, 25 Oct 2011 15:26:20 -0700 (PDT) Received: from localhost (176.119.broadband10.iol.cz. [90.177.119.176]) by mx.google.com with ESMTPS id 5sm129027fad.9.2011.10.25.15.26.19 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 25 Oct 2011 15:26:20 -0700 (PDT) From: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= To: bug-gnu-emacs Subject: `query-replace' and friends break text properties Date: Wed, 26 Oct 2011 00:20:35 +0200 Message-ID: <87fwig4sss.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -4.9 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.9 (----) emacs -Q (put-text-property (point-min) (point) 'oh-no! t) M-< M-% buffer RET fluffer RET y Whoops, the property's gone in the replaced text. The replacement commands should honour text properties just as `self-insert-command' does. --=20 =C5=A0t=C4=9Bp=C3=A1n From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 18 20:03:38 2019 Received: (at 9871) by debbugs.gnu.org; 19 Aug 2019 00:03:38 +0000 Received: from localhost ([127.0.0.1]:58960 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hzV96-00088C-CI for submit@debbugs.gnu.org; Sun, 18 Aug 2019 20:03:38 -0400 Received: from quimby.gnus.org ([80.91.231.51]:47374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hzV95-000885-1c for 9871@debbugs.gnu.org; Sun, 18 Aug 2019 20:03:35 -0400 Received: from [12.144.191.101] (helo=sandy) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hzV90-0003gb-Mc; Mon, 19 Aug 2019 02:03:33 +0200 From: Lars Ingebrigtsen To: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= Subject: Re: bug#9871: `query-replace' and friends break text properties References: <87fwig4sss.fsf@gmail.com> Date: Sun, 18 Aug 2019 17:03:28 -0700 In-Reply-To: <87fwig4sss.fsf@gmail.com> (=?utf-8?B?IsWgdMSbcMOhbiBOxJtt?= =?utf-8?B?ZWMiJ3M=?= message of "Wed, 26 Oct 2011 00:20:35 +0200") Message-ID: <878srq3ttb.fsf@mouse.gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Štěpán Němec writes: > emacs -Q > (put-text-property (point-min) (point) 'oh-no! t) > M-< > M-% buffer RET fluffer RET y > > Whoops, the property's gone in the replaced text. > > The replacement commands should honour tex [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 9871 Cc: 9871@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) =C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec writes: > emacs -Q > (put-text-property (point-min) (point) 'oh-no! t) > M-< > M-% buffer RET fluffer RET y > > Whoops, the property's gone in the replaced text. > > The replacement commands should honour text properties just as > `self-insert-command' does. I guess the question becomes -- what text properties should be in the result? If you have (with-temp-buffer (insert (propertize "hel" 'face 'bold)) (insert (propertize "lo" 'face 'underline)) (goto-char (point-min)) (replace-regexp "ell" "yes, well") (buffer-string)) should "yes, well" be in bold or underline? Or a mix? I don't really think there's any solution here that will satisfy anybody. But I guess it would make some sense to view this as "delete the text, and then pretend we're inserting text as if by `self-insert-command'", which would make the new text bold here. I don't know... all solutions here seem kinda ad hoc, so perhaps the current behaviour is the least surprising. Any opinions? --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 18 20:57:29 2019 Received: (at 9871) by debbugs.gnu.org; 19 Aug 2019 00:57:29 +0000 Received: from localhost ([127.0.0.1]:58978 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hzVzE-0000uD-QI for submit@debbugs.gnu.org; Sun, 18 Aug 2019 20:57:29 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:55054) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hzVzC-0000tz-ER for 9871@debbugs.gnu.org; Sun, 18 Aug 2019 20:57:27 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x7J0sXuJ095843; Mon, 19 Aug 2019 00:57:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2019-08-05; bh=y6ynorFL9Z3QjG9m6DwoUbKTkrBhnO8Zadg67Apvw/0=; b=Gh/xH5dEes86ArUBffW+aoS5Li9m8/uZaWNT42M8zfdAf4mRlrSgriCj8n+ekrwB3PoN +BJzmwp9q4QTaclb0mjJDFoK6WoJxm2dhmp5OCpUTl5HJujHIrGl9+S5jyabORdk8XQw cdU0O1nEZBOD69U2YgALdHhkKeJkWQyTLXfP/abFJPorHmm2Q77ajeIbUEJOAw6zUYwR ADSqzIIp63CTggAdVHZCdHg4F9o5hs5p/TmEPxY/GlEO+q1jpna/63I9YFXTn5xmbJPa ppy+Hm0OFVeLJj83mXyOkk8DMuYT1VkwhVubNM4QJMdkEnCSKOYyGQmXXixlhxpBeGI2 vw== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 2ue9hp4cg5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Aug 2019 00:57:20 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x7J0rWX4017574; Mon, 19 Aug 2019 00:57:20 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 2uejxdjnjd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Aug 2019 00:57:19 +0000 Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x7J0vJWG027859; Mon, 19 Aug 2019 00:57:19 GMT MIME-Version: 1.0 Message-ID: Date: Sun, 18 Aug 2019 17:57:18 -0700 (PDT) From: Drew Adams To: Lars Ingebrigtsen , =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= Subject: RE: bug#9871: `query-replace' and friends break text properties References: <87fwig4sss.fsf@gmail.com> <878srq3ttb.fsf@mouse.gnus.org> In-Reply-To: <878srq3ttb.fsf@mouse.gnus.org> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4873.0 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9353 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908190006 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9353 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908190007 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 9871 Cc: 9871@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > I guess the question becomes -- what text properties should be in the > result? >=20 > If you have >=20 > (with-temp-buffer > (insert (propertize "hel" 'face 'bold)) > (insert (propertize "lo" 'face 'underline)) > (goto-char (point-min)) > (replace-regexp "ell" "yes, well") > (buffer-string)) >=20 > should "yes, well" be in bold or underline? Or a mix? I don't really > think there's any solution here that will satisfy anybody. >=20 > But I guess it would make some sense to view this as "delete the text, > and then pretend we're inserting text as if by `self-insert-command'", > which would make the new text bold here. >=20 > I don't know... all solutions here seem kinda ad hoc, so perhaps the > current behaviour is the least surprising. Any opinions? I take a slightly different position from both of you, I guess. I'd say that the replacement text should replace the text to replace as if `delete-selection-mode' were turned on and you (1) selected the text to replace and then ` yanked the replacement text from the kill ring to replace it. The text props are copied to the kill-ring as part of the text. And yanking the text gives you copies that also have those text properties. Why shouldn't the same behavior be available for query-replace? If a user specifies replacement text that has text properties then it should be used as is: its properties should remain when it takes the place of text in the buffer. E.g. Copy some buffer text that has properties into the kill ring. Then use `M-%' and yank that copied, propertized text as the replacement text. The places where it now appears as replacement should all have the same text properties. But they don't seem to. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 19 04:44:26 2019 Received: (at 9871) by debbugs.gnu.org; 19 Aug 2019 08:44:26 +0000 Received: from localhost ([127.0.0.1]:59136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hzdH8-0006Wj-IO for submit@debbugs.gnu.org; Mon, 19 Aug 2019 04:44:26 -0400 Received: from mail-wr1-f41.google.com ([209.85.221.41]:34035) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hzdH7-0006WX-9k for 9871@debbugs.gnu.org; Mon, 19 Aug 2019 04:44:25 -0400 Received: by mail-wr1-f41.google.com with SMTP id s18so7806554wrn.1 for <9871@debbugs.gnu.org>; Mon, 19 Aug 2019 01:44:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-transfer-encoding; bh=0a3wmFfDaWJv9AlTK/N5dhAbvw4ckp2MyJM488l6xa4=; b=lcM1GTfCD/V/IVHKWvpg+L8P1BvcHY70ViYJ/l8YHHZlsjhGM6JlidHoFnYiux2/51 s02/I5bfjKvesgN3U7+wBTJP2/1DA0MAsw4uYCUF0d31KLwdeSut2pi7NQtqDUTu8GFn sKKxNFgmM5mdnnSlEEYTvauppQjHJjFwxF442aUxSkjTz/cmpaPtT5CahhkU1oDKJC4L dxoHstwIRSk9omyhJvmF7D8VDXEHuseRbxEgfX6q7FV86hTP0aHdmYvpYhmOOveyc99V 7okSntMijqvNaOLa0eVKXYhqCrFaps24ndD3Dv3BOv9Mb9+iJB8Bc6CNbBMgAXB1ENxw sPGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version:content-transfer-encoding; bh=0a3wmFfDaWJv9AlTK/N5dhAbvw4ckp2MyJM488l6xa4=; b=s3nwAlPeYb2iYjyaj6pYEShSqo87cQ9racvcoM6edsYNzMsuMzH0+4tTv37A1rrYQe BtasVY/ouxAFsIC22+A1Od4YMlGdJpUAWvVqUss0BBxSjn7lI2wt9NRJddnpfjSuE6Sj ErJb1fs9CVyGo0q+dTNrImNJTct8SNX/6M5KrYx6VuRnEgq3KkV6bm2zQJdtWkhWTyWW q7l1Vh9zCbUm6p22v0GgwD5gYnCmeTSkkZ5js8RXxsWKT6MwGcED705hU0eX+QO7qfLr wdbxuBa0+y7OteiLIi0LVSylJAIotXRne0Niyve9JDVS8ZCpa9c+oLagSLj1+QM/TXHb /33w== X-Gm-Message-State: APjAAAVa7QKXBtwJiA6dMPWAxpiIgi6ZqQSIKrhuu4VxQtaXnVc4Cg// pwFOw+T+SEdnUHYBXRZ6+Dc= X-Google-Smtp-Source: APXvYqzMZL+q9ZsuDimerqvdicg+JyvheJbk4uMxahkuWwlI68ZLCv/T0ZLuKg+agsLzUWK6Z05xxw== X-Received: by 2002:a5d:6a45:: with SMTP id t5mr18392609wrw.228.1566204259369; Mon, 19 Aug 2019 01:44:19 -0700 (PDT) Received: from localhost ([185.112.167.114]) by smtp.gmail.com with ESMTPSA id 91sm44100053wrp.3.2019.08.19.01.44.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 01:44:18 -0700 (PDT) From: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= To: Lars Ingebrigtsen Subject: Re: bug#9871: `query-replace' and friends break text properties In-Reply-To: <878srq3ttb.fsf@mouse.gnus.org> (Lars Ingebrigtsen's message of "Sun, 18 Aug 2019 17:03:28 -0700, Sun, 18 Aug 2019 17:57:18 -0700 (PDT)") References: <87fwig4sss.fsf@gmail.com> <87fwig4sss.fsf@gmail.com> <878srq3ttb.fsf@mouse.gnus.org> <878srq3ttb.fsf@mouse.gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Date: Mon, 19 Aug 2019 10:43:49 +0200 Message-ID: <8736hx35q2.fsf_-_@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 9871 Cc: 9871@debbugs.gnu.org, Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Sun, 18 Aug 2019 17:03:28 -0700 Lars Ingebrigtsen wrote: > I guess the question becomes -- what text properties should be in the > result? > > If you have > > (with-temp-buffer > (insert (propertize "hel" 'face 'bold)) > (insert (propertize "lo" 'face 'underline)) > (goto-char (point-min)) > (replace-regexp "ell" "yes, well") > (buffer-string)) > > should "yes, well" be in bold or underline? Or a mix? I don't really > think there's any solution here that will satisfy anybody. ^^^^^^^ I assume you meant "everybody". > But I guess it would make some sense to view this as "delete the text, > and then pretend we're inserting text as if by `self-insert-command'", > which would make the new text bold here. Yes it would. I also think that the straightforward case where all the text has the same value for a property will be much more frequent than your contrived example (note my property wasn't even visible at all; in case of font-locking for example I'd expect the result to get refontified as usual anyway). > I don't know... all solutions here seem kinda ad hoc, so perhaps the > current behaviour is the least surprising. Any opinions? I definitely don't consider it the least surprising, but I guess you're rather asking for the opinion of other people. On Sun, 18 Aug 2019 17:57:18 -0700 (PDT) Drew Adams wrote: [...] > If a user specifies replacement text that has > text properties then it should be used as is: > its properties should remain when it takes the > place of text in the buffer. [...] Sure. For the yanking (i.e., interactive) case there's also `yank-handled-properties' and `yank-excluded-properties'. --=20 =C5=A0t=C4=9Bp=C3=A1n From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 19 16:37:20 2019 Received: (at 9871) by debbugs.gnu.org; 19 Aug 2019 20:37:21 +0000 Received: from localhost ([127.0.0.1]:60530 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hzoP2-0001Yl-MS for submit@debbugs.gnu.org; Mon, 19 Aug 2019 16:37:20 -0400 Received: from quimby.gnus.org ([80.91.231.51]:35434) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hzoOz-0001Ya-SX for 9871@debbugs.gnu.org; Mon, 19 Aug 2019 16:37:19 -0400 Received: from [12.144.191.101] (helo=sandy) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hzoOu-0006HZ-3q; Mon, 19 Aug 2019 22:37:14 +0200 From: Lars Ingebrigtsen To: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= Subject: Re: bug#9871: `query-replace' and friends break text properties References: <87fwig4sss.fsf@gmail.com> <87fwig4sss.fsf@gmail.com> <878srq3ttb.fsf@mouse.gnus.org> <878srq3ttb.fsf@mouse.gnus.org> <8736hx35q2.fsf_-_@gmail.com> Date: Mon, 19 Aug 2019 13:37:08 -0700 In-Reply-To: <8736hx35q2.fsf_-_@gmail.com> (=?utf-8?B?IsWgdMSbcMOhbiBOxJtt?= =?utf-8?B?ZWMiJ3M=?= message of "Mon, 19 Aug 2019 10:43:49 +0200") Message-ID: <87k1b828p7.fsf@mouse.gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Štěpán Němec writes: > Yes it would. I also think that the straightforward case where all the > text has the same value for a property will be much more frequent than > your contrived example (note my property wasn't even [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 9871 Cc: 9871@debbugs.gnu.org, Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) =C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec writes: > Yes it would. I also think that the straightforward case where all the > text has the same value for a property will be much more frequent than > your contrived example (note my property wasn't even visible at all; in > case of font-locking for example I'd expect the result to get > refontified as usual anyway). I just used a face because that's visible; the same applies to any text property. Thinking about it a bit more, I don't really feel that delete-then-insert semantics will be very nice as a feature, either. (with-temp-buffer (insert (propertize "hello" 'face 'bold)) (goto-char (point-min)) (replace-regexp "hello" "hey") (buffer-string)) If you replace a phrase that has one face with a different phrase, if text properties are preserved, surely you'd expect that "hey" to also be bold. But it won't be, since the "hello" was deleted first and then "hey" was inserted. So I don't really think there's any way to DWIM here that is "what I mean", and if you want to copy over text properties in one form of another, you have to write some code to express what you want to have happen. So I'm closing this bug report. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 19 16:37:37 2019 Received: (at control) by debbugs.gnu.org; 19 Aug 2019 20:37:37 +0000 Received: from localhost ([127.0.0.1]:60533 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hzoPI-0001ZF-V3 for submit@debbugs.gnu.org; Mon, 19 Aug 2019 16:37:37 -0400 Received: from quimby.gnus.org ([80.91.231.51]:35458) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hzoPH-0001Z8-DK for control@debbugs.gnu.org; Mon, 19 Aug 2019 16:37:35 -0400 Received: from [12.144.191.101] (helo=sandy) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hzoPE-0006Hl-Bb for control@debbugs.gnu.org; Mon, 19 Aug 2019 22:37:34 +0200 Date: Mon, 19 Aug 2019 13:37:30 -0700 Message-Id: <87imqs28ol.fsf@mouse.gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #9871 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 9871 wontfix close 9871 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 9871 wontfix close 9871 quit From unknown Sat Jun 21 12:10:05 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 17 Sep 2019 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator