From 897b8561cdc856fb40b2a3c6f29230849aaf4a34 Mon Sep 17 00:00:00 2001 From: Mauro Aranda Date: Sun, 13 Dec 2020 10:44:30 -0300 Subject: [PATCH] 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) --- lisp/cus-edit.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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) -- 2.39.2