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 02:37:13 +0800 Message-ID: <87pncfxk4m.fsf@localhost> References: <83a73swwd7.fsf@gnu.org> <87wo6nxsjz.fsf@localhost> <83d08fmgul.fsf@gnu.org> <87tv1rxmgc.fsf@localhost> <83a73jmcyo.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="55567"; 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 20:41:36 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 1jMyau-000ENU-Ds for ged-emacs-devel@m.gmane-mx.org; Fri, 10 Apr 2020 20:41:36 +0200 Original-Received: from localhost ([::1]:37876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMyat-0000cx-Ag for ged-emacs-devel@m.gmane-mx.org; Fri, 10 Apr 2020 14:41:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56178) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMyaN-0000DT-KO for emacs-devel@gnu.org; Fri, 10 Apr 2020 14:41:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jMyaL-0003Jk-Rq for emacs-devel@gnu.org; Fri, 10 Apr 2020 14:41:03 -0400 Original-Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]:34512) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jMyaI-0003IH-Vj; Fri, 10 Apr 2020 14:40:59 -0400 Original-Received: by mail-pg1-x52a.google.com with SMTP id l14so1330688pgb.1; Fri, 10 Apr 2020 11:40:58 -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=2qdA0nff4y7Fkxm/fvkyqKRZj786xq+nyBr5aE8u7Yc=; b=hHuQamWbl0LHodb0vXtkyWoYIsZVGCXTR8h6dx/Yh7v22aM42zOUsjvSIlXuJTKAz6 6Pf8gHgmyZGT9MKXH0JuZibrDBw2IcJJKHzjTOlkSM8fWOANI76hMK634tD/GGU10GIM sgArWkKilvrD8s+CnkHcI9Pki1hi/Ru7tOPhbx+Blxg4TSt4lABeGMI6FJcjP1FUPk3Z RWxcA41n6/kRCJRB4wC1ey6tsyrJ6vB1/ZOconfmU8+LGfIcZlP63js6KHZcyhg1FlC3 +sBdZWRs7V5HmkHIBzFyshSiKlgNUMBNNbhnP5uE2gFdnH1YgvpwIhBphwdRImfD0Mjn uBRA== 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=2qdA0nff4y7Fkxm/fvkyqKRZj786xq+nyBr5aE8u7Yc=; b=Mvl6qS/JC8bs4LKepBACoWRo6dTIYm7r9OAYqF/HhiBNVj4NeHY1i4F/3VSvzJNyT8 Fa0UwOmV3jRUldne1uZ+hftxR4kJ6j9z31L5Wz8TCZFyWLuTsI3x8ywyo0saNp8ZFaQs 1owslBlhpbnwsfo7OMsEVKA2EU4jzGW/eFQSm6E1Yd+iOOxmtOkgdFTepopaFjiWx23a /3qdiYlcCTDXt59BwFiM6ow6STAeiMCqqAhEP43CMCBqmtWK0Ze+ypHVjbSe70CER8vd EGqU5upJrOG+/CEd1xA/KZB6/nbgkMKaRnQ16aSjzxMiccXt+c3Dz/gjCtxGkPzAkTay NWeA== X-Gm-Message-State: AGi0Pub2rNyC0uU4A5eRc/gHlZcWVlP6qN09MH0Wpi3N3ArxlvsIcNH/ 8Po7wYeF6l8yezpq/jzSCxICky3DMpr+2Q== X-Google-Smtp-Source: APiQypLdKQ+XyBy880bHyTaw+pTW0Gu5WPs6o4A8uQpgmYVcHnHUYjFVXqsttYZ8J0vUA2V6p+EqnQ== X-Received: by 2002:a63:5050:: with SMTP id q16mr5680584pgl.118.1586544057393; Fri, 10 Apr 2020 11:40:57 -0700 (PDT) Original-Received: from localhost ([45.35.9.245]) by smtp.gmail.com with ESMTPSA id g11sm2258927pjs.17.2020.04.10.11.40.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Apr 2020 11:40:56 -0700 (PDT) In-Reply-To: <83a73jmcyo.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::52a 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:246791 Archived-At: > 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. Just like narrowing. > 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. 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 01:46:59 +0800 >> >> > I don't think I understand what you mean by "segments of text". >> > Buffer text is just a long C array of 'char' in Emacs. >> >> I mean that buffer text in indirect buffer is a pointer to the first >> element of the C array containing the text in master buffer (or >> something similar). Similarly, the pointer can be created to nth element >> of array. Thus, "segment" of text starting from some non-zero position >> in the master buffer can be automatically synchronised with the master >> buffer. > > 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? > > If so, how is this different from narrowing in indirect buffers that > we have now? -- 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