unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#68671: 30.0.50; C-x 8 e s RET persistently breaks C-x 8 e r
@ 2024-01-23 10:59 Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-01-27 11:10 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-01-23 10:59 UTC (permalink / raw)
  To: 68671


1. emacs -Q
2. C-x 8 e s RET
   [ i.e. invoke `emoji-search` and exit with an empty minibuffer ]
3. Observe error "Wrong type argument: char-or-string-p, nil".  This
   error message could be more friendly, but that's not the issue here.
4. C-x 8 e r
5. Observe error "Wrong type argument: stringp, nil".  That's the issue.

What happens is that C-x 8 e s RET adds `nil` to the value of
`emoji--recent`, which breaks subsequent C-x 8 e r (`emoji-recent`).
This is extra troublesome because `emoji--recent` is used as a
multisession variable, so simply restarting Emacs doesn't help.

I see this also with Emacs 29.2, FWIW.


In GNU Emacs 30.0.50 (build 58, x86_64-apple-darwin23.0.0, NS
 appkit-2487.00 Version 14.0 (Build 23A344)) of 2024-01-23





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#68671: 30.0.50; C-x 8 e s RET persistently breaks C-x 8 e r
  2024-01-23 10:59 bug#68671: 30.0.50; C-x 8 e s RET persistently breaks C-x 8 e r Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-01-27 11:10 ` Eli Zaretskii
  2024-01-27 13:10   ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2024-01-27 11:10 UTC (permalink / raw)
  To: Eshel Yaron; +Cc: 68671

> Date: Tue, 23 Jan 2024 11:59:41 +0100
> From:  Eshel Yaron via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> 
> 1. emacs -Q
> 2. C-x 8 e s RET
>    [ i.e. invoke `emoji-search` and exit with an empty minibuffer ]
> 3. Observe error "Wrong type argument: char-or-string-p, nil".  This
>    error message could be more friendly, but that's not the issue here.
> 4. C-x 8 e r
> 5. Observe error "Wrong type argument: stringp, nil".  That's the issue.
> 
> What happens is that C-x 8 e s RET adds `nil` to the value of
> `emoji--recent`, which breaks subsequent C-x 8 e r (`emoji-recent`).
> This is extra troublesome because `emoji--recent` is used as a
> multisession variable, so simply restarting Emacs doesn't help.
> 
> I see this also with Emacs 29.2, FWIW.

Thanks.  Patches for fixing this will be most welcome.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#68671: 30.0.50; C-x 8 e s RET persistently breaks C-x 8 e r
  2024-01-27 11:10 ` Eli Zaretskii
@ 2024-01-27 13:10   ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-01-27 13:53     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-01-27 13:10 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 68671

[-- Attachment #1: Type: text/plain, Size: 1127 bytes --]

Hi,

Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Tue, 23 Jan 2024 11:59:41 +0100
>> From:  Eshel Yaron via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>>
>>
>> 1. emacs -Q
>> 2. C-x 8 e s RET
>>    [ i.e. invoke `emoji-search` and exit with an empty minibuffer ]
>> 3. Observe error "Wrong type argument: char-or-string-p, nil".  This
>>    error message could be more friendly, but that's not the issue here.
>> 4. C-x 8 e r
>> 5. Observe error "Wrong type argument: stringp, nil".  That's the issue.
>>
>> What happens is that C-x 8 e s RET adds `nil` to the value of
>> `emoji--recent`, which breaks subsequent C-x 8 e r (`emoji-recent`).
>> This is extra troublesome because `emoji--recent` is used as a
>> multisession variable, so simply restarting Emacs doesn't help.
>>
>> I see this also with Emacs 29.2, FWIW.
>
> Thanks.  Patches for fixing this will be most welcome.

I'm attaching such a patch below.  This provides better feedback when
you exit the `C-x 8 e s` minibuffer with an empty input, and avoids
adding `nil` to `emoji--recent` by bailing beforehand.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-emoji-read-emoji-Signal-error-on-empty-input-Bug-686.patch --]
[-- Type: text/x-patch, Size: 1288 bytes --]

From 121c0d8ef1a4cde8cc3538870e165f963227d074 Mon Sep 17 00:00:00 2001
From: Eshel Yaron <me@eshelyaron.com>
Date: Sat, 27 Jan 2024 14:01:47 +0100
Subject: [PATCH] ; (emoji--read-emoji): Signal error on empty input
 (Bug#68671)

---
 lisp/international/emoji.el | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/lisp/international/emoji.el b/lisp/international/emoji.el
index 3b97d6915af..cab1d2e663c 100644
--- a/lisp/international/emoji.el
+++ b/lisp/international/emoji.el
@@ -680,11 +680,12 @@ emoji--read-emoji
                                       "")))
                             strings)))))
            nil t)))
-    (when (cl-plusp (length name))
-      (let ((glyph (if emoji-alternate-names
-                       (cadr (split-string name "\t"))
-                     (gethash name emoji--all-bases))))
-        (cons glyph (gethash glyph emoji--derived))))))
+    (if (cl-plusp (length name))
+        (let ((glyph (if emoji-alternate-names
+                         (cadr (split-string name "\t"))
+                       (gethash name emoji--all-bases))))
+          (cons glyph (gethash glyph emoji--derived)))
+      (user-error "You didn't specify an emoji"))))
 
 (defvar-keymap emoji-zoom-map
   "+" #'emoji-zoom-increase
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#68671: 30.0.50; C-x 8 e s RET persistently breaks C-x 8 e r
  2024-01-27 13:10   ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-01-27 13:53     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2024-01-27 13:53 UTC (permalink / raw)
  To: Eshel Yaron; +Cc: 68671-done

> From: Eshel Yaron <me@eshelyaron.com>
> Cc: 68671@debbugs.gnu.org
> Date: Sat, 27 Jan 2024 14:10:15 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> Date: Tue, 23 Jan 2024 11:59:41 +0100
> >> From:  Eshel Yaron via "Bug reports for GNU Emacs,
> >>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> >>
> >>
> >> 1. emacs -Q
> >> 2. C-x 8 e s RET
> >>    [ i.e. invoke `emoji-search` and exit with an empty minibuffer ]
> >> 3. Observe error "Wrong type argument: char-or-string-p, nil".  This
> >>    error message could be more friendly, but that's not the issue here.
> >> 4. C-x 8 e r
> >> 5. Observe error "Wrong type argument: stringp, nil".  That's the issue.
> >>
> >> What happens is that C-x 8 e s RET adds `nil` to the value of
> >> `emoji--recent`, which breaks subsequent C-x 8 e r (`emoji-recent`).
> >> This is extra troublesome because `emoji--recent` is used as a
> >> multisession variable, so simply restarting Emacs doesn't help.
> >>
> >> I see this also with Emacs 29.2, FWIW.
> >
> > Thanks.  Patches for fixing this will be most welcome.
> 
> I'm attaching such a patch below.  This provides better feedback when
> you exit the `C-x 8 e s` minibuffer with an empty input, and avoids
> adding `nil` to `emoji--recent` by bailing beforehand.

Thanks, installed on both emacs-29 and master branches, and closing
the bug.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-27 13:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-23 10:59 bug#68671: 30.0.50; C-x 8 e s RET persistently breaks C-x 8 e r Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-27 11:10 ` Eli Zaretskii
2024-01-27 13:10   ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-27 13:53     ` Eli Zaretskii

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).