From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#68671: 30.0.50; C-x 8 e s RET persistently breaks C-x 8 e r Date: Sat, 27 Jan 2024 14:10:15 +0100 Message-ID: References: <86cytn820u.fsf@gnu.org> Reply-To: Eshel Yaron Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11739"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 68671@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 27 14:11:09 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rTiSj-0002tB-OF for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 27 Jan 2024 14:11:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rTiSX-0002fU-OD; Sat, 27 Jan 2024 08:10:57 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rTiSV-0002fH-Op for bug-gnu-emacs@gnu.org; Sat, 27 Jan 2024 08:10:55 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rTiSV-0002oI-Gn for bug-gnu-emacs@gnu.org; Sat, 27 Jan 2024 08:10:55 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rTiSc-0007au-1k for bug-gnu-emacs@gnu.org; Sat, 27 Jan 2024 08:11:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Jan 2024 13:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68671 X-GNU-PR-Package: emacs Original-Received: via spool by 68671-submit@debbugs.gnu.org id=B68671.170636103029124 (code B ref 68671); Sat, 27 Jan 2024 13:11:01 +0000 Original-Received: (at 68671) by debbugs.gnu.org; 27 Jan 2024 13:10:30 +0000 Original-Received: from localhost ([127.0.0.1]:53626 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rTiS5-0007Zd-K6 for submit@debbugs.gnu.org; Sat, 27 Jan 2024 08:10:30 -0500 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:42308 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rTiS1-0007ZP-Ec for 68671@debbugs.gnu.org; Sat, 27 Jan 2024 08:10:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1706361017; bh=keUk9vzTgG5JK32t4pJEoyFyXmxLRF8rxgY9HBmRyew=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ibsjzMQvDq6W2VwxzMDvHebp3DbHDN/71aCYh3vnLnB2e02bcU/f0km719VzMJpXO mfW62soHNivMvdbMxkHZ66foOf1lke5v7E5t+pjj2o1/lgbG09m410X6U+OTizfCyI PCfYbFcrd4/mlbLIDxf02ELhc5EKtbm3NzkPv5xRInId4JRzb52B6hjY07bS3WrCvG wthROPgbOYMv8tNaDqXzo6w+CNDGT4VlW+fb9zODuQed/nx6gm+Z+40OEhOuiMsm2N 0FwpDNBR8IX0TXFdWyLOm54JknmK4RQVYSmhh6xWcrr4Z1Of8Ork0IQRKOQ3D5AnYx s04izkdLl1EVg== In-Reply-To: <86cytn820u.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 27 Jan 2024 13:10:57 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:278999 Archived-At: --=-=-= Content-Type: text/plain Hi, Eli Zaretskii 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" >> >> >> 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. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-emoji-read-emoji-Signal-error-on-empty-input-Bug-686.patch >From 121c0d8ef1a4cde8cc3538870e165f963227d074 Mon Sep 17 00:00:00 2001 From: Eshel Yaron 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 --=-=-=--