all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Gerd Möllmann" <gerd.moellmann@gmail.com>
Cc: tumashu@163.com, emacs-devel@gnu.org
Subject: Re: "Final" version of tty child frames
Date: Wed, 23 Oct 2024 10:49:11 +0300	[thread overview]
Message-ID: <86wmhzdzt4.fsf@gnu.org> (raw)
In-Reply-To: <m2h693ifcc.fsf@gmail.com> (message from Gerd Möllmann on Wed, 23 Oct 2024 07:00:03 +0200)

> From: Gerd Möllmann <gerd.moellmann@gmail.com>
> Cc: Emacs Devel <emacs-devel@gnu.org>
> 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=<optimized out>, force_p=<optimized out>, inhibit_scrolling=<optimized out>) 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=<optimized out>, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=<optimized out>, 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 <command_loop_1>, handlers=handlers@entry=0x90, hfun=hfun@entry=0x559f48ab4d50 <cmd_error>) 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 <command_loop_2>, 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=<optimized out>, argv=<optimized out>)
      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 = <optimized out>
  (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



  reply	other threads:[~2024-10-23  7:49 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-22  4:46 "Final" version of tty child frames Gerd Möllmann
2024-10-22  5:29 ` Eli Zaretskii
2024-10-22  9:58   ` martin rudalics
2024-10-22 10:20     ` Eli Zaretskii
2024-10-22 14:01       ` martin rudalics
2024-10-22 14:23         ` Eli Zaretskii
2024-10-22 10:40     ` Gerd Möllmann
2024-10-22 11:43       ` Po Lu
2024-10-22 13:44       ` Eli Zaretskii
2024-10-22 14:01         ` Gerd Möllmann
2024-10-22 14:02       ` martin rudalics
2024-10-28  4:35   ` Jared Finder
2024-10-28  5:57     ` Gerd Möllmann
2024-10-22  7:34 ` Dr. Arne Babenhauserheide
2024-10-22  7:49   ` Gerd Möllmann
2024-10-22  7:49   ` Eli Zaretskii
2024-10-22  8:01 ` Eli Zaretskii
2024-10-22  8:21   ` Gerd Möllmann
2024-10-22  8:57     ` Eli Zaretskii
2024-10-22  9:42     ` Eli Zaretskii
2024-10-22 10:23       ` Gerd Möllmann
2024-10-22 13:35         ` Eli Zaretskii
2024-10-22 13:43           ` Gerd Möllmann
2024-10-22 13:55             ` Eli Zaretskii
2024-10-22 14:02               ` Gerd Möllmann
2024-10-22 14:40                 ` Eli Zaretskii
2024-10-22 19:19                   ` Paul Eggert
2024-10-23  3:18                     ` Gerd Möllmann
2024-10-22 10:43       ` Gerd Möllmann
2024-10-23  3:05 ` Feng Shu
2024-10-23  3:13   ` Gerd Möllmann
2024-10-23  3:25     ` Feng Shu
2024-10-23  3:36       ` Gerd Möllmann
2024-10-23  3:44         ` Feng Shu
2024-10-23  4:09           ` Gerd Möllmann
2024-10-23  4:40             ` Gerd Möllmann
2024-10-23  5:00               ` Gerd Möllmann
2024-10-23  7:49                 ` Eli Zaretskii [this message]
2024-10-23  8:12                   ` Gerd Möllmann
2024-10-23 11:04                   ` Gerd Möllmann
2024-10-23 17:23                     ` Eli Zaretskii
2024-10-23 17:52                       ` Gerd Möllmann
2024-10-23  6:54               ` Feng Shu
2024-10-23  7:25                 ` Gerd Möllmann
2024-10-23  7:28               ` Eli Zaretskii
2024-10-23  7:37                 ` Gerd Möllmann
2024-10-23  7:52                   ` Feng Shu
2024-10-23  8:07                     ` Gerd Möllmann
2024-10-23  9:07                       ` Feng Shu
2024-10-23  9:58                         ` Gerd Möllmann
2024-10-23  7:11   ` Eli Zaretskii
2024-10-26  8:15 ` Gerd Möllmann

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=86wmhzdzt4.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=gerd.moellmann@gmail.com \
    --cc=tumashu@163.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.