From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: PENG Kevin Newsgroups: gmane.emacs.bugs Subject: bug#73663: 29.4; indirect-buffer behaviour is not correct Date: Wed, 09 Oct 2024 13:23:23 +0800 Message-ID: <87set53j56.fsf@gmail.com> References: <877cal44fe.fsf@gmail.com> <861q0turor.fsf@gnu.org> <87zfng2cdt.fsf@gmail.com> <877cajbka9.fsf@web.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34354"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.10.8; emacs 29.4 Cc: Eli Zaretskii , 73663@debbugs.gnu.org, Stefan Monnier To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 09 08:08:08 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1syPrk-0008m5-2x for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 09 Oct 2024 08:08:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syPrX-0001MT-1z; Wed, 09 Oct 2024 02:07:55 -0400 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 1syPrV-0001ML-Nm for bug-gnu-emacs@gnu.org; Wed, 09 Oct 2024 02:07:53 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1syPrV-0006x0-FR for bug-gnu-emacs@gnu.org; Wed, 09 Oct 2024 02:07:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:In-reply-to:Date:From:References:To:Subject; bh=BfQBtRdz7pe/Wo08JBIHaSjcosSrN9qvqDX5dqZh8uA=; b=Fbh4b0Qt0SV5G0/Cwe3xk4/pwBPF32R6qQO3jLBakzccy9NuGxVOcoFateSemPwNzPnfG4AUTQiGacyRJBZzG9O1aKslkcyqzlbGo3rk9ObN1QHzgFGLR4uoo29JE28cgJDVGjQDbuR1b29YwvqzPjeEHgwjuPKouM1KgKCv25CBkAaKIAPv2gG84WUmFbIJmDl1iJ09xV/H7DtV1gv92tO06AZ0iQ24ywaAD+5jqd2mZEmNatFt2tTK6rWPmGAl449rvzaeg88B43JyHXSYL1W20/4FTUeoFUEmaiDd3BLd1XFtuQ5eyCFNKcSGFcT7cjkiv34nmIjs0pEEQM86eg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1syPre-0001Vy-Hb for bug-gnu-emacs@gnu.org; Wed, 09 Oct 2024 02:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: PENG Kevin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 09 Oct 2024 06:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73663 X-GNU-PR-Package: emacs Original-Received: via spool by 73663-submit@debbugs.gnu.org id=B73663.17284540555785 (code B ref 73663); Wed, 09 Oct 2024 06:08:02 +0000 Original-Received: (at 73663) by debbugs.gnu.org; 9 Oct 2024 06:07:35 +0000 Original-Received: from localhost ([127.0.0.1]:55389 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1syPrD-0001VF-0s for submit@debbugs.gnu.org; Wed, 09 Oct 2024 02:07:35 -0400 Original-Received: from mail-pf1-f178.google.com ([209.85.210.178]:52344) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1syPrA-0001V1-SY for 73663@debbugs.gnu.org; Wed, 09 Oct 2024 02:07:33 -0400 Original-Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-71e050190ddso2117913b3a.0 for <73663@debbugs.gnu.org>; Tue, 08 Oct 2024 23:07:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728453977; x=1729058777; darn=debbugs.gnu.org; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:from:to:cc:subject:date:message-id:reply-to; bh=BfQBtRdz7pe/Wo08JBIHaSjcosSrN9qvqDX5dqZh8uA=; b=Km8WNuvC8hjzgXwvP5ibSsqUV76Ekl9yZV5g0okICKccW98f3PdyoTYW3yXRvb6hFH YhKP9cn+5t0wlKs575tNp3YG/CdaPwj274COt4s24Yv69uo4LJ0dlIkKzyNLQJV9k/hQ UaYZ5yDpaFqGGOiOiyxDDBjAH1HvqLDV/pHJP0hGWCH+u2t7nqSocH3dyWwrmcLepOXQ TEnOyl1W5a6cAWbRh6yl16qiJlcGBvMhZR5ij5907Pa09GJLqMZqzm1nw5KPsfs9pHJQ DZ6Ee1w8a0+f8shosln/ZAMvJZ7bE5GXCY7sw9XVDQHuETkI83kYcxlz6tRbzWFizwga 1C7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728453977; x=1729058777; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=BfQBtRdz7pe/Wo08JBIHaSjcosSrN9qvqDX5dqZh8uA=; b=ErLzBJDx2A4fNvoTEZmDnK+TPQnCZ2ks9PQDlBBQS4ATcWPAFvG5AQrdWghF8H4Cwt n54kThKdIOimmWK8eCtlcBbrXWZehsHZvmhkgbdOUWBulVwpnLRFr+70+JC6b4Pq9tvK RnTrAq5LfZcWWyOJp3KNIJkSl92wqqYsZf+lCk997Ii95v0Se69MI6e+fUxFwhuijkjZ dz+3lhrz6FIBjLiap7rZEVH0sYlnMi3B5x6nepzPVZhXf3B6aE+aVrIFfxAHgvqRcZwi 1EpGbOcblQKGOHkhF63/axPOQGWKWKw9Cslv2q/aIDEtovCw1ZyW22s1JGgbLLaoCwbe A3ew== X-Forwarded-Encrypted: i=1; AJvYcCWFwbk542P/GY3R431Th4rbMsg42fSbHqqaKhde+Nie5iyeAAK8wT3GctgXY3I0XYA1NNopDA==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yw82kYy/j73En0p50V6bq8pearliVK4MkBBPQBI9q8FzLkLt+ju +qQaPR0O7oN2wfSEWiyUuubjzvnybNFhcJRRS5kKYVnJclQu/uKg X-Google-Smtp-Source: AGHT+IF3LzmkX2xBZLFwWP7q6lUE+oomM/e+WmavvByHw13UdTuLu6eeuaQQta0De6oCi1Gq3KoakA== X-Received: by 2002:a05:6a00:1894:b0:71e:66b:c7eb with SMTP id d2e1a72fcca58-71e1dbc9dc4mr2354995b3a.23.1728453977288; Tue, 08 Oct 2024 23:06:17 -0700 (PDT) Original-Received: from localhost ([156.59.13.4]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71df0ccd1e6sm7076410b3a.61.2024.10.08.23.06.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2024 23:06:16 -0700 (PDT) In-reply-to: <877cajbka9.fsf@web.de> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:293187 Archived-At: --=-=-= Content-Type: multipart/alternative; boundary="==-=-=" --==-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ok, i got a mistake to use indirect buffer in this way. The text properties of base buffer are shared with indirect buffers. Due to svg in emacs is not fully support, i have implemented this by using =3Dimpatient-mode=3D with web-browser, when the svg file modified = the preview will be changed at the same time. Michael Heerdegen writes: > PENG Kevin writes: > > [+] >> The text of the indirect buffer is always identical to the text of its >> base buffer; changes made by editing either one are visible >> immediately in the other. =E2=80=9CText=E2=80=9D here includes both the = characters and >> their text properties. > > `image-mode' uses text properties to display the image! Most major > modes use text properties to font-lock the buffer and change the way how > its contents are displayed. > > Use cases of indirect buffers are limited, maybe we need to warn more > explicitly that their usefulness is very restricted. IIRC, having > indirect and base buffer using different major modes is something that > was never supported. > > From the past discussions about the matter I also recall that the > limitations are lying in the concept and we can't do much here without a > reimplementation of the idea. > > So I would suggest to rather think about how to get what you want > without using indirect buffers. > > > Michael. --==-=-= Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

Ok, i got a mistake to use indirect buffer in this way. The text properties of base buffer are shared with indirect buffers.

Due to svg in emacs is not fully support, i have implemented this by using impatient-mode with web-browser, when the svg file mo= dified the preview will be changed at the same time.

Michael Heerdegen <michaelheerdegen@web.de> writes:

PENG Kevin <kevin.remegame@gmail.com> writes:

[+]
The text of the indirect buffer is always identical to the text of its base buffer; changes made by editing either one are visible immediately in the other. =E2=80=9CText=E2=80=9D here includes both the cha= racters and their text properties.

`image-mode' uses text properties to display the image! Most major modes use text properties to font-lock the buffer and change the way how its contents are displayed.

Use cases of indirect buffers are limited, maybe we need to warn more explicitly that their usefulness is very restricted. IIRC, having indirect and base buffer using different major modes is something that was never supported.

From the past discussions about the matter I also recall that the limitations are lying in the concept and we can't do much here without a reimplementation of the idea.

So I would suggest to rather think about how to get what you want without using indirect buffers.

Michael.

--==-=-=-- --=-=-= Content-Type: text/plain -- Best Regards. --=-=-=--