From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: Questions on glyph matrices used for rendering frame in terminal Date: Mon, 4 Jul 2022 21:37:02 +0200 Message-ID: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.100.31\)) Content-Type: multipart/signed; boundary="Apple-Mail=_A8C9B54D-F67F-49DA-BABA-418956A023D8"; protocol="application/pgp-signature"; micalg=pgp-sha512 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27948"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: akib@disroot.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jul 05 04:21:35 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 1o8YBz-0007A7-C2 for ged-emacs-devel@m.gmane-mx.org; Tue, 05 Jul 2022 04:21:35 +0200 Original-Received: from localhost ([::1]:37468 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o8YBx-0004iL-LZ for ged-emacs-devel@m.gmane-mx.org; Mon, 04 Jul 2022 22:21:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43516) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8Rsa-0007mM-DN for emacs-devel@gnu.org; Mon, 04 Jul 2022 15:37:08 -0400 Original-Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]:34716) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o8RsY-0006c1-Ks for emacs-devel@gnu.org; Mon, 04 Jul 2022 15:37:08 -0400 Original-Received: by mail-ed1-x532.google.com with SMTP id z41so12840065ede.1 for ; Mon, 04 Jul 2022 12:37:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:mime-version:subject:message-id:date:cc:to; bh=mciHp45ukJAXtk9B3p+2wy1MR5a62OFDBmV2FORn40A=; b=JPKZUuhsdHlB6GO4Qa2XqMhcO0C44VW4/BfFd+pUUVYW8QAifcnj823nTsNzTfWO31 LLDJGILGcagywbvvBBQ2o4hA3zJPmT+H2rCE8vJYQUvLDSprjb7dMpB571OsJuMellGV P4tyzruMQfehLTA/UGmT3uraAlEaiTPzRZMWqOYW60nyuZjdCuPy4tDP8JO2VQd4XRrH PYijw+ICLsxB3l1FqDPuodEEX3AexcAHsRkp3AIjWisy4dbbaawzK+H7slqM9nk8A7zp bypIZ8QTovlTLbGeU6kbU21nMWZzsWZqXyzvBDyvNsPgXSsKSDuAo9Dax9egf7vGyiM4 2rfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:mime-version:subject:message-id:date:cc:to; bh=mciHp45ukJAXtk9B3p+2wy1MR5a62OFDBmV2FORn40A=; b=4GDOPXlAynviy9jIJJucaZZMwdlLjHiBla7sgEiu27cb2rolDsfFSPUG4WEeLudMNy op3xDUmr8f51eWxIKUJnLMXc7tnCj+vS6mNp2H/BXCeqde+vEOFliTHT7EcGAJUo/dbD FFnXmcC2LGEuQLO8y22AM47npEKoxjsULrQyKUT67Wac52Dhz9urP7LH6aKWZGA4IH5l FlloJS27FkkrCVmIOpZc/Cn4oHiwQIowOfXadexy8GL32BoEg4p8ZS11sTqYxP8pvJFd RK2FRgg4TnHb06MdnTtzfm0VHCGT/hl9G+qUkcHt/fVfYTyq0U2EGDB1e44C2hQfXuy/ wIbQ== X-Gm-Message-State: AJIora9eUtBE8w1JlCEEICeWxtUJSAo0di+Ds/EXIjCRGgktnujp+oHd atxWEwI12SfhqPA96sWQxNs= X-Google-Smtp-Source: AGRyM1t0h9XentiKZHjE8ve7bJ5CiWB3d2+/WxJawVG28Fdyrm4TBC0z6sA6BmUHYq2yiCz9rKnsbw== X-Received: by 2002:a05:6402:2552:b0:435:9e1c:ca49 with SMTP id l18-20020a056402255200b004359e1cca49mr41163251edb.126.1656963424213; Mon, 04 Jul 2022 12:37:04 -0700 (PDT) Original-Received: from smtpclient.apple (pd9e36b41.dip0.t-ipconnect.de. [217.227.107.65]) by smtp.gmail.com with ESMTPSA id g26-20020a1709067c5a00b006f3ef214ddesm14729997ejp.68.2022.07.04.12.37.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Jul 2022 12:37:03 -0700 (PDT) X-Mailer: Apple Mail (2.3696.100.31) Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=gerd.moellmann@gmail.com; helo=mail-ed1-x532.google.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 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, FAKE_REPLY_B=1.566, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 04 Jul 2022 22:20:22 -0400 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:291844 Archived-At: --Apple-Mail=_A8C9B54D-F67F-49DA-BABA-418956A023D8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii >>=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? >=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. =46rom 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 = where nothing is displayed when the TTY window is made larger? And what = if the terminal is made smaller? >=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 = matrices 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. >=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 = ncurses impossible, I don'T know. (And there's of course always the consideration of why rewrite something = that works.) --Apple-Mail=_A8C9B54D-F67F-49DA-BABA-418956A023D8 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIzBAEBCgAdFiEEirYePpiT82Hjkftpc+obGZDFPmMFAmLDQV4ACgkQc+obGZDF PmPjEhAAgf8hembzzNUHe9aw1Gs9o+kBA9sCv6imTJeAhlxBROh5GLxti98hyDIn VEeMsKXuk3ASlYa78yoeZEvfzjHbaMvHlktg3RFNTxaMzFbi+cYQykt5Dt/h+Kzq 4zzoW5zmM0SPXcpRRd2OsmDYUwNsAhroxPdVDZVehjYqZVmKvNAcIlcAQk7Ge/9I 4yXYN8cUN/t4pouYLnIYfm6VOycq+L04Wb+2mxlhfypxjaFle6B8KAOmIHflXCWd K5HK0vNTsMFnUoPmD+lb5LNQgbHElTfwY4nHiLmG9YkZVKgSgUz6mTk7RvD/yNw8 DpkaIMpB0AohKxGIS1a5HjeV96JAt3ZEZoMe5ZtO/2pRIJ0EY2E+53h7FjM3gz2T De5i2FwOi47kVx670jLTjl3qWotFf62qqmaqa1+fU1btANimc510ZGbUsI+1Ke5w O1c+2EHJ9b1X+Co816qcfEEku/55mINYWoJwtN4GJMDTHcqW0RLLKr2voUffYd5I GyHYVrU6UwC4YgwwVBnXz97oNEymRAvCVk33+62A5Ip4eP0C4PVltbjEYkDqUlsh 63IuXOdnHPc6EeRuufYIfdkC5bc9ZX48s0LV++I53rhHGAuvvJKmrUXGhWYqIHKh 0BRWiwiqd8JM8cMDNX3VOCozxp9TP9SPs6lhQfa2vxwEGjdOyUE= =ja4/ -----END PGP SIGNATURE----- --Apple-Mail=_A8C9B54D-F67F-49DA-BABA-418956A023D8--