GNU bug report logs - #60501
28.2; pr-interface: widget-default-create: Wrong type argument

Previous Next

Package: emacs;

Reported by: Fernando de Morais <fernandodemorais.jf <at> gmail.com>

Date: Mon, 2 Jan 2023 20:10:02 UTC

Severity: normal

Tags: fixed

Found in version 28.2

Fixed in version 29.1

Done: Robert Pluim <rpluim <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Robert Pluim <rpluim <at> gmail.com>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: Fernando de Morais <fernandodemorais.jf <at> gmail.com>, 60501 <at> debbugs.gnu.org
Subject: Re: bug#60501: 28.2; pr-interface: widget-default-create: Wrong
 type argument
Date: Wed, 04 Jan 2023 17:00:30 +0100
>>>>> On Wed, 4 Jan 2023 12:21:55 -0300, Mauro Aranda <maurooaranda <at> gmail.com> said:

    Mauro> I don't have a lot of time right now, but I took a look at the code in
    Mauro> printing.el and I don't really understand why its using :inline t
    Mauro> when creating the menu-choice widget, since the values seem to be
    Mauro> strings or symbols.  That is, nothing that needs to be inlined.

OK. I canʼt comment on that, but we should try to be defensive

    Mauro> I wasn't aware of this breakage, of course, but it looks like I
    Mauro> should've made the code be more defensive (i.e., use car-safe instead of
    Mauro> car).

How about this (using car-safe would result in nil):

diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index 8250316bcc7..f4a49f58bed 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -2231,7 +2231,9 @@ widget-choice-value-create
             (if (widget-get current :inline)
                 (setq val value
                       fun :match-inline)
-              (setq val (car value)
+              (setq val (if (consp value)
+                            (car value)
+                          value)
                     fun :match))
           (setq val value
                 fun :match))

Robert
-- 




This bug report was last modified 2 years and 195 days ago.

Previous Next


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