aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/emacs-lisp/cl-print.el9
-rw-r--r--test/lisp/emacs-lisp/cl-print-tests.el2
2 files changed, 6 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/cl-print.el b/lisp/emacs-lisp/cl-print.el
index 89a71d1b6c5..824d0b7b4f5 100644
--- a/lisp/emacs-lisp/cl-print.el
+++ b/lisp/emacs-lisp/cl-print.el
@@ -105,10 +105,11 @@ into a button whose action shows the function's disassembly.")
105 (if args 105 (if args
106 (prin1 args stream) 106 (prin1 args stream)
107 (princ "()" stream))) 107 (princ "()" stream)))
108 (let ((doc (documentation object 'raw))) 108 (pcase (help-split-fundoc (documentation object 'raw) object)
109 (when doc 109 ;; Drop args which `help-function-arglist' already printed.
110 (princ " " stream) 110 (`(,_usage . ,(and doc (guard (stringp doc))))
111 (prin1 doc stream))) 111 (princ " " stream)
112 (prin1 doc stream)))
112 (let ((inter (interactive-form object))) 113 (let ((inter (interactive-form object)))
113 (when inter 114 (when inter
114 (princ " " stream) 115 (princ " " stream)
diff --git a/test/lisp/emacs-lisp/cl-print-tests.el b/test/lisp/emacs-lisp/cl-print-tests.el
index dfbe18d7844..6448a1b37f7 100644
--- a/test/lisp/emacs-lisp/cl-print-tests.el
+++ b/test/lisp/emacs-lisp/cl-print-tests.el
@@ -34,7 +34,7 @@
34 (let ((print-circle t)) 34 (let ((print-circle t))
35 (should (equal (cl-prin1-to-string `((x . ,x) (y . ,x))) 35 (should (equal (cl-prin1-to-string `((x . ,x) (y . ,x)))
36 "((x . #1=#s(cl-print--test :a 1 :b 2)) (y . #1#))"))) 36 "((x . #1=#s(cl-print--test :a 1 :b 2)) (y . #1#))")))
37 (should (string-match "\\`#f(compiled-function (x) .*\n\n.*)\\'" 37 (should (string-match "\\`#f(compiled-function (x) \"[^\"]+\" [^\)]*)\\'"
38 (cl-prin1-to-string (symbol-function #'caar)))))) 38 (cl-prin1-to-string (symbol-function #'caar))))))
39 39
40(ert-deftest cl-print-tests-2 () 40(ert-deftest cl-print-tests-2 ()