diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2020-10-11 11:21:48 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2020-10-11 11:21:48 +0200 |
commit | ed378c95b63036ec819564b0d6203a3b7cb52f33 (patch) | |
tree | 4e06af23476982cc642c2c4ea4f583127136c26a /lisp/emacs-lisp | |
parent | 28592faa28cbc7e8696718f4be925094f7c401c1 (diff) | |
download | emacs-ed378c95b63036ec819564b0d6203a3b7cb52f33.tar.gz emacs-ed378c95b63036ec819564b0d6203a3b7cb52f33.tar.bz2 emacs-ed378c95b63036ec819564b0d6203a3b7cb52f33.zip |
Use Unicode arrows in shortdoc results
* lisp/emacs-lisp/shortdoc.el (shortdoc--display-function): Use
Unicode arrows if possible.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/shortdoc.el | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index f4eeb996af9..cabf026cd0e 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -983,7 +983,13 @@ There can be any number of :example/:result elements." (insert "\n") (add-face-text-property start-section (point) 'shortdoc-section t) (let ((start (point)) - (print-escape-newlines t)) + (print-escape-newlines t) + (double-arrow (if (char-displayable-p ?⇒) + "⇒" + "=>")) + (single-arrow (if (char-displayable-p ?→) + "→" + "->"))) (cl-loop for (type value) on data by #'cddr do (cl-case type @@ -993,7 +999,7 @@ There can be any number of :example/:result elements." (insert " ") (prin1 value (current-buffer)) (insert "\n") - (insert " => ") + (insert " " double-arrow " ") (prin1 (eval value) (current-buffer)) (insert "\n"))) (:no-eval* @@ -1001,7 +1007,7 @@ There can be any number of :example/:result elements." (insert " " value "\n") (insert " ") (prin1 value (current-buffer))) - (insert "\n -> " + (insert "\n " single-arrow " " (propertize "[it depends]" 'face 'variable-pitch) "\n")) @@ -1018,19 +1024,19 @@ There can be any number of :example/:result elements." (prin1 value (current-buffer))) (insert "\n")) (:result - (insert " => ") + (insert " " double-arrow " ") (prin1 value (current-buffer)) (insert "\n")) (:result-string - (insert " => ") + (insert " " double-arrow " ") (princ value (current-buffer)) (insert "\n")) (:eg-result - (insert " eg. => ") + (insert " eg. " double-arrow " ") (prin1 value (current-buffer)) (insert "\n")) (:eg-result-string - (insert " eg. => ") + (insert " eg. " double-arrow " ") (princ value (current-buffer)) (insert "\n")))) (put-text-property start (point) 'face 'shortdoc-example)) |