unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 51012@debbugs.gnu.org
Subject: bug#51012: 29.0.50; Problems with emojis and vertical-motion
Date: Mon, 04 Oct 2021 18:43:53 +0200	[thread overview]
Message-ID: <87h7dwzqnq.fsf@gmail.com> (raw)
In-Reply-To: <87czokde8t.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 04 Oct 2021 17:02:58 +0200")

>>>>> On Mon, 04 Oct 2021 17:02:58 +0200, Lars Ingebrigtsen <larsi@gnus.org> said:

    Lars> The following signals an error:

    Lars> (with-temp-buffer
    Lars>   (insert "🏳️‍🌈")
    Lars>   (vertical-motion 1))

    Lars> Args out of range: 0

    Lars> In some circumstances (when edebug is in action or it's running from an
    Lars> async callback), it'll freeze Emacs altogether, so it's not totally safe
    Lars> to eval.

    Lars> I'm assuming it has something to do with the new emoji stuff, but I
    Lars> haven't tried to debug.

Gaah. What are the three most important problems in computer science
today?

1. Dependencies in code, especially when moving it
2. Off by one errors

This fixes it for me:

diff --git a/src/font.c b/src/font.c
index 82a1dffc01..83f0f8296a 100644
--- a/src/font.c
+++ b/src/font.c
@@ -3918,7 +3918,7 @@ font_range (ptrdiff_t pos, ptrdiff_t pos_byte, ptrdiff_t *limit,
 	    val = XCAR (val);
 	  else if (VECTORP (val))
 	    val = AREF (val, 0);
-	  font_object = font_for_char (face, XFIXNAT (val), pos - 1, string);
+	  font_object = font_for_char (face, XFIXNAT (val), pos, string);
 	}
     }
 





  reply	other threads:[~2021-10-04 16:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-04 15:02 bug#51012: 29.0.50; Problems with emojis and vertical-motion Lars Ingebrigtsen
2021-10-04 16:43 ` Robert Pluim [this message]
2021-10-04 16:51   ` Lars Ingebrigtsen
2021-10-04 17:00     ` Robert Pluim
2021-10-04 17:19       ` Lars Ingebrigtsen
2021-10-04 18:35         ` Glenn Morris
2021-10-04 17:04   ` Eli Zaretskii
2021-10-04 17:08     ` Robert Pluim

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=87h7dwzqnq.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=51012@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /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).