aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emacs-lisp/cl-print.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp/cl-print.el')
-rw-r--r--lisp/emacs-lisp/cl-print.el32
1 files changed, 32 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/cl-print.el b/lisp/emacs-lisp/cl-print.el
index 5e5eee1da9e..3a8f80f6e93 100644
--- a/lisp/emacs-lisp/cl-print.el
+++ b/lisp/emacs-lisp/cl-print.el
@@ -237,6 +237,38 @@ into a button whose action shows the function's disassembly.")
237 'byte-code-function object))))) 237 'byte-code-function object)))))
238 (princ ")" stream))) 238 (princ ")" stream)))
239 239
240(cl-defmethod cl-print-object ((object interpreted-function) stream)
241 (unless stream (setq stream standard-output))
242 (princ "#f(lambda " stream)
243 (let ((args (help-function-arglist object 'preserve-names)))
244 ;; It's tempting to print the arglist from the "usage" info in the
245 ;; doc (e.g. for `&key` args), but that only makes sense if we
246 ;; *don't* print the body, since otherwise the body will tend to
247 ;; refer to args that don't appear in the arglist.
248 (if args
249 (prin1 args stream)
250 (princ "()" stream)))
251 (let ((env (aref object 2)))
252 (if (null env)
253 (princ " :dynbind" stream)
254 (princ " " stream)
255 (cl-print-object
256 (vconcat (mapcar (lambda (x) (if (consp x) (list (car x) (cdr x)) x))
257 env))
258 stream)))
259 (let* ((doc (documentation object 'raw)))
260 (when doc
261 (princ " " stream)
262 (prin1 doc stream)))
263 (let ((inter (interactive-form object)))
264 (when inter
265 (princ " " stream)
266 (cl-print-object inter stream)))
267 (dolist (exp (aref object 1))
268 (princ " " stream)
269 (cl-print-object exp stream))
270 (princ ")" stream))
271
240;; This belongs in oclosure.el, of course, but some load-ordering issues make it 272;; This belongs in oclosure.el, of course, but some load-ordering issues make it
241;; complicated. 273;; complicated.
242(cl-defmethod cl-print-object ((object accessor) stream) 274(cl-defmethod cl-print-object ((object accessor) stream)