From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Akib Azmain Turja Newsgroups: gmane.emacs.devel Subject: Re: Questions on glyph matrices used for rendering frame in terminal Date: Tue, 05 Jul 2022 10:26:29 +0600 Message-ID: <87y1x8kwwa.fsf@disroot.org> References: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36774"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Gerd =?utf-8?Q?M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jul 05 06:27:58 2022 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 1o8aAI-0009K0-Iz for ged-emacs-devel@m.gmane-mx.org; Tue, 05 Jul 2022 06:27:58 +0200 Original-Received: from localhost ([::1]:57970 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o8aAH-0002yf-6S for ged-emacs-devel@m.gmane-mx.org; Tue, 05 Jul 2022 00:27:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56752) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8a9Z-0002IT-0g for emacs-devel@gnu.org; Tue, 05 Jul 2022 00:27:13 -0400 Original-Received: from knopi.disroot.org ([178.21.23.139]:38678) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8a9W-0003cC-QY for emacs-devel@gnu.org; Tue, 05 Jul 2022 00:27:12 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 007E540DC6; Tue, 5 Jul 2022 06:27:09 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Original-Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kQ_0SxkpDvnH; Tue, 5 Jul 2022 06:27:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1656995225; bh=QYKwd1ZgysLsvfyyim1Miqtbr+iLmioHA46g3QvA9y0=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=RN2qDuiC0F1yYOtJhQSkZrVVW8bGA2ZY+71rswJFaLxUXV/UM7tvE7A0humXAYPMo 47jYeTgZ+VXOmyPghq42tJmBdr1RlRgqz0sBPwY4NOGTmE8LPYpi8G049CviLDkx/i oCInepwpCdQV4IusTdlgxCJ5CewoHfvZU90v7WaW9eQg781mxHmcfbHd37Lu1BaRJa 7/wI4r7qqhQFe/KkssBtICT3+quVvq7eN+s2Nf2G5PDVdjvsk9TGLfmVg/JIw0S/nY NDwGv9gdoUnSVHr7fR86BTVG4TrgVlrEMZhK4vqYtCtYbPFNMOL64sZp9iLOZhZRO9 9L9ZUvhxbVrMw== In-Reply-To: Received-SPF: pass client-ip=178.21.23.139; envelope-from=akib@disroot.org; helo=knopi.disroot.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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" Xref: news.gmane.io gmane.emacs.devel:291846 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Gerd M=C3=B6llmann writes: >>>=20 >> 1. What's the purpose of the following in >> build_frame_matrix_from_leaf_window? "frame_row->used[TEXT_AREA]" will >> always end up being equal to "window_matrix->matrix_w" after processing >> the right-most window of the row. > > I don't understand. What about the /matrix_x/ + matrix_w below? Oh sorry, I meant "it will end up being equal to *frame_matrix->matrix_w*". > >>=20 >> --8<---------------cut here---------------start------------->8--- >> /* Set number of used glyphs in the frame matrix. Since we fill >> up with spaces, and visit leaf windows from left to right it >> can be done simply. */ >> frame_row->used[TEXT_AREA] >> =3D window_matrix->matrix_x + window_matrix->matrix_w; >> --8<---------------cut here---------------end--------------->8--- >>=20 >>=20 >> 2. From the documentation of make-terminal-frame: >>=20 >> > Note that changing the size of one terminal frame automatically >> > affects all frames on the same terminal device. >>=20 >>=20 >> But why? Do they share glyph matrices, since only one of them is >> visible at a single time? > > How else should other frames behave? Leave a "hole" on the terminal wher= e nothing is displayed when the TTY window is made larger? And what if the= terminal is made smaller? The documentation says that something will happen, but I don't know since I have never tried to do that. > >>=20 >>=20 >> 3. Why clear the desired matrix in build_frame_matrix? As I understand, >> that would clear the glyph matrices of windows the frame, because window >> desired matrix shares memory with frame desired matrix, and its seems >> like build_frame_matrix is called after window desired matrices are >> built. >>=20 >> --8<---------------cut here---------------start------------->8--- >> /* Clear all rows in the frame matrix covered by window matrices. >> Menu bar lines are not covered by windows. */ >> for (i =3D FRAME_TOP_MARGIN (f); i < f->desired_matrix->nrows; ++i) >> clear_glyph_row (MATRIX_ROW (f->desired_matrix, i)); >> --8<---------------cut here---------------end--------------->8--- > > In the TTY case, the glyph memory (struct glyph) for desired window matri= ces is sub-allocated from the glyph memory that is allocated for the frame.= The glyph_row structures on the other hand are different between windows = and frame. Clear_glyph_row doesn't affect the glyph memory, only the glyh_= rows. I can't understand. What does that glyph memory contain? Individual glyphs or the glyph matrix? If the glyph memory holds the glyph matrix, then IIUC glyph row is a row of that glyph matrix, so why clearing that doesn't affect the glyph matrix? > >>=20 >>=20 >> 4. And one more question: why don't Emacs is use the window feature of >> ncurses despite depending on it? Is it inefficient or lack of any >> feature? >>=20 > > The reasons I can think of are > > - ncurses is considerably younger than Emacs > - Its predecessor 'curses' (from BSD, IIRC) wasn't available everywhere (= think VMS, MS-DOS, maybe others), when that part of the code was written. = I would guess that might have been around 1985. What would that be - Emacs= 16 :-). > > Maybe there are also other technical reasons that make a rewrite with ncu= rses impossible, I don'T know. > > (And there's of course always the consideration of why rewrite something = that works.) No, I'm not saying to rewrite, just wanted to know. > > > =2D-=20 Akib Azmain Turja This message is signed by me with my GnuPG key. It's fingerprint is: 7001 8CE5 819F 17A3 BBA6 66AF E74F 0EFA 922A E7F5 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmLDvXUACgkQVTX89U2I YWs9FhAAmpWsTD630fPEzlEKEdFJextfCpoOc/nv6TbDG+QlPt0FzbdWC9HrLlgc O9cjjW1PhZhGdsTrwbS8XUzzsp12F6EgPCZ4OSek641uer1W8ayPk3nSWmnNsBgn eFa9TTjYHuWFhXDA4zml/oPNuj3B49VPawG5wZDhhZ0bRRiIXV/tsb4TbWIxZYir Np0XXM9lWP1Bg5OsrFZRgSc9dR+cLiRHkIplFU9YDnbUzUTVJbLXyYRRKU+EPu6G ziGbhRIE8g5gW8Nwwm0fEflEKZHZ7zXIwfJVGbfvFY9vCSlkTZxhE7mLAMGK6Fr2 rTZA2cVtBW1KxkjLjy/DuxrTkMYA6xLy6ORcfdeg6g9FEQi//rxmxKy9ux83u+Y1 j+IYnhEBhieerdJSC32vbvYnbDKuml5ywerF8Y3OoT8RLOMqp07DEMI6jGLE33GO Uj6yqBnuNOWOhZ5yL6MlENNZWgQSXaQKBpEEXa9EZfs9teTAbl0XP0OVV1wsvYH2 JqWd1SEm6S03yhNci0ZM9uCAcPacRfTOy05zsxz8QogbmCQH9abBYvO53/Qq0u56 +KErLr7iwwjHmjpIZ6YsOl+gULq/CA0fjgoXQaT+wssQpgEVlYGvP0H3Ztvxuee4 jdr1NMJ0Pode4bOqqjl688LXeMbDyBplLP9EwLtxD2hFgouAVY0= =Ogki -----END PGP SIGNATURE----- --=-=-=--