From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Newsgroups: gmane.emacs.bugs Subject: bug#9871: `query-replace' and friends break text properties Date: Mon, 19 Aug 2019 10:43:49 +0200 Message-ID: <8736hx35q2.fsf_-_@gmail.com> References: <87fwig4sss.fsf@gmail.com> <87fwig4sss.fsf@gmail.com> <878srq3ttb.fsf@mouse.gnus.org> <878srq3ttb.fsf@mouse.gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="160169"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 9871@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 19 10:45:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hzdHs-000fOy-1M for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Aug 2019 10:45:12 +0200 Original-Received: from localhost ([::1]:46406 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzdHp-0008Ah-Gw for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Aug 2019 04:45:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52624) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzdHj-000899-47 for bug-gnu-emacs@gnu.org; Mon, 19 Aug 2019 04:45:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzdHi-0003Z4-44 for bug-gnu-emacs@gnu.org; Mon, 19 Aug 2019 04:45:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50315) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hzdHi-0003Yv-0T for bug-gnu-emacs@gnu.org; Mon, 19 Aug 2019 04:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hzdHh-0006Xn-Sj for bug-gnu-emacs@gnu.org; Mon, 19 Aug 2019 04:45:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Aug 2019 08:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9871 X-GNU-PR-Package: emacs Original-Received: via spool by 9871-submit@debbugs.gnu.org id=B9871.156620426625097 (code B ref 9871); Mon, 19 Aug 2019 08:45:01 +0000 Original-Received: (at 9871) by debbugs.gnu.org; 19 Aug 2019 08:44:26 +0000 Original-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 Original-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 Original-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) Original-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) 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)") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:165375 Archived-At: 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