Subject: Re: bug#31309: 26.1; Customize widget :type 'text reports "bad format"

From: Lars Ingebrigtsen <[email-masked]>
Date: Sat, 13 Jul 2019 17:24:14 +0200

Phil Sainty <[email-masked]> writes:

> If I redefine `text' as follows (by copying the :format from `string')
> then the widget seems to work correctly.
>
> (define-widget 'text 'editable-field
>   "A multiline text area."
>   :format "%{%t%}: %v"
>   :keymap widget-text-keymap)

I've now done this change on the Emacs trunk.

> I'm not familiar with the internals of widgets, so I don't know if
> this is the best fix, but I see that all the other `define-widget'
> derivatives of `editable-field' do have explicit :format strings.
>
> However I would have thought that in the absence of an explicit
> :format, a *valid* default would be used, so I think the main bug
> is in `editable-field' itself, which does not follow its own rule
> when defining its own :format, which is simply "%v" (testing confirms
> that this value is used by default for derivative widgets which do
> not override :format).

Yes, the widget code is a bit convoluted...  I think what you're saying
makes sense, but I'm not sure of the ramifications, so I think the
minimal fix is perhaps best here.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no