From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Dmitrii Korobeinikov Newsgroups: gmane.emacs.devel Subject: Re: Request for pointers and advice: displaying several buffers inside a single window Date: Sat, 11 Apr 2020 13:56:07 +0600 Message-ID: References: <83a73swwd7.fsf@gnu.org> <87wo6nxsjz.fsf@localhost> <83369amqdi.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="85909"; mail-complaints-to="usenet@ciao.gmane.io" Cc: adam@alphapapa.net, Yuan Fu , Ihor Radchenko , emacs-devel To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 11 09:57:17 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 1jNB0t-000MEF-W4 for ged-emacs-devel@m.gmane-mx.org; Sat, 11 Apr 2020 09:57:15 +0200 Original-Received: from localhost ([::1]:49710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNB0t-00041y-0C for ged-emacs-devel@m.gmane-mx.org; Sat, 11 Apr 2020 03:57:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33760) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNB06-0002uC-A7 for emacs-devel@gnu.org; Sat, 11 Apr 2020 03:56:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jNB05-0002Ma-3Z for emacs-devel@gnu.org; Sat, 11 Apr 2020 03:56:26 -0400 Original-Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:36183) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jNB03-0002Id-J1; Sat, 11 Apr 2020 03:56:23 -0400 Original-Received: by mail-wm1-x341.google.com with SMTP id a201so4466047wme.1; Sat, 11 Apr 2020 00:56:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=9lbvfpqQj02ZQINySZNGVlzDeK2WM3kR3JZlGGlw6qg=; b=Oa24CvK98ywPx7KouKMcn2J5TeYzGbfm5Y66k2recMXX5Eh9sazlVBIejm6cjeugfC K5tgJr5+bwQPvj+YpwzOjEYTa4sOFmqTufuhpnVGlKimmPQNDh/dk8bF+mCVEWRdDn3L dmumynJWBwojTmzvRKML5r1tVOIqY4G3s1gHs4tTrSXPH2FaM0ZfcxV+uEPe3vSsux3H WPHw61F3DucFfE+x9Lx3pWN3FSmQjBfyw78u86CaIEloosJfcsRaDNcEsglIsGNjzja1 p2JR3/rJxZOmFuwV0adG3SeXzL5rgFpCnhQOur4H2B85TWE6K1wDpFEiPobfx+azsL6C Et2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=9lbvfpqQj02ZQINySZNGVlzDeK2WM3kR3JZlGGlw6qg=; b=nbTf7sbiN4iLZptImtbu83lhtCGCHt3UH0P6BjAIjgN4Cv2CmbRZ/kCtdwVwQCc7RL IwSFNL4kHMlwIoVKJIN77EsY4lk4dIC+6cFYKAPfFd+eIQxxo+fUbqCR7ukdffMLuV9J 5BqwdKFbutwYb2qsO3YaWZ0S6G5nFT/mpnVC+gRdDLOpb6dXEkotYjxVJysfoy67g8nk bKjWRHPiCeAF4zi4b2aq1Kj5zSKCr3uYNllh3omk0d8t8QAvEiKyD4Epk/PoVDkVOhjR 8ZkdVUqgQvINcVKAIWf1byvOt/5uycFmtOfgYIGnNhhsBb4i82N8zk/rumIRWztPugAO nkhg== X-Gm-Message-State: AGi0PuaUVseW4jEwoMEZQSV57oXip20qzjM5Yi4NGhhg/t4n0h2vG7GV GOz5C+2XrO5JgbPeckh2ktg/XRYce/1h7uBFST95iYBBNGk= X-Google-Smtp-Source: APiQypKA5xA7QX9egUhEDjYu7AMDfrQiN3Qw2zpFB1oUSphFMKFVbZ/lwrX5yisy+9nOOOTjOb4Ic3BWcZ81LisQ3Jw= X-Received: by 2002:a1c:7216:: with SMTP id n22mr8575990wmc.41.1586591780422; Sat, 11 Apr 2020 00:56:20 -0700 (PDT) In-Reply-To: <83369amqdi.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::341 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:246822 Archived-At: > > From what I saw, there's not a unified core interface on top of that c > > array. So, would need to modify each place that makes a use of it. > > (for a couple of examples, see text_outside_line_unchanged_p in > > xdisp.c, looking_at_1 in search.c) > > I'm not sure why you came to that conclusion. Emacs's internals > access buffer text directly when needed, for speed. Interfaces like > BEG_UNCHANGED/END_UNCHANGED, BYTE_POS_ADDR, GPT, and others are no > less "core interfaces" for accessing buffer text than functions in > insdel.c. I would even consider insdel.c as a layer _above_ the > low-level interfaces such as BYTE_POS_ADDR. By "unified core interface", I meant something like an OOP-style public interface done in a way so the users don't have to know about the implementation and underlying data structures, in which case modifications could've been simpler. I am not saying that's what it should have been or even could have been, just stating the fact that a different approach is used. > Emacs's internals > access buffer text directly when needed, for speed. That's exactly the point I was making. > > The good news is: I believe xdisp.c wouldn't have to be modified all > > that much if the regions are enforced to start on different lines. > > How so? The display code accesses the buffer text directly, using > BYTE_POS_ADDR. I didn't say it wouldn't have to be touched at all : ) xdisp.c has only 8 occurences of BYTE_POS_ADDR, that doesn't appear too bad. BTW What I am not sure about is if "different lines" enforcement would make for a noticeably easier implementation, now I am thinking, it probably wouldn't matter that much. =D1=81=D0=B1, 11 =D0=B0=D0=BF=D1=80. 2020 =D0=B3. =D0=B2 13:30, Eli Zaretsk= ii : > > > From: Dmitrii Korobeinikov > > Date: Sat, 11 Apr 2020 01:09:08 +0600 > > Cc: Yuan Fu , adam@alphapapa.net, Eli Zaretskii , > > emacs-devel > > > > >From what I saw, there's not a unified core interface on top of that c > > array. So, would need to modify each place that makes a use of it. > > (for a couple of examples, see text_outside_line_unchanged_p in > > xdisp.c, looking_at_1 in search.c) > > I'm not sure why you came to that conclusion. Emacs's internals > access buffer text directly when needed, for speed. Interfaces like > BEG_UNCHANGED/END_UNCHANGED, BYTE_POS_ADDR, GPT, and others are no > less "core interfaces" for accessing buffer text than functions in > insdel.c. I would even consider insdel.c as a layer _above_ the > low-level interfaces such as BYTE_POS_ADDR. > > And looking_at_1 does what it does because it needs to pass buffer > text as 2 C 'char' arrays to regex routines, so I don't think it's any > evidence to anything. It's just a trick to pass non-contiguous text > to a function that needs contiguous text. > > > The good news is: I believe xdisp.c wouldn't have to be modified all > > that much if the regions are enforced to start on different lines. > > How so? The display code accesses the buffer text directly, using > BYTE_POS_ADDR.