Skip to content

Commit bd3b426

Browse files
committed
Substitute some customization etc. doc strings
These changes apply substitute-command-keys to some doc strings that were going through untranslated when creating customization or other widgets. * lisp/cus-edit.el (custom-group-value-create): * lisp/wid-edit.el (widget-default-create): (widget-push-button-value-create): Treat the widget tag as a doc string. * lisp/emacs-lisp/cl-extra.el (cl--describe-class-slot): Treat the :documentation value as a doc string. * lisp/wid-edit.el (widget-choose): Treat the choice names as doc strings. (widget-default-create): Treat the :doc value as a doc string. (widget-toggle-value-create): Treat the :on and :off values as doc strings. (widget-documentation-string-value-create): Substitute the doc string.
1 parent 543bb9b commit bd3b426

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

lisp/cus-edit.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3990,7 +3990,7 @@ If GROUPS-ONLY is non-nil, return only those members that are groups."
39903990
;; (indent (widget-get widget :indent))
39913991
(prefix (widget-get widget :custom-prefix))
39923992
(buttons (widget-get widget :buttons))
3993-
(tag (widget-get widget :tag))
3993+
(tag (substitute-command-keys (widget-get widget :tag)))
39943994
(symbol (widget-value widget))
39953995
(members (custom-group-members symbol
39963996
(and (eq custom-buffer-style 'tree)

lisp/emacs-lisp/cl-extra.el

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,9 @@ including `cl-block' and `cl-eval-when'."
831831
(prin1-to-string
832832
(alist-get :printer (cl--slot-descriptor-props slot)))))
833833
(when (alist-get :documentation (cl--slot-descriptor-props slot))
834-
(concat "\n " (alist-get :documentation (cl--slot-descriptor-props slot))
834+
(concat "\n "
835+
(substitute-command-keys
836+
(alist-get :documentation (cl--slot-descriptor-props slot)))
835837
"\n")))
836838
"\n"))
837839

lisp/wid-edit.el

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ minibuffer."
241241
(while items
242242
(setq choice (pop items))
243243
(when (consp choice)
244-
(let* ((name (car choice))
244+
(let* ((name (substitute-command-keys (car choice)))
245245
(function (cdr choice)))
246246
(insert (format "%c = %s\n" next-digit name))
247247
(define-key map (vector next-digit) function)
@@ -1503,7 +1503,8 @@ The value of the :type attribute should be an unconverted widget type."
15031503
(insert-char ?\s (widget-get widget :indent))))
15041504
((eq escape ?t)
15051505
(let ((image (widget-get widget :tag-glyph))
1506-
(tag (widget-get widget :tag)))
1506+
(tag (substitute-command-keys
1507+
(widget-get widget :tag))))
15071508
(cond (image
15081509
(widget-image-insert widget (or tag "image") image))
15091510
(tag
@@ -1515,7 +1516,7 @@ The value of the :type attribute should be an unconverted widget type."
15151516
(let ((doc (widget-get widget :doc)))
15161517
(when doc
15171518
(setq doc-begin (point))
1518-
(insert doc)
1519+
(insert (substitute-command-keys doc))
15191520
(while (eq (preceding-char) ?\n)
15201521
(delete-char -1))
15211522
(insert ?\n)
@@ -1759,7 +1760,7 @@ If END is omitted, it defaults to the length of LIST."
17591760

17601761
(defun widget-push-button-value-create (widget)
17611762
"Insert text representing the `on' and `off' states."
1762-
(let* ((tag (or (widget-get widget :tag)
1763+
(let* ((tag (or (substitute-command-keys (widget-get widget :tag))
17631764
(widget-get widget :value)))
17641765
(tag-glyph (widget-get widget :tag-glyph))
17651766
(text (concat widget-push-button-prefix
@@ -2167,7 +2168,8 @@ when he invoked the menu."
21672168
(defun widget-toggle-value-create (widget)
21682169
"Insert text representing the `on' and `off' states."
21692170
(let* ((val (widget-value widget))
2170-
(text (widget-get widget (if val :on :off)))
2171+
(text (substitute-command-keys
2172+
(widget-get widget (if val :on :off))))
21712173
(img (widget-image-find
21722174
(widget-get widget (if val :on-glyph :off-glyph)))))
21732175
(widget-image-insert widget (or text "")
@@ -2914,7 +2916,7 @@ link for that string."
29142916

29152917
(defun widget-documentation-string-value-create (widget)
29162918
;; Insert documentation string.
2917-
(let ((doc (widget-value widget))
2919+
(let ((doc (substitute-command-keys (widget-value widget)))
29182920
(indent (widget-get widget :indent))
29192921
(shown (widget-get (widget-get widget :parent) :documentation-shown))
29202922
(start (point)))

0 commit comments

Comments
 (0)