diff options
| author | Mark Oteiza | 2017-09-11 22:20:41 -0400 |
|---|---|---|
| committer | Mark Oteiza | 2017-09-11 22:20:41 -0400 |
| commit | 370e04fbb206c59c6a2251dc54f69c61887f60cc (patch) | |
| tree | 0d29452848b4eabbb78c6d55aebe62eca6f6e597 | |
| parent | 8130186cfb830d82e7d0cc6fb7443e3b6e026660 (diff) | |
| download | emacs-370e04fbb206c59c6a2251dc54f69c61887f60cc.tar.gz emacs-370e04fbb206c59c6a2251dc54f69c61887f60cc.zip | |
Add cl-print method for hash tables
* lisp/emacs-lisp/cl-print.el (cl-print-object): New method.
| -rw-r--r-- | lisp/emacs-lisp/cl-print.el | 10 |
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'." | |||
| 78 | (cl-print-object (aref object i) stream)) | 78 | (cl-print-object (aref object i) stream)) |
| 79 | (princ "]" stream)) | 79 | (princ "]" stream)) |
| 80 | 80 | ||
| 81 | (cl-defmethod cl-print-object ((object hash-table) stream) | ||
| 82 | (princ "#<hash-table " stream) | ||
| 83 | (princ (hash-table-test object) stream) | ||
| 84 | (princ " " stream) | ||
| 85 | (princ (hash-table-count object) stream) | ||
| 86 | (princ "/" stream) | ||
| 87 | (princ (hash-table-size object) stream) | ||
| 88 | (princ (format " 0x%x" (sxhash object)) stream) | ||
| 89 | (princ ">" stream)) | ||
| 90 | |||
| 81 | (define-button-type 'help-byte-code | 91 | (define-button-type 'help-byte-code |
| 82 | 'follow-link t | 92 | 'follow-link t |
| 83 | 'action (lambda (button) | 93 | 'action (lambda (button) |