unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Thiago Melo <tmdmelo@gmail.com>
Cc: 63837@debbugs.gnu.org
Subject: bug#63837: 29.0.91; delete-forward-char error with composed text
Date: Fri, 02 Jun 2023 14:05:17 +0200	[thread overview]
Message-ID: <87jzwm9iiq.fsf@gmail.com> (raw)
In-Reply-To: <CABpoeKgfFoPPhbT=ae_i93NB70A5gWdxTH0Y2t3GdXUdfg_2-g@mail.gmail.com> (Thiago Melo's message of "Fri, 2 Jun 2023 10:42:29 +0000")

>>>>> On Fri, 2 Jun 2023 10:42:29 +0000, Thiago Melo <tmdmelo@gmail.com> said:

    Thiago> * How to reproduce:
    Thiago> 0. Start emacs with `emacs -Q'
    Thiago> 1. Create some text composition, e.g. eval: `(insert (compose-chars ?+))'
    Thiago> 2. Move cursor to before composed character
    Thiago> 3. `M-x delete-forward-char' or press <delete> key

    Thiago> * Backtrace:

    Thiago> Debugger entered--Lisp error: (wrong-type-argument sequencep t)
    Thiago>   lgstring-glyph-boundary(t 1 2)
    Thiago>   delete-forward-char(1 nil)
    Thiago>   funcall-interactively(delete-forward-char 1 nil)
    Thiago>   call-interactively(delete-forward-char nil nil)
    Thiago>   command-execute(delete-forward-char)

How about this (for master, since your example is somewhat contrived :-))

diff --git a/lisp/simple.el b/lisp/simple.el
index 3f88fcb8d03..efe6895fabc 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1527,9 +1527,11 @@ delete-forward-char
                           ;; character.
                           ((<= to pos)
                            (1+ pos))
-                          (t
+                          ((vectorp (nth 2 cmp))
                            (lgstring-glyph-boundary (nth 2 cmp)
-                                                    from (1+ pos)))))
+                                                    from (1+ pos)))
+                          (t
+                           (1+ pos))))
                      (1+ pos)))
              (setq n (1- n)))
            (delete-char (- pos start) killflag)))


Robert
-- 





  reply	other threads:[~2023-06-02 12:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-02 10:42 bug#63837: 29.0.91; delete-forward-char error with composed text Thiago Melo
2023-06-02 12:05 ` Robert Pluim [this message]
2023-06-02 12:49   ` Eli Zaretskii
2023-06-02 13:42     ` Thiago Melo
2023-06-02 14:30       ` Eli Zaretskii
2023-06-02 12:54   ` Thiago Melo
2023-06-02 12:43 ` Eli Zaretskii

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=87jzwm9iiq.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=63837@debbugs.gnu.org \
    --cc=tmdmelo@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).