unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Gerry Agbobada <gagbobada@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Question about composite.c
Date: Sat, 25 Apr 2020 15:44:06 +0300	[thread overview]
Message-ID: <83zhaz7n1l.fsf@gnu.org> (raw)
In-Reply-To: <CAHhDRB-fB62Pzo71x1BjuGoRzd5p6G1f+aGWWXdL1zpqGjZYcw@mail.gmail.com> (message from Gerry Agbobada on Wed, 15 Apr 2020 00:43:59 +0200)

> From: Gerry Agbobada <gagbobada@gmail.com>
> 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 =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?



  parent reply	other threads:[~2020-04-25 12:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-20 22:17 Question about composite.c Gerry Agbobada
2020-01-21 18:15 ` Eli Zaretskii
2020-01-21 18:57   ` Gerry Agbobada
2020-01-21 19:15     ` Eli Zaretskii
2020-01-22  8:55       ` Gerry Agbobada
2020-04-14 22:43         ` Gerry Agbobada
2020-04-15  1:10           ` Noam Postavsky
2020-04-15  7:39             ` Gerry Agbobada
2020-04-25 12:44           ` Eli Zaretskii [this message]
2020-04-25 13:06             ` Gerry Agbobada
2020-04-25 13:29               ` Gerry Agbobada
2020-04-25 13:53                 ` Gerry Agbobada
2020-04-25 15:23                   ` Eli Zaretskii
2020-04-25 15:32                     ` Gerry Agbobada

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83zhaz7n1l.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=gagbobada@gmail.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).