[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Question about composite.c
From: |
Eli Zaretskii |
Subject: |
Re: Question about composite.c |
Date: |
Sat, 25 Apr 2020 15:44:06 +0300 |
> From: Gerry Agbobada <address@hidden>
> Date: Wed, 15 Apr 2020 00:43:59 +0200
> Cc: address@hidden
>
> It took me a good while, but I found a case where :
> - I can reproduce with =emacs -q= (Reproducing infinite looping in
> composition_get_gstring with an empty non-nil string)
> - prettify-symbols-mode is not enabled
>
> The example includes the code of eros.el package, which creates an
> overlay when calling eval-last-sexp. The overlay is supposed to start
> with `=>`, and when I have this in my composition-function-table it
> triggers the loop.
> As explained in the file linked below, with the cursor on `(+ 3 2)|`
> I'd expect `C-x C-e` to create an overlay with `=> 5`. Instead, it
> loops indefinitely and the only way out is to kill -9 emacs (kill
> -USR2 doesn't help)
Is the overlay a necessary part of the problem? Also, is it necessary
to define a separate char-table, instead of using
composition-function-table?
The example looks quite complex, and I wonder whether you could
prepare a simplified variant that only included the parts that are
necessary? That would make debugging this issue much easier.
> (let ((alist
> '(
> (?= . "=>") ; Matches =>
> )))
> (dolist (char-regexp alist)
> (set-char-table-range other-composition-ligature-table (car char-regexp)
> `([,(cdr char-regexp) 0 font-shape-gstring]))))
>
> (set-char-table-parent other-composition-ligature-table
> composition-function-table)
>
> (setq-local composition-function-table other-composition-ligature-table)
>From this, I don't think I understand why the problem is triggered by
a '+' character. If I do the following in "emacs -Q":
(set-char-table-range composition-function-table
#x3d
(list (vector "=>" 0 'compose-gstring-for-graphic)))
and then type (+ 2 3)C-x C-e, I don't get any loop, and no characters
related to the => ligatures anywhere. What am I missing?
In what version of Emacs do you see these infloops, btw?