summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/cl-print.el
diff options
context:
space:
mode:
authorMark Oteiza <mvoteiza@udel.edu>2017-09-11 22:20:41 -0400
committerMark Oteiza <mvoteiza@udel.edu>2017-09-11 22:20:41 -0400
commit370e04fbb206c59c6a2251dc54f69c61887f60cc (patch)
tree0d29452848b4eabbb78c6d55aebe62eca6f6e597 /lisp/emacs-lisp/cl-print.el
parent8130186cfb830d82e7d0cc6fb7443e3b6e026660 (diff)
downloademacs-370e04fbb206c59c6a2251dc54f69c61887f60cc.tar.gz
Add cl-print method for hash tables
* lisp/emacs-lisp/cl-print.el (cl-print-object): New method.
Diffstat (limited to 'lisp/emacs-lisp/cl-print.el')
-rw-r--r--lisp/emacs-lisp/cl-print.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/cl-print.el b/lisp/emacs-lisp/cl-print.el
index fec5e868d63..eb50d756879 100644
--- a/lisp/emacs-lisp/cl-print.el
+++ b/lisp/emacs-lisp/cl-print.el
@@ -78,6 +78,16 @@ call other entry points instead, such as `cl-prin1'."
(cl-print-object (aref object i) stream))
(princ "]" stream))
+(cl-defmethod cl-print-object ((object hash-table) stream)
+ (princ "#<hash-table " stream)
+ (princ (hash-table-test object) stream)
+ (princ " " stream)
+ (princ (hash-table-count object) stream)
+ (princ "/" stream)
+ (princ (hash-table-size object) stream)
+ (princ (format " 0x%x" (sxhash object)) stream)
+ (princ ">" stream))
+
(define-button-type 'help-byte-code
'follow-link t
'action (lambda (button)