emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master bd3b426: Substitute some customization etc. doc str


From: Paul Eggert
Subject: [Emacs-diffs] master bd3b426: Substitute some customization etc. doc strings
Date: Sun, 02 Aug 2015 07:05:30 +0000

branch: master
commit bd3b426ebb7a60045839e97c9da9bfd249fab1f1
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    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.
---
 lisp/cus-edit.el            |    2 +-
 lisp/emacs-lisp/cl-extra.el |    4 +++-
 lisp/wid-edit.el            |   14 ++++++++------
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index a8d1c97..8fea5d8 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -3990,7 +3990,7 @@ If GROUPS-ONLY is non-nil, return only those members that 
are groups."
         ;; (indent (widget-get widget :indent))
         (prefix (widget-get widget :custom-prefix))
         (buttons (widget-get widget :buttons))
-        (tag (widget-get widget :tag))
+        (tag (substitute-command-keys (widget-get widget :tag)))
         (symbol (widget-value widget))
         (members (custom-group-members symbol
                                        (and (eq custom-buffer-style 'tree)
diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el
index 38cc772..101864d 100644
--- a/lisp/emacs-lisp/cl-extra.el
+++ b/lisp/emacs-lisp/cl-extra.el
@@ -831,7 +831,9 @@ including `cl-block' and `cl-eval-when'."
               (prin1-to-string
                (alist-get :printer (cl--slot-descriptor-props slot)))))
     (when (alist-get :documentation (cl--slot-descriptor-props slot))
-      (concat "\n  " (alist-get :documentation (cl--slot-descriptor-props 
slot))
+      (concat "\n  "
+              (substitute-command-keys
+               (alist-get :documentation (cl--slot-descriptor-props slot)))
               "\n")))
    "\n"))
 
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index f7d8964..ac2e981 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -241,7 +241,7 @@ minibuffer."
             (while items
               (setq choice (pop items))
               (when (consp choice)
-                 (let* ((name (car choice))
+                 (let* ((name (substitute-command-keys (car choice)))
                         (function (cdr choice)))
                    (insert (format "%c = %s\n" next-digit name))
                    (define-key map (vector next-digit) function)
@@ -1503,7 +1503,8 @@ The value of the :type attribute should be an unconverted 
widget type."
                  (insert-char ?\s (widget-get widget :indent))))
               ((eq escape ?t)
                (let ((image (widget-get widget :tag-glyph))
-                     (tag (widget-get widget :tag)))
+                     (tag (substitute-command-keys
+                           (widget-get widget :tag))))
                  (cond (image
                         (widget-image-insert widget (or tag "image") image))
                        (tag
@@ -1515,7 +1516,7 @@ The value of the :type attribute should be an unconverted 
widget type."
                (let ((doc (widget-get widget :doc)))
                  (when doc
                    (setq doc-begin (point))
-                   (insert doc)
+                   (insert (substitute-command-keys doc))
                    (while (eq (preceding-char) ?\n)
                      (delete-char -1))
                    (insert ?\n)
@@ -1759,7 +1760,7 @@ If END is omitted, it defaults to the length of LIST."
 
 (defun widget-push-button-value-create (widget)
   "Insert text representing the `on' and `off' states."
-  (let* ((tag (or (widget-get widget :tag)
+  (let* ((tag (or (substitute-command-keys (widget-get widget :tag))
                  (widget-get widget :value)))
         (tag-glyph (widget-get widget :tag-glyph))
         (text (concat widget-push-button-prefix
@@ -2167,7 +2168,8 @@ when he invoked the menu."
 (defun widget-toggle-value-create (widget)
   "Insert text representing the `on' and `off' states."
   (let* ((val (widget-value widget))
-        (text (widget-get widget (if val :on :off)))
+        (text (substitute-command-keys
+               (widget-get widget (if val :on :off))))
         (img (widget-image-find
               (widget-get widget (if val :on-glyph :off-glyph)))))
     (widget-image-insert widget (or text "")
@@ -2914,7 +2916,7 @@ link for that string."
 
 (defun widget-documentation-string-value-create (widget)
   ;; Insert documentation string.
-  (let ((doc (widget-value widget))
+  (let ((doc (substitute-command-keys (widget-value widget)))
        (indent (widget-get widget :indent))
        (shown (widget-get (widget-get widget :parent) :documentation-shown))
        (start (point)))



reply via email to

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