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

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

bug#67204: 29.1; request: always echo EMOJI name while emoji-list


From: Eli Zaretskii
Subject: bug#67204: 29.1; request: always echo EMOJI name while emoji-list
Date: Sat, 30 Dec 2023 11:20:59 +0200

> Cc: 67204@debbugs.gnu.org, awrhygty@outlook.com
> Date: Fri, 29 Dec 2023 17:44:15 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> 
> > Cc: 67204@debbugs.gnu.org, awrhygty@outlook.com
> > Date: Fri, 29 Dec 2023 17:38:59 +0200
> > From: Eli Zaretskii <eliz@gnu.org>
> > 
> > I cannot reproduce this.  I get:
> > 
> >   person getting massage
> >   person getting haircut
> >   person walking
> >   person running
> >   people with bunny ears
> >   woman dancing
> 
> Sorry, this was in Emacs 29.  In Emacs 20 I indeed see what you see.
> (But the OP used Emacs 29.1.)  Will investigate.

OK, I see the issue now: it's because C-f/C-b still moves by one
character in this buffer, and we basically rely on point-adjustment to
move to the next emoji.  The cases where the echo is incorrect, point
after C-f is still on the same emoji, not on the next one, whereas
after point adjustment it is on the next emoji.

The solution to that is not to show the emoji name from the
post-command-hook, but from an idle timer.  Like this:

  (add-hook #'post-command-hook
            (lambda ()
              (run-with-idle-timer 0.02 nil
                                   (lambda ()
                                     (when-let
                                         ((glyph (get-text-property (point)
                                                                    
'emoji-glyph))
                                          (name (emoji--name glyph)))
                                       (message "%s" name)))))
            nil 'local)

We could have this as an optional feature, or we could leave this
alone and rely on users who want this to customize their Emacs like
above.





reply via email to

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