From f0d69b47349fd23fd06a8f1c5f54ca3bfcfc6522 Mon Sep 17 00:00:00 2001 From: Mauro Aranda Date: Fri, 11 Dec 2020 13:07:21 -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 3a36cb0237..041f13b420 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -2734,11 +2734,15 @@ custom-variable-value-create 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 @@ custom-variable-value-create buttons) (push (widget-create-child-and-convert widget type - :format value-format :value value) children)))) (unless (eq custom-buffer-style 'tree) -- 2.29.2