bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#57066: 29.0.50; Complex emoji overlaps with text


From: Eli Zaretskii
Subject: bug#57066: 29.0.50; Complex emoji overlaps with text
Date: Tue, 09 Aug 2022 19:05:06 +0300

> From: Protesilaos Stavrou <info@protesilaos.com>
> Cc: 57066@debbugs.gnu.org
> Date: Tue, 09 Aug 2022 15:50:10 +0300
> 
> >> Right after inserting the "sun" emoji, the 'describe-char' does not
> >> work.  The echo area shows:
> >> 
> >>     point=154 of 153 (EOB) column=7
> >
> > Are you saying that what describe-char does at EOB means it doesn't
> > work?  The above is exactly the expected result at EOB.
> 
> Sorry, I meant that I could not produce a Help buffer.

That's expected: there's no character at EOB.

> >>     cl--assertion-failed: Assertion failed: (not (multibyte-string-p str))
> >
> > I cannot reproduce that, either.  Could you run this under Edebug and
> > show the value of 'str' in the above assertion?
> 
> I am not sure how to do it with Edebug.

I tried to explain that below.

> With (setq debug-on-error t) I get this:
> 
> Debugger entered--Lisp error: (cl-assertion-failed ((not (multibyte-string-p 
> str)) nil))
>   cl--assertion-failed((not (multibyte-string-p str)))
>   encoded-string-description(#("😀" 0 1 (charset unicode)) nil)
>   describe-char(146)

There are 2 calls to encoded-string-description in describe-char, and
it's important to know which one causes this and why.

To run this under Edebug, do the following

  emacs -Q
  M-x load-library RET descr-text.el RET
  C-x C-f /path/to/lisp/international/descr-text.el RET
  C-u 385 M-g g
  M-x edebug-defun RET

Note that you must load-library with an explicit .el extension.

Line 385 in descr-text.el is where describe-char starts.

Then repeat the recipe, and when you call describe-char, Edebug will
kick in.  Now step through the code and try to figure out which call
to encoded-string-description is the one that barfs.  My guess is that
it's the second one, in which case it is important to know the value
of the variable 'charset' here:

      ("file code"
       ,@(if multibyte-p
             (let* ((coding buffer-file-coding-system)
                    (encoded (encode-coding-char char coding charset))) <<<<<<
               (if encoded
                   (list (encoded-string-description encoded coding)
                         (format "(encoded by coding system %S)"
                                 coding))

Thanks.





reply via email to

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