emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about composite.c


From: Gerry Agbobada
Subject: Re: Question about composite.c
Date: Sat, 25 Apr 2020 15:53:49 +0200

I can confirm the bug is fixed by
commit fe903c5ab7354b97f80ecf1b01ca3ff1027be446
Author: Eli Zaretskii
Date: Sat Feb 8 15:41:36 2020 +0200
Allow composition of pure-ASCII strings in the mode line

* src/composite.c (Fcomposition_get_gstring): Allow unibyte strings if
they are pure
ASCII, by copying text into a multibyte string.


If it's possible to backport this commit in emacs 27 I think it would
save a lot of headaches.
I still don't know what exactly I did wrong with that combination of
overlays and ligatures,
but since it's fixed in master I won't look a lot more into that ; I
will just try to understand what
this patch does.

Best regards,

Gerry AGBOBADA

Le sam. 25 avr. 2020 à 15:29, Gerry Agbobada <address@hidden> a écrit :
>
> I cannot reproduce the bug even with my complex example on master, but
> still can reproduce it on 05089a4d (tip of emacs-27 last week).
>
> Bissecting will take a while but I'll try to find what commit changed
> the behaviour so I can understand a bit more.
>
> Gerry AGBOBADA
>
> Le sam. 25 avr. 2020 à 15:06, Gerry Agbobada <address@hidden> a écrit :
> >
> > > Is the overlay a necessary part of the problem?
> > Yes, because it's the overlay that tries to print a composed "=>" 
> > combination.
> >
> >
> > > Also, is it necessaryto 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.
> > I agree that it might still be a little complex. I'll try to work on
> > this again to provide
> > the minimum amount of basic elisp functions code, but it's a little hard 
> > for me
> > to pindown the exact issue so I'm just making baby steps for the moment.
> >
> > > From this, I don't think I understand why the problem is triggered by
> > > a '+' character.  If I do the following in "emacs -Q":
> > The problem is not triggered by the '+' character but by eros-mode
> > which will try to
> > output an overlay on the cursor with the content "=> 5".
> >
> > > In what version of Emacs do you see these infloops, btw?
> > I was at e1f0e0892 (tip of emacs-27 on Wed Mar 25 21:54:21 2020 +0200 )
> > I will build from master right now to continue the investigation.
> >
> > Thanks for your time answering me
> >
> > Gerry AGBOBADA
> >
> > Le sam. 25 avr. 2020 à 14:44, Eli Zaretskii <address@hidden> a écrit :
> > >
> > > > 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?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]