emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 897b856: Stop dropping the tag when creating the custom-variable


From: Mauro Aranda
Subject: master 897b856: Stop dropping the tag when creating the custom-variable widget
Date: Sun, 13 Dec 2020 08:45:34 -0500 (EST)

branch: master
commit 897b8561cdc856fb40b2a3c6f29230849aaf4a34
Author: Mauro Aranda <maurooaranda@gmail.com>
Commit: Mauro Aranda <maurooaranda@gmail.com>

    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 3a36cb0..041f13b 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]