From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.devel Subject: Re: Request for pointers and advice: displaying several buffers inside a single window Date: Sat, 11 Apr 2020 03:25:40 +0800 Message-ID: <87k12nxhvv.fsf@localhost> References: <83a73swwd7.fsf@gnu.org> <87wo6nxsjz.fsf@localhost> <83d08fmgul.fsf@gnu.org> <87tv1rxmgc.fsf@localhost> <83a73jmcyo.fsf@gnu.org> <87pncfxk4m.fsf@localhost> <837dynm9yb.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="3450"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dim1212k@gmail.com, adam@alphapapa.net, casouri@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Apr 10 21:30:34 2020 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 1jMzMI-0000pI-1R for ged-emacs-devel@m.gmane-mx.org; Fri, 10 Apr 2020 21:30:34 +0200 Original-Received: from localhost ([::1]:38152 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMzMH-0006H0-2y for ged-emacs-devel@m.gmane-mx.org; Fri, 10 Apr 2020 15:30:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33329) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMzLD-0005Ty-AS for emacs-devel@gnu.org; Fri, 10 Apr 2020 15:29:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jMzLC-0004Fb-3N for emacs-devel@gnu.org; Fri, 10 Apr 2020 15:29:27 -0400 Original-Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:55447) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jMzL9-0004EL-RC; Fri, 10 Apr 2020 15:29:24 -0400 Original-Received: by mail-pj1-x102f.google.com with SMTP id a32so1118812pje.5; Fri, 10 Apr 2020 12:29:23 -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:date:message-id :mime-version; bh=HBxt4vJQf3mJuCcbrtMemZ/pJuHTpDX9mnlHY6MyRtw=; b=Ip4k3H4/oos3wVKw9ANMH9WiZC+en/gey7aQvzk9ux9p17V6l9DbnjiZwTteVO9TAq LSX+8GPVIH7xolJc/s207DrnUMX8gyDnv1Y1VSU4AfU+AWvQdciUrhByakD3jPGR7uFa Ef2xCd6qlFvqKCG52aCn+X8CTK3R7FOF8Gaonl+bSE+rNuK3KyIJQhBrFP/topIhJLNg Hs4648P4d+aMbryOE+CrMMpvs2Nb/c4WwhdCbD0b9E67ePWqEaWrM79/3huVR9EIhOPd OpyYW/KatdAMqaMdzwwzOTzBJhDMdkrJ/sBS8pTkEsenIHdnVrNCIYi3eCbP9kGaYrxE NlVQ== 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:date :message-id:mime-version; bh=HBxt4vJQf3mJuCcbrtMemZ/pJuHTpDX9mnlHY6MyRtw=; b=ip6fAC5OFdY7ZYtv43uGJgFlYtHkLEv1/s7g1vZiofKG/TC+Pp6GPMabXMXXly8uIa KeuaBOptbxoOqiBrAa+86Eyv8g17vv95/GIbDO02KNFHcU1jtJhWsmUttfUKP473Jhp1 PnfQV88AX4oVj1COdQRa7DjhrAnOShgJ9ueoKS8xPXG3VZidYkzrxv87T3PKYkgW5nno XJaUB8ZSJWSccljVquVKrZW90Y+2mq5+pnoHKNgCGiJ3kNIfiQCUGl6oWUBs5k5/j9by tru4j0LKkZU+EUwk+HaBXvqG+bAD+TcDLnwL/Id9WoCa4xIAhS9YYsxlmjPqh5LXz7ym ijvg== X-Gm-Message-State: AGi0PubgtVvWtYiNOPrzLjn/zbBYJ8n/WPkz6dLStwPI6TKEkmXvGSKH i9qZPlxpxnOsjBQIr161RqHVDnJb0ie2xg== X-Google-Smtp-Source: APiQypKhBOj1t9fb9SG8LdshlgWeAMcKRlDkIVe7Xs9aPc84ahPX229re4Q1Dw2wUeboBW/aY3FpeQ== X-Received: by 2002:a17:902:9048:: with SMTP id w8mr5896028plz.24.1586546962444; Fri, 10 Apr 2020 12:29:22 -0700 (PDT) Original-Received: from localhost ([45.35.9.245]) by smtp.gmail.com with ESMTPSA id o12sm2435151pjt.16.2020.04.10.12.29.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Apr 2020 12:29:22 -0700 (PDT) In-Reply-To: <837dynm9yb.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::102f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:246797 Archived-At: > So there's one more parameter, in addition to the offset? Sure, there should be at least two parameters to define segment. I am thinking aloud here. Started with rough idea. I think Dmitrii just described similar approach and also did some source code lookup. > Sounds like a thorough surgery of all the low-level functions that > handle insertion, deletion, replacement etc. Yeah. Also, regions, markers, and point motion. Eli Zaretskii writes: >> From: Ihor Radchenko >> Cc: casouri@gmail.com, dim1212k@gmail.com, adam@alphapapa.net, >> emacs-devel@gnu.org >> Date: Sat, 11 Apr 2020 02:37:13 +0800 >> >> > So a "segment" is a part of buffer text that starts from some offset, >> > and then goes on until the end of the buffer text? IOW, the beginning >> > is different, but the end is the same? >> >> I would rather say that "segment" is a text between two markers in an >> arbitrary buffer. > > So there's one more parameter, in addition to the offset? > >> > If so, how is this different from narrowing in indirect buffers that >> > we have now? >> >> The difference is that text in a single buffer must not always be coming >> from a single buffer (possibly narrowed), but can as well be a list of >> "segments". Instead of storing all the buffer text in a single char >> array, the buffer text could be represented by a list of "segments". In >> a normal buffer, this list will just contain a single element pointing >> to the buffer's char array containing its text. However, the list can be >> extended with "segments" from other buffers. > > Sounds like a thorough surgery of all the low-level functions that > handle insertion, deletion, replacement etc. > > And what do you suggest to do with the gap? -- Ihor Radchenko, PhD, Center for Advancing Materials Performance from the Nanoscale (CAMP-nano) State Key Laboratory for Mechanical Behavior of Materials, Xi'an Jiaotong University, Xi'an, China Email: yantar92@gmail.com, ihor_radchenko@alumni.sutd.edu.sg