From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Buffers with buffers (transclusion) Date: Thu, 17 Oct 2024 15:59:10 +0300 Message-ID: <861q0eq40x.fsf@gnu.org> References: <86r08hqvbc.fsf@gnu.org> <8634kvvfah.fsf@gmx.net> <86a5f3p7kk.fsf@gnu.org> <864j5bouz1.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12614"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jimjoe@gmx.net, emacs-devel@gnu.org To: Vladimir Kazanov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Oct 17 15:00:19 2024 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 1t1Q71-00030I-EZ for ged-emacs-devel@m.gmane-mx.org; Thu, 17 Oct 2024 15:00:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t1Q60-0006C9-VE; Thu, 17 Oct 2024 08:59:16 -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 1t1Q5z-00067L-2F for emacs-devel@gnu.org; Thu, 17 Oct 2024 08:59:15 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t1Q5y-0000hC-Eg; Thu, 17 Oct 2024 08:59:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=kacgB1H1D69dKJNhuKae4c7bTtC0wgUuzDR6GKfcJjQ=; b=fV7NibiwSe5+ zW8/JmDpM2FiCwvZXF1P13UEDkYDC1nPwAR/0wqVO4DXzbSmSBxNHvRqE8vittNr1/vsSilK5Vria lVs+Ub1K8lGPYWys2S6T4N6AJlQzenQF5y8/aPqUaUmySA0DnwhdF3K80wuIRYwYq33NglRTSs8Dh UxKdLN6/67XNdYPd6zYcTJVa+UT977qEb5EgNFQcfG8Z88M7qj8YhoT5cd6RWRzR0OBmE2SD7zfBQ 4Fpo5eKB6NNGtszltjaZsWk1/DNhUrAk7UwgkTGMLae40CJe7lD6Lp347TPmMGsEFnfWPgz06f5kJ N3poUphNi1ot1cbhjyfcBQ==; In-Reply-To: (message from Vladimir Kazanov on Thu, 17 Oct 2024 12:38:03 +0100) 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:324624 Archived-At: > From: Vladimir Kazanov > Date: Thu, 17 Oct 2024 12:38:03 +0100 > Cc: jimjoe@gmx.net, emacs-devel@gnu.org > > > With the displays we have nowadays, I'd say even 10 is not a problem, > > and probably more. > > Honestly speaking, I can't imagine a realistic way of manipulating 10 > windows in a uniform way. One way to do that is using the windmove package, see windmove-default-keybindings. And I can easily envision other similar ways. In a nutshell, we can have commands to move between windows bound to very simple-to-type keys. > Or do you mean an additional flavour of windows? Like, a host window > (group) owning subwindows, with all window decoration removed? And a > set of commands working on this set of subwindows? No, I mean basically the normal windows we have. > > What are the use cases where you need more separate sources? > > > > > Doing this within a single window is just simpler. > > > > It isn't, IMO. It raises several conceptual problems that are hard to > > solve. E.g., if you type text between the end of SRC1 and the > > beginning of SRC2, to which source is this added? Or how do you > > handle font-lock? Or what do you do if each source has its own major > > mode? And there are other similar issues, solving which will be > > difficult even conceptually. > > Yes, corner cases are complex. These are not corner cases. These are issues that pop up all over the place as soon as you bring together text from separate sources. Without a satisfactory solution for them, this feature will be only a magnet for bug reports. > > > Then, there's a performance question. One thing is to work on a 1-2k > > > LOC, another is to jump between buffers potentially having tens of > > > thousands of LOCs. > > > > Why do you envision a performance problem here? > > I do not envision it, I feel it :-) Right now I am browsing > xdisp.c/buffer.c and a bunch of other related buffers. Flymake, eglot, > tree sitter all are just impossible to use as every time I switch to > the next window all hell breaks loose. So I just switch things off > completely. tree-sitter is per buffer and handled locally, so I don't think it has anything to do with switching buffers. Eglot and Flymake are problems that go right back to the conceptual difficulties I mentioned. E.g., how do you use Eglot in a buffer that is not under a particular major mode? Same with Flymake. I don't see how bringing text into a single buffer could help here; I do see how it could break things. > By the way, after reading the depths of xdisp.c's handling of display > and buffer.c's exposure of the underlying chunks of memory I now > wonder if it's easier to stream atomic changes between buffers? Say, > given one region in buffer 1 and one region in buffer 2 enforce a sync > of state (text and properties) between both regions. Making the display engine show several buffers is actually very easy, technically. By contrast, the problems I mentioned above are much harder, especially since it is not clear conceptually what the solutions should be.