From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: "Final" version of tty child frames Date: Wed, 23 Oct 2024 10:49:11 +0300 Message-ID: <86wmhzdzt4.fsf@gnu.org> References: <87cyjrjz74.fsf@163.com> <87zfmvpkki.fsf@163.com> <87v7xjpjoi.fsf@163.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24764"; mail-complaints-to="usenet@ciao.gmane.io" Cc: tumashu@163.com, 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 Wed Oct 23 09:50:10 2024 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 1t3W88-0006H5-8q for ged-emacs-devel@m.gmane-mx.org; Wed, 23 Oct 2024 09:50:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3W7Q-0002Y1-43; Wed, 23 Oct 2024 03:49:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t3W7O-0002Xe-Db for emacs-devel@gnu.org; Wed, 23 Oct 2024 03:49:22 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t3W7L-0000yo-LT; Wed, 23 Oct 2024 03:49:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=/L35oLzrJyPGJN77PNPPhYiFDs1RKeuOUgXJnAuwR0Q=; b=JKj11nNMk/aw8TrXP75N wzxqSOKnMRlerTJdBHryE+ZHwKN4CJT1FXxQ/Frizi5VmDxV3KDZQFkO7wR/p0tklPAac1vwmWJM4 4Evj36Fcso1RRPn0qLe0QZG3lwlWmv6jpjhkojC2ZH95SIevng9PnuZzFLechc5/KvtufXWCrLUa5 giDjOGPfPid7m9ylcN2MWA4JALoAgJ6HM8fkHXQ6jCFQ3sb6gQwDl3So9aw0PBILhyDg3z6wIhKzW qdCOo00ZDmc0sk3TgjbzZHfwPOBM/psF2ZQXtYHHKFOqh9awJzzJ7m5GRRT+SR/TKrinqq6oSlFTQ uvQ6YJNKuNy91Q==; In-Reply-To: (message from Gerd =?utf-8?Q?M?= =?utf-8?Q?=C3=B6llmann?= on Wed, 23 Oct 2024 07:00:03 +0200) 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:324771 Archived-At: > From: Gerd Möllmann > Cc: Emacs Devel > Date: Wed, 23 Oct 2024 07:00:03 +0200 > > Another question is if there is something lurking with R2L? I have no > idea what terminals do in that case, but I'd guess Eli knows :-). Terminals should do nothing, and if your terminal emulator has a "bidi reordering" feature, you should disable it, because Emacs does everything by itself, and needs the terminal to be "dumb" in this aspect. Basically, we produce a glyph row where all the glyphs are flushed to the right window edge, and there's empty space on the left of each screen line to make it a full-width screen line. The low-level write code that writes to the terminal then works normally, writing glyphs left to right. The current branch hits an assertion violation when showing RTL text in a child window. (Showing RTL text in the parent window works fine.) Here's the recipe: emacs -Q -nw Evaluate in *scratch: (defun my-make-child () (interactive) (make-frame `((parent-frame . ,(selected-frame)) (background-color . "gray10") (foreground-color . "white") (internal-border-width . 1) (top . 15) (left . 40) (width . 80) (height . 25)))) M-x my-make-child RET C-x 5 o C-x C-f etc/tutorials/TUTORIAL.he RET The backtrace from the assertion is below, including the data which is involved. As you see, X is 119 whereas the matrix_w is 108, which violates the assertion. Let me know if you want me to try something or show more data or maybe tell you more about how RTL display works in TTY case. Thread 1 "emacs" received signal SIGABRT, Aborted. 0x00007ff5201959fc in pthread_kill () from /lib/x86_64-linux-gnu/libc.so.6 (gdb) bt #0 0x00007ff5201959fc in pthread_kill () at /lib/x86_64-linux-gnu/libc.so.6 #1 0x00007ff520141476 in raise () at /lib/x86_64-linux-gnu/libc.so.6 #2 0x0000559f4892c840 in terminate_due_to_signal (sig=sig@entry=6, backtrace_limit=backtrace_limit@entry=2147483647) at emacs.c:469 #3 0x0000559f48933221 in die (msg=msg@entry=0x559f48c2ceb8 "x < root->current_matrix->matrix_w", file=file@entry=0x559f48c2c004 "dispnew.c", line=line@entry=3774) at alloc.c:8059 #4 0x0000559f4891c4cb in is_cursor_obscured () at dispnew.c:3774 #5 terminal_cursor_magic (topmost_child=0x559f4b07b9b0, root=0x559f4afcd050) at dispnew.c:3790 #6 combine_updates_for_frame (f=, force_p=, inhibit_scrolling=) at dispnew.c:3840 #7 0x0000559f48954656 in combine_updates (roots=roots@entry=0x7ff51c751723, force_p=force_p@entry=false, inhibit_scrolling=inhibit_scrolling@entry=false) at dispnew.c:3867 #8 0x0000559f489af858 in redisplay_internal () at xdisp.c:17612 #9 0x0000559f48abe24a in read_char (commandflag=1, map=0x7ff51c752503, prev_event=0x0, used_mouse_menu=0x7fff251757eb, end_time=0x0) at keyboard.c:2673 #10 0x0000559f48abf794 in read_key_sequence (keybuf=0x7fff25175940, prompt=0x0, dont_downcase_last=, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=, disable_text_conversion_p=false) at keyboard.c:10747 #11 0x0000559f48ac14f1 in command_loop_1 () at keyboard.c:1424 #12 0x0000559f48b4fee7 in internal_condition_case (bfun=bfun@entry=0x559f48ac1280 , handlers=handlers@entry=0x90, hfun=hfun@entry=0x559f48ab4d50 ) at eval.c:1598 #13 0x0000559f48aaab8e in command_loop_2 (handlers=handlers@entry=0x90) at keyboard.c:1163 #14 0x0000559f48b4fd69 in internal_catch (tag=tag@entry=0x12360, func=func@entry=0x559f48aaab60 , arg=arg@entry=0x90) at eval.c:1277 #15 0x0000559f48aaab29 in command_loop () at keyboard.c:1141 #16 0x0000559f48ab4805 in recursive_edit_1 () at keyboard.c:749 #17 0x0000559f48ab4bb8 in Frecursive_edit () at keyboard.c:832 #18 0x0000559f489479e6 in main (argc=, argv=) at emacs.c:2624 (gdb) up #1 0x00007fd8d9b21476 in raise () from /lib/x86_64-linux-gnu/libc.so.6 (gdb) #2 0x000055ae22b9a840 in terminate_due_to_signal (sig=sig@entry=6, backtrace_limit=backtrace_limit@entry=2147483647) at emacs.c:469 469 emacs_raise (sig); (gdb) #3 0x000055ae22ba1221 in die ( msg=msg@entry=0x55ae22e9aeb8 "x < root->current_matrix->matrix_w", file=file@entry=0x55ae22e9a004 "dispnew.c", line=line@entry=3774) at alloc.c:8059 8059 terminate_due_to_signal (SIGABRT, INT_MAX); (gdb) #4 0x000055ae22b8a4cb in is_cursor_obscured () at dispnew.c:3774 3774 eassert (x < root->current_matrix->matrix_w); (gdb) p x $1 = 119 (gdb) p root->current_matrix->matrix_w value has been optimized out (gdb) p root->current_matrix value has been optimized out (gdb) p root $2 = (gdb) up #5 terminal_cursor_magic (topmost_child=0x55ae245e89e8, root=0x55ae245c3050) at dispnew.c:3790 3790 if (is_cursor_obscured ()) (gdb) p root->current_matrix->matrix_w $3 = 108