all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitrii Korobeinikov <dim1212k@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: adam@alphapapa.net, Yuan Fu <casouri@gmail.com>,
	Ihor Radchenko <yantar92@gmail.com>,
	emacs-devel <emacs-devel@gnu.org>
Subject: Re: Request for pointers and advice: displaying several buffers inside a single window
Date: Sat, 11 Apr 2020 13:56:07 +0600	[thread overview]
Message-ID: <CA+Yh0SQh1yj3tiBF0cUt9XSJeNKVZAXf8_Qb-jY+nvQGGZX_HA@mail.gmail.com> (raw)
In-Reply-To: <83369amqdi.fsf@gnu.org>

> > 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.

сб, 11 апр. 2020 г. в 13:30, Eli Zaretskii <eliz@gnu.org>:
>
> > From: Dmitrii Korobeinikov <dim1212k@gmail.com>
> > Date: Sat, 11 Apr 2020 01:09:08 +0600
> > Cc: Yuan Fu <casouri@gmail.com>, adam@alphapapa.net, Eli Zaretskii <eliz@gnu.org>,
> >       emacs-devel <emacs-devel@gnu.org>
> >
> > >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.



  reply	other threads:[~2020-04-11  7:56 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-03 11:54 Request for pointers and advice: displaying several buffers inside a single window Dmitrii Korobeinikov
2020-04-03 13:07 ` Eli Zaretskii
2020-04-04 22:44   ` Dmitrii Korobeinikov
2020-04-05 14:08     ` Adam Porter
2020-04-05 22:55   ` Dmitrii Korobeinikov
2020-04-10 14:45     ` Yuan Fu
2020-04-10 15:35       ` Ihor Radchenko
2020-04-10 16:43         ` Eli Zaretskii
2020-04-10 17:46           ` Ihor Radchenko
2020-04-10 18:07             ` Eli Zaretskii
2020-04-10 18:37               ` Ihor Radchenko
2020-04-10 19:01                 ` Drew Adams
2020-04-10 19:19                   ` Ihor Radchenko
2020-04-10 20:29                     ` Drew Adams
2020-04-11  8:11                       ` Ihor Radchenko
2020-04-11 17:23                         ` Drew Adams
2020-04-12  2:42                           ` Richard Stallman
2020-04-12  5:09                             ` Drew Adams
2020-04-12  5:15                               ` Drew Adams
2020-04-13  2:21                               ` Richard Stallman
2020-04-13  5:23                                 ` Drew Adams
2020-04-12 23:54                             ` Juri Linkov
2020-04-13  5:23                               ` Drew Adams
2020-04-12 14:25                           ` Ihor Radchenko
2020-04-12 16:38                             ` Drew Adams
2020-04-10 19:12                 ` Eli Zaretskii
2020-04-10 19:25                   ` Ihor Radchenko
2020-04-10 19:34                   ` Ihor Radchenko
2020-04-11  7:34                     ` Eli Zaretskii
2020-04-11  8:35                       ` Ihor Radchenko
2020-04-11  9:25                         ` Eli Zaretskii
2020-04-10 19:09         ` Dmitrii Korobeinikov
2020-04-11  0:05           ` chad
2020-04-11  8:22             ` Eli Zaretskii
2020-04-11  7:30           ` Eli Zaretskii
2020-04-11  7:56             ` Dmitrii Korobeinikov [this message]
2020-04-11  8:26               ` Eli Zaretskii
2020-04-11 10:01                 ` Dmitrii Korobeinikov
2020-04-03 18:30 ` [SPAM UNSURE] " Stephen Leake
2020-04-05 13:18   ` Robert Pluim
2020-04-05 20:35     ` Dmitrii Korobeinikov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+Yh0SQh1yj3tiBF0cUt9XSJeNKVZAXf8_Qb-jY+nvQGGZX_HA@mail.gmail.com \
    --to=dim1212k@gmail.com \
    --cc=adam@alphapapa.net \
    --cc=casouri@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=yantar92@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.