emacs-diffs
[Top][All Lists]
Advanced

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

scratch/shortdoc f8bd57c 1/2: Add more strings


From: Lars Ingebrigtsen
Subject: scratch/shortdoc f8bd57c 1/2: Add more strings
Date: Sun, 13 Sep 2020 16:03:56 -0400 (EDT)

branch: scratch/shortdoc
commit f8bd57c49b6241cec33d9af63c995e798118ead3
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Add more strings
---
 lisp/emacs-lisp/shortdoc.el | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el
index 2548660..d8d0782 100644
--- a/lisp/emacs-lisp/shortdoc.el
+++ b/lisp/emacs-lisp/shortdoc.el
@@ -86,9 +86,12 @@ manual should be used, use the \"(Manual)Node\" form."
   (concat
    :example (concat "foo" "bar" "zot")
    :result "foobarzot")
-  (mapconcat
-   :example (mapconcat #'identity '("foo" "bar" "zot") " ")
+  (string-join
+   :example (string-join '("foo" "bar" "zot") " ")
    :result "foo bar zot")
+  (mapconcat
+   :example (mapconcat (lambda (a) (concat "[" a "]")) '("foo" "bar" "zot") " 
")
+   :result "[foo] [bar] [zot]")
   (make-string
    :example (make-string 5 ?x)
    :result "xxxxx")
@@ -156,6 +159,21 @@ manual should be used, use the \"(Manual)Node\" form."
   (stringp
    :example (stringp ?a)
    :result nil)
+  (string-empty-p
+   :example (string-empty-p "")
+   :result t)
+  (string-blank-p
+   :example (string-blank-p " \n")
+   :result 0)
+  (string-truncate-left
+   :example (string-truncate-left "longstring" 8)
+   :result "...string")
+  (string-remove-suffix
+   :example (string-remove-suffix "bar" "foobar")
+   :result "foo")
+  (string-remove-prefix
+   :example (string-remove-prefix "foo" "foobar")
+   :result "foo")
   (split-string
    :example (split-string "foo bar")
    :result ("foo" "bar")
@@ -196,7 +214,8 @@ manual should be used, use the \"(Manual)Node\" form."
                      (car (split-string (documentation function) "\n"))))
          (insert "\n\n")
          (add-face-text-property start-section (point) 'shortdoc-section t)
-         (let ((start (point)))
+         (let ((start (point))
+               (print-escape-newlines t))
            (cl-loop for (type value) on data by #'cddr
                     when (eq type :example)
                     do (progn



reply via email to

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