GNU bug report logs - #63837
29.0.91; delete-forward-char error with composed text

Previous Next

Package: emacs;

Reported by: Thiago Melo <tmdmelo <at> gmail.com>

Date: Fri, 2 Jun 2023 10:44:01 UTC

Severity: normal

Found in version 29.0.91

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 63837 in the body.
You can then email your comments to 63837 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#63837; Package emacs. (Fri, 02 Jun 2023 10:44:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thiago Melo <tmdmelo <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 02 Jun 2023 10:44:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Thiago Melo <tmdmelo <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.91; delete-forward-char error with composed text
Date: Fri, 2 Jun 2023 10:42:29 +0000
* How to reproduce:

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

* Backtrace:

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63837; Package emacs. (Fri, 02 Jun 2023 12:06:02 GMT) Full text and rfc822 format available.

Message #8 received at 63837 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Thiago Melo <tmdmelo <at> gmail.com>
Cc: 63837 <at> debbugs.gnu.org
Subject: Re: bug#63837: 29.0.91; delete-forward-char error with composed text
Date: Fri, 02 Jun 2023 14:05:17 +0200
>>>>> On Fri, 2 Jun 2023 10:42:29 +0000, Thiago Melo <tmdmelo <at> 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
-- 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63837; Package emacs. (Fri, 02 Jun 2023 12:44:02 GMT) Full text and rfc822 format available.

Message #11 received at 63837 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Thiago Melo <tmdmelo <at> gmail.com>
Cc: 63837 <at> debbugs.gnu.org
Subject: Re: bug#63837: 29.0.91; delete-forward-char error with composed text
Date: Fri, 02 Jun 2023 15:43:58 +0300
> From: Thiago Melo <tmdmelo <at> gmail.com>
> Date: Fri, 2 Jun 2023 10:42:29 +0000
> 
> * How to reproduce:
> 
> 0. Start emacs with `emacs -Q'
> 1. Create some text composition, e.g. eval: `(insert (compose-chars ?+))'
> 2. Move cursor to before composed character
> 3. `M-x delete-forward-char' or press <delete> key
> 
> * Backtrace:
> 
> Debugger entered--Lisp error: (wrong-type-argument sequencep t)
>   lgstring-glyph-boundary(t 1 2)
>   delete-forward-char(1 nil)
>   funcall-interactively(delete-forward-char 1 nil)
>   call-interactively(delete-forward-char nil nil)
>   command-execute(delete-forward-char)

Thanks, should be now fixed on the emacs-29 branch.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63837; Package emacs. (Fri, 02 Jun 2023 12:49:02 GMT) Full text and rfc822 format available.

Message #14 received at 63837 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: tmdmelo <at> gmail.com, 63837 <at> debbugs.gnu.org
Subject: Re: bug#63837: 29.0.91; delete-forward-char error with composed text
Date: Fri, 02 Jun 2023 15:49:28 +0300
> Cc: 63837 <at> debbugs.gnu.org
> From: Robert Pluim <rpluim <at> gmail.com>
> Date: Fri, 02 Jun 2023 14:05:17 +0200
> 
> How about this (for master, since your example is somewhat contrived :-))

The example might be contrived, but the recognition of static
compositions is completely incorrect: find-composition returns a
3-element list for those, not a two-element list.

I fixed that on emacs-29.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63837; Package emacs. (Fri, 02 Jun 2023 12:56:02 GMT) Full text and rfc822 format available.

Message #17 received at 63837 <at> debbugs.gnu.org (full text, mbox):

From: Thiago Melo <tmdmelo <at> gmail.com>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: 63837 <at> debbugs.gnu.org
Subject: Re: bug#63837: 29.0.91; delete-forward-char error with composed text
Date: Fri, 2 Jun 2023 12:54:29 +0000
On Fri, Jun 2, 2023 at 12:05 PM Robert Pluim <rpluim <at> gmail.com> wrote:
> How about this [...]
>
> diff --git a/lisp/simple.el b/lisp/simple.el
> [...]

Thank you, Robert.  I've tested your patch and it works in my simple
situation.  But I cannot tell if it works with other cases.  Consider
Bug#56237, for example.

> [...] since your example is somewhat contrived :-)

I actually found it with the package `org-superstar-mode', while
trying to delete the headline star characters it creates.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63837; Package emacs. (Fri, 02 Jun 2023 13:44:02 GMT) Full text and rfc822 format available.

Message #20 received at 63837 <at> debbugs.gnu.org (full text, mbox):

From: Thiago Melo <tmdmelo <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Robert Pluim <rpluim <at> gmail.com>, 63837 <at> debbugs.gnu.org
Subject: Re: bug#63837: 29.0.91; delete-forward-char error with composed text
Date: Fri, 2 Jun 2023 13:42:19 +0000
On Fri, Jun 2, 2023 at 12:48 PM Eli Zaretskii <eliz <at> gnu.org> wrote:
> I fixed that on emacs-29.

Thanks, Eli.  It also works for me.

I also saw the related Bug#56237.  From what I could test, it seems
your fix doesn't cause a regression in their use case.  Right? (eg,
when deleting the text "ரு போ").




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Fri, 02 Jun 2023 14:31:02 GMT) Full text and rfc822 format available.

Notification sent to Thiago Melo <tmdmelo <at> gmail.com>:
bug acknowledged by developer. (Fri, 02 Jun 2023 14:31:02 GMT) Full text and rfc822 format available.

Message #25 received at 63837-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Thiago Melo <tmdmelo <at> gmail.com>
Cc: rpluim <at> gmail.com, 63837-done <at> debbugs.gnu.org
Subject: Re: bug#63837: 29.0.91; delete-forward-char error with composed text
Date: Fri, 02 Jun 2023 17:30:47 +0300
> From: Thiago Melo <tmdmelo <at> gmail.com>
> Date: Fri, 2 Jun 2023 13:42:19 +0000
> Cc: Robert Pluim <rpluim <at> gmail.com>, 63837 <at> debbugs.gnu.org
> 
> On Fri, Jun 2, 2023 at 12:48 PM Eli Zaretskii <eliz <at> gnu.org> wrote:
> > I fixed that on emacs-29.
> 
> Thanks, Eli.  It also works for me.

Thanks, closing the bug.

> I also saw the related Bug#56237.  From what I could test, it seems
> your fix doesn't cause a regression in their use case.  Right? (eg,
> when deleting the text "ரு போ").

The current fix didn't touch that case, it only touched the case of
static compositions, not automatic compositions.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 01 Jul 2023 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 358 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.