From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 29 05:21:56 2018 Received: (at submit) by debbugs.gnu.org; 29 Apr 2018 09:21:56 +0000 Received: from localhost ([127.0.0.1]:42487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fCiWq-0005k7-Gr for submit@debbugs.gnu.org; Sun, 29 Apr 2018 05:21:56 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44867) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fCiWp-0005ju-55 for submit@debbugs.gnu.org; Sun, 29 Apr 2018 05:21:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fCiWi-0002hL-GR for submit@debbugs.gnu.org; Sun, 29 Apr 2018 05:21:50 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:51873) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fCiWi-0002h6-Dk for submit@debbugs.gnu.org; Sun, 29 Apr 2018 05:21:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35830) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fCiWg-0002ZG-L3 for bug-gnu-emacs@gnu.org; Sun, 29 Apr 2018 05:21:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fCiWd-0002fO-Dp for bug-gnu-emacs@gnu.org; Sun, 29 Apr 2018 05:21:46 -0400 Received: from smtp-2.orcon.net.nz ([60.234.4.43]:38648) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fCiWd-0002eL-3T for bug-gnu-emacs@gnu.org; Sun, 29 Apr 2018 05:21:43 -0400 Received: from [10.253.37.70] (port=3318 helo=webmail.orcon.net.nz) by smtp-2.orcon.net.nz with esmtpa (Exim 4.86_2) (envelope-from ) id 1fCiWS-0005Xz-HF for bug-gnu-emacs@gnu.org; Sun, 29 Apr 2018 21:21:38 +1200 Received: from [150.107.175.157] via [10.253.37.253] by webmail.orcon.net.nz with HTTP (HTTP/1.1 POST); Sun, 29 Apr 2018 21:21:32 +1200 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Sun, 29 Apr 2018 21:21:32 +1200 From: Phil Sainty To: bug-gnu-emacs@gnu.org Subject: 26.1; Customize widget :type 'text reports "bad format" Message-ID: <1ea28335975bd90fbf0e7326968752d1@webmail.orcon.net.nz> X-Sender: psainty@orcon.net.nz User-Agent: Orcon Webmail X-GeoIP: -- X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.3 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.3 (-----) It seems that the multi-line `text' widget is broken. e.g.: (defcustom foo "Text value\nspanning multiple\nlines." "Multi-line text field." :type 'text) M-x customize-option RET foo RET Message: custom-variable-value-create: Bad format wid-edit.el defines the `text' widget like so: (define-widget 'text 'editable-field "A multiline text area." :keymap widget-text-keymap) The `string' widget (an 'editable-field derivative which works fine) is defined as: (define-widget 'string 'editable-field "A string" :tag "String" :format "%{%t%}: %v" :complete-function 'ispell-complete-word :prompt-history 'widget-string-prompt-value-history) I also see that the parent `editable-field' widget says: "Note: In an ‘editable-field’ widget, the ‘%v’ escape must be preceded by some other text in the ‘:format’ string (if specified)." 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'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). (define-widget 'editable-field 'default "An editable text field. Note: In an `editable-field' widget, the `%v' escape must be preceded by some other text in the `:format' string (if specified)." :convert-widget 'widget-value-convert-widget :keymap widget-field-keymap :format "%v" ...) Changing that to :format "%{%t%}: %v" proves to successfully resolve the original problem when the `text' widget definition is reverted. n.b. In the process of testing I noticed that "preceded by some other text" is not entirely accurate, as a value of " %v" (with a leading space) continued to trigger the bug. I also note that grepping for 'editable-field in general turns up a pile of uses of (widget-create 'editable-field) which also do not follow the same rule; either omitting the format: (setq widget (widget-create 'editable-field :size 15)) or setting a :format which begins with "%v": (setq comment-widget (widget-create 'editable-field :size 60 :format "%v " :value (or (image-dired-get-comment file) ""))) I've not attempted to test any of that code, so I don't know whether the same problem would occur. In GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2018-04-15 built on shodan Windowing system distributor 'The X.Org Foundation', version 11.0.11804000 System Description: Ubuntu 16.04.4 LTS Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Mark set [2 times] drush-php-psysh-config Creating customization items... custom-variable-value-create: Bad format Configured using: 'configure --prefix=/home/phil/emacs/26.1rc1/usr/local --with-x-toolkit=lucid --without-sound' Configured features: XAW3D XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK DBUS GSETTINGS NOTIFY GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11 THREADS LCMS2 Important settings: value of $LANG: en_NZ.UTF-8 locale-coding-system: utf-8 Major mode: Lisp Interaction Minor modes in effect: show-paren-mode: t minibuffer-depth-indicate-mode: t winner-mode: t global-hl-line-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv bytecomp byte-compile cconv format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils thingatpt help-fns radix-tree help-mode cus-edit cus-start cus-load wid-edit cl-loaddefs cl-lib dired-x easymenu paren mb-depth winner ring hl-line dired dired-loaddefs advice elec-pair time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 120787 7713) (symbols 48 22375 1) (miscs 40 156 240) (strings 32 34344 1244) (string-bytes 1 884748) (vectors 16 15684) (vector-slots 8 507442 10438) (floats 8 66 51) (intervals 56 302 0) (buffers 992 15) (heap 1024 33490 1603)) From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 13 11:24:20 2019 Received: (at 31309) by debbugs.gnu.org; 13 Jul 2019 15:24:20 +0000 Received: from localhost ([127.0.0.1]:43145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmJsq-0008Ps-Fo for submit@debbugs.gnu.org; Sat, 13 Jul 2019 11:24:20 -0400 Received: from quimby.gnus.org ([80.91.231.51]:35770) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmJso-0008Pi-7S for 31309@debbugs.gnu.org; Sat, 13 Jul 2019 11:24:18 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hmJsl-0001o4-19; Sat, 13 Jul 2019 17:24:17 +0200 From: Lars Ingebrigtsen To: Phil Sainty Subject: Re: bug#31309: 26.1; Customize widget :type 'text reports "bad format" References: <1ea28335975bd90fbf0e7326968752d1@webmail.orcon.net.nz> Date: Sat, 13 Jul 2019 17:24:14 +0200 In-Reply-To: <1ea28335975bd90fbf0e7326968752d1@webmail.orcon.net.nz> (Phil Sainty's message of "Sun, 29 Apr 2018 21:21:32 +1200") Message-ID: <871ryuufdt.fsf@mouse.gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Phil Sainty 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% [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 31309 Cc: 31309@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Phil Sainty 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 From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 13 11:24:25 2019 Received: (at control) by debbugs.gnu.org; 13 Jul 2019 15:24:25 +0000 Received: from localhost ([127.0.0.1]:43148 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmJsu-0008QC-OU for submit@debbugs.gnu.org; Sat, 13 Jul 2019 11:24:25 -0400 Received: from quimby.gnus.org ([80.91.231.51]:35784) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmJst-0008Q1-AX for control@debbugs.gnu.org; Sat, 13 Jul 2019 11:24:23 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hmJsq-0001oB-RH for control@debbugs.gnu.org; Sat, 13 Jul 2019 17:24:22 +0200 Date: Sat, 13 Jul 2019 17:24:20 +0200 Message-Id: <87zhlit0t7.fsf@mouse.gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #31309 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 31309 fixed close 31309 27.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 31309 fixed close 31309 27.1 quit From unknown Thu Jun 19 14:27:30 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 11 Aug 2019 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator