aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2015-08-02 00:04:51 -0700
committerPaul Eggert2015-08-02 00:05:25 -0700
commitbd3b426ebb7a60045839e97c9da9bfd249fab1f1 (patch)
treee275317adecd9e4eed8362d9982983a7ee314c7c
parent543bb9bc2023fafdadf697e23484214daac95dee (diff)
downloademacs-bd3b426ebb7a60045839e97c9da9bfd249fab1f1.tar.gz
emacs-bd3b426ebb7a60045839e97c9da9bfd249fab1f1.zip
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.
-rw-r--r--lisp/cus-edit.el2
-rw-r--r--lisp/emacs-lisp/cl-extra.el4
-rw-r--r--lisp/wid-edit.el14
3 files changed, 12 insertions, 8 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index a8d1c97e37a..8fea5d85f4d 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."
3990 ;; (indent (widget-get widget :indent)) 3990 ;; (indent (widget-get widget :indent))
3991 (prefix (widget-get widget :custom-prefix)) 3991 (prefix (widget-get widget :custom-prefix))
3992 (buttons (widget-get widget :buttons)) 3992 (buttons (widget-get widget :buttons))
3993 (tag (widget-get widget :tag)) 3993 (tag (substitute-command-keys (widget-get widget :tag)))
3994 (symbol (widget-value widget)) 3994 (symbol (widget-value widget))
3995 (members (custom-group-members symbol 3995 (members (custom-group-members symbol
3996 (and (eq custom-buffer-style 'tree) 3996 (and (eq custom-buffer-style 'tree)
diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el
index 38cc772e8b0..101864d3721 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'."
831 (prin1-to-string 831 (prin1-to-string
832 (alist-get :printer (cl--slot-descriptor-props slot))))) 832 (alist-get :printer (cl--slot-descriptor-props slot)))))
833 (when (alist-get :documentation (cl--slot-descriptor-props slot)) 833 (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)))
835 "\n"))) 837 "\n")))
836 "\n")) 838 "\n"))
837 839
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index f7d8964c9fc..ac2e9810331 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -241,7 +241,7 @@ minibuffer."
241 (while items 241 (while items
242 (setq choice (pop items)) 242 (setq choice (pop items))
243 (when (consp choice) 243 (when (consp choice)
244 (let* ((name (car choice)) 244 (let* ((name (substitute-command-keys (car choice)))
245 (function (cdr choice))) 245 (function (cdr choice)))
246 (insert (format "%c = %s\n" next-digit name)) 246 (insert (format "%c = %s\n" next-digit name))
247 (define-key map (vector next-digit) function) 247 (define-key map (vector next-digit) function)
@@ -1503,7 +1503,8 @@ The value of the :type attribute should be an unconverted widget type."
1503 (insert-char ?\s (widget-get widget :indent)))) 1503 (insert-char ?\s (widget-get widget :indent))))
1504 ((eq escape ?t) 1504 ((eq escape ?t)
1505 (let ((image (widget-get widget :tag-glyph)) 1505 (let ((image (widget-get widget :tag-glyph))
1506 (tag (widget-get widget :tag))) 1506 (tag (substitute-command-keys
1507 (widget-get widget :tag))))
1507 (cond (image 1508 (cond (image
1508 (widget-image-insert widget (or tag "image") image)) 1509 (widget-image-insert widget (or tag "image") image))
1509 (tag 1510 (tag
@@ -1515,7 +1516,7 @@ The value of the :type attribute should be an unconverted widget type."
1515 (let ((doc (widget-get widget :doc))) 1516 (let ((doc (widget-get widget :doc)))
1516 (when doc 1517 (when doc
1517 (setq doc-begin (point)) 1518 (setq doc-begin (point))
1518 (insert doc) 1519 (insert (substitute-command-keys doc))
1519 (while (eq (preceding-char) ?\n) 1520 (while (eq (preceding-char) ?\n)
1520 (delete-char -1)) 1521 (delete-char -1))
1521 (insert ?\n) 1522 (insert ?\n)
@@ -1759,7 +1760,7 @@ If END is omitted, it defaults to the length of LIST."
1759 1760
1760(defun widget-push-button-value-create (widget) 1761(defun widget-push-button-value-create (widget)
1761 "Insert text representing the `on' and `off' states." 1762 "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))
1763 (widget-get widget :value))) 1764 (widget-get widget :value)))
1764 (tag-glyph (widget-get widget :tag-glyph)) 1765 (tag-glyph (widget-get widget :tag-glyph))
1765 (text (concat widget-push-button-prefix 1766 (text (concat widget-push-button-prefix
@@ -2167,7 +2168,8 @@ when he invoked the menu."
2167(defun widget-toggle-value-create (widget) 2168(defun widget-toggle-value-create (widget)
2168 "Insert text representing the `on' and `off' states." 2169 "Insert text representing the `on' and `off' states."
2169 (let* ((val (widget-value widget)) 2170 (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))))
2171 (img (widget-image-find 2173 (img (widget-image-find
2172 (widget-get widget (if val :on-glyph :off-glyph))))) 2174 (widget-get widget (if val :on-glyph :off-glyph)))))
2173 (widget-image-insert widget (or text "") 2175 (widget-image-insert widget (or text "")
@@ -2914,7 +2916,7 @@ link for that string."
2914 2916
2915(defun widget-documentation-string-value-create (widget) 2917(defun widget-documentation-string-value-create (widget)
2916 ;; Insert documentation string. 2918 ;; Insert documentation string.
2917 (let ((doc (widget-value widget)) 2919 (let ((doc (substitute-command-keys (widget-value widget)))
2918 (indent (widget-get widget :indent)) 2920 (indent (widget-get widget :indent))
2919 (shown (widget-get (widget-get widget :parent) :documentation-shown)) 2921 (shown (widget-get (widget-get widget :parent) :documentation-shown))
2920 (start (point))) 2922 (start (point)))