From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Gerry Agbobada Newsgroups: gmane.emacs.devel Subject: Re: Question about composite.c Date: Sat, 25 Apr 2020 15:53:49 +0200 Message-ID: References: <83r1zsvfph.fsf@gnu.org> <83muagvcwg.fsf@gnu.org> <83zhaz7n1l.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="3417"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs developers To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 25 15:54:17 2020 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 1jSLG4-0000km-IH for ged-emacs-devel@m.gmane-mx.org; Sat, 25 Apr 2020 15:54:16 +0200 Original-Received: from localhost ([::1]:37528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSLG3-0004J9-K7 for ged-emacs-devel@m.gmane-mx.org; Sat, 25 Apr 2020 09:54:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34484) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSLFL-0003Vx-H0 for emacs-devel@gnu.org; Sat, 25 Apr 2020 09:53:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSLFK-0000nG-GI for emacs-devel@gnu.org; Sat, 25 Apr 2020 09:53:31 -0400 Original-Received: from mail-ua1-x92f.google.com ([2607:f8b0:4864:20::92f]:40143) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jSLFH-0000Ly-7n; Sat, 25 Apr 2020 09:53:27 -0400 Original-Received: by mail-ua1-x92f.google.com with SMTP id a10so12411952uad.7; Sat, 25 Apr 2020 06:53:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=2ZKheMJ3fmI2PVIp5eIiRyDYB+9AUNiLmUabYp1v6pk=; b=OiQtUpfOeqYr7p6DB1bIzKcuCpLOBMALVcDUfiEJhpUnDgqylgsE9EHcTcgwiIJnhg fqEcRD0DcGK1iktO6ZRQYcij0yX6zd0httazeKRn69KRlwSryMn0SzFpLJRW8FfbyTU9 lQou6kIzSxzRHzJNdlPwtyTy0oBjX+dTphmfFoIMdHqsJ77I1Gi+2vAMks8ZDVcnG5gP Wx9dCcQzmHQTu58JCqlCjUWQSmHZDZzwN1fE+J700UlFQwDvIDoS4gimwcoUa4jJJ2av C0GPIBYXI9eXPpv/H7S2efRSU/GymBeQbXi6zj86aV42ZjWx3TMoIqLarhD0mSwc0CDr j2Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=2ZKheMJ3fmI2PVIp5eIiRyDYB+9AUNiLmUabYp1v6pk=; b=S7k2XsgoFjFDyR2W3S9LDVZo93LyHeG3XDtUV+jRM4iN2LGx0fvIYWVD9A+ocWhL0R dYSIttnbFRzkD5plZRxt3Z/8jZF+bUowO780jXsvOfP380Pco+Y98agwKLHrcumtJ99D qYrA4RUhfHZu7qkEZc0pfgBwoApX6IFhjawCx0GrsfXBKdIR6pigxbYeybXes4FsRIc2 JA+Pk7/Han4xKIdk3wYtVQAYpNKVLq+3RyWHX907+/UGk4b8lgn6Sto3Un/PoEade6l7 sCDgEK/BJx+YvoRBAxCeB1zRkQ6R5C/akstrEXSlAPnvvkG73JMU1sbJXX5VBaUD9fHt 6yjQ== X-Gm-Message-State: AGi0PuaAPyvGPeNi3gFVZzViA0/1Z/eKemUIkUOrtIX8wrDCyBy6/8v+ cUTUwZ8Y9ePbOVxSfgucD6Y9/gHUz/kW5GwIDALwQAoVD0U= X-Google-Smtp-Source: APiQypL8F31o8xu1Byd3hBIWrJf2+ZVanNJxHde2bNiXYMguHS6AeGbPWAS5efcezqY+w17SjiA4UX8DIF1aLup+Wys= X-Received: by 2002:ab0:1648:: with SMTP id l8mr3926027uae.134.1587822805486; Sat, 25 Apr 2020 06:53:25 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::92f; envelope-from=gagbobada@gmail.com; helo=mail-ua1-x92f.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2607:f8b0:4864:20::92f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:247781 Archived-At: 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 =C3=A0 15:29, Gerry Agbobada a = =C3=A9crit : > > 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 =C3=A0 15:06, Gerry Agbobada a= =C3=A9crit : > > > > > Is the overlay a necessary part of the problem? > > Yes, because it's the overlay that tries to print a composed "=3D>" com= bination. > > > > > > > Also, is it necessaryto define a separate char-table, instead of usin= g > > > 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 har= d 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 "=3D> 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 =C3=A0 14:44, Eli Zaretskii a =C3= =A9crit : > > > > > > > From: Gerry Agbobada > > > > Date: Wed, 15 Apr 2020 00:43:59 +0200 > > > > Cc: emacs-devel@gnu.org > > > > > > > > It took me a good while, but I found a case where : > > > > - I can reproduce with =3Demacs -q=3D (Reproducing infinite loopin= g 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 sta= rt > > > > with `=3D>`, 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 `=3D> 5`. Instead, i= t > > > > 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 necessar= y > > > 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 > > > > '( > > > > (?=3D . "=3D>") ; Matches =3D> > > > > ))) > > > > (dolist (char-regexp alist) > > > > (set-char-table-range other-composition-ligature-table (car cha= r-regexp) > > > > `([,(cdr char-regexp) 0 font-shape-gstrin= g])))) > > > > > > > > (set-char-table-parent other-composition-ligature-table composition= -function-table) > > > > > > > > (setq-local composition-function-table other-composition-ligature-t= able) > > > > > > 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 "=3D>" 0 'compose-gstring-for-g= raphic))) > > > > > > and then type (+ 2 3)C-x C-e, I don't get any loop, and no characters > > > related to the =3D> ligatures anywhere. What am I missing? > > > > > > In what version of Emacs do you see these infloops, btw?