From: Mauro Aranda Date: Sun, 13 Dec 2020 13:44:30 +0000 (-0300) Subject: Stop dropping the tag when creating the custom-variable widget X-Git-Tag: emacs-28.0.90~4733 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=897b8561cdc856fb40b2a3c6f29230849aaf4a34;p=emacs.git Stop dropping the tag when creating the custom-variable widget * lisp/cus-edit.el (custom-variable-value-create): Obey the specified tag format when creating the variable tag, but stop dropping the tag format for the variable's type widget, since the tag can be used to give useful information to the user about the variable. (Bug#35133) --- diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 3a36cb02373..041f13b420b 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -2734,11 +2734,15 @@ try matching its doc string against `custom-guess-doc-alist'." buttons) (insert " ") (let* ((format (widget-get type :format)) - tag-format value-format) - (unless (string-match ":" format) + tag-format) + ;; We used to drop the widget tag when creating TYPE, passing + ;; everything after the colon (including whitespace characters + ;; after it) as the :format for TYPE. We don't drop the tag + ;; anymore, but we should keep an immediate whitespace character, + ;; if present, and it's easier to do it here. + (unless (string-match ":\\s-?" format) (error "Bad format")) (setq tag-format (substring format 0 (match-end 0))) - (setq value-format (substring format (match-end 0))) (push (widget-create-child-and-convert widget 'item :format tag-format @@ -2753,7 +2757,6 @@ try matching its doc string against `custom-guess-doc-alist'." buttons) (push (widget-create-child-and-convert widget type - :format value-format :value value) children)))) (unless (eq custom-buffer-style 'tree)