branch: externals/inspector commit 17f6d1dfaf6605348822bef50dd7a9a18a8f44e0 Author: Mariano Montone <marianomont...@gmail.com> Commit: Mariano Montone <marianomont...@gmail.com>
Aesthetic adjustments --- inspector.el | 109 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 54 insertions(+), 55 deletions(-) diff --git a/inspector.el b/inspector.el index 0fd1556a58..9c36611556 100644 --- a/inspector.el +++ b/inspector.el @@ -184,7 +184,7 @@ When FUNCTION returns not NIL, adds a [More] button that inserts the next slice (lambda (slice cont) (let ((more-p (funcall function slice cont))) (when more-p - (insert-button "[More]" + (insert-button "[more]" 'action (let ((pos (point))) (lambda (btn) (ignore btn) @@ -203,17 +203,17 @@ When FUNCTION returns not NIL, adds a [More] button that inserts the next slice (cl-defmethod inspect-object ((class (subclass eieio-default-superclass))) "Render inspector buffer for EIEIO CLASS." (inspector--insert-title (format "%s class" (eieio-class-name class))) - (insert "Direct superclasses: ") + (insert "direct superclasses: ") (dolist (superclass (eieio-class-parents class)) (inspector--insert-inspect-button (eieio-class-name superclass) (eieio-class-name superclass)) (insert " ")) (newline) - (insert "Class slots: ") + (insert "class slots: ") (dolist (slot (eieio-class-slots class)) (insert (format "%s " (cl--slot-descriptor-name slot)))) (newline) - (insert "Direct subclasses:") + (insert "direct subclasses:") (dolist (subclass (eieio-class-children class)) (inspector--insert-inspect-button (eieio-class-name subclass) (eieio-class-name subclass)) @@ -222,28 +222,28 @@ When FUNCTION returns not NIL, adds a [More] button that inserts the next slice (cl-defmethod inspect-object ((object (eql t))) "Render inspector buffer for boolean T." (ignore object) - (inspector--insert-title "Boolean") - (insert "Value: t")) + (inspector--insert-title "boolean") + (insert "value: t")) (cl-defmethod inspect-object ((object (eql nil))) "Render inspector buffer for NIL object." (ignore object) (inspector--insert-title "nil") - (insert "Value: nil")) + (insert "value: nil")) (cl-defmethod inspect-object ((symbol symbol)) "Render inspector buffer for SYMBOL." - (inspector--insert-title "Symbol") - (inspector--insert-label "Name") + (inspector--insert-title "symbol") + (inspector--insert-label "name") (inspector--insert-value (symbol-name symbol)) (newline) - (inspector--insert-label "Is bound") + (inspector--insert-label "is bound") (inspector--insert-value (format "%s" (boundp symbol))) (newline) - (inspector--insert-label "Function") + (inspector--insert-label "function") (inspector--insert-inspect-button (symbol-function symbol)) (newline) - (inspector--insert-label "Property list") + (inspector--insert-label "property list") (inspector--insert-inspect-button (symbol-plist symbol)) (newline)) @@ -251,14 +251,14 @@ When FUNCTION returns not NIL, adds a [More] button that inserts the next slice "Render inspector buffer for OBJECT." (cond ((eieio-object-p object) - (insert "Instance of ") + (insert "instance of ") (inspector--insert-inspect-button (eieio-object-class object) (eieio-class-name (eieio-object-class object))) (newline) (inspector--insert-horizontal-line) (newline) - (inspector--insert-label "Slot values") + (inspector--insert-label "slot values") (newline) (dolist (slot (eieio-class-slots (eieio-object-class object))) (insert (format "%s: " (cl--slot-descriptor-name slot))) @@ -267,7 +267,7 @@ When FUNCTION returns not NIL, adds a [More] button that inserts the next slice (newline))) ((cl-struct-p object) (inspector--insert-title (format "%s struct" (type-of object))) - (inspector--insert-label "Slot values") + (inspector--insert-label "slot values") (newline) (dolist (slot (cdr (cl-struct-slot-info (type-of object)))) (insert (format "%s: " (car slot))) @@ -276,7 +276,7 @@ When FUNCTION returns not NIL, adds a [More] button that inserts the next slice (newline))) ((recordp object) (inspector--insert-title (format "%s record" (type-of object))) - (inspector--insert-label "Members") + (inspector--insert-label "members") (newline) (cl-do ((i 1 (cl-incf i))) ((= i (length object))) @@ -284,14 +284,14 @@ When FUNCTION returns not NIL, adds a [More] button that inserts the next slice (aref object i)) (newline))) ((functionp object) - (inspector--insert-title "Function") - (inspector--insert-label "Name") + (inspector--insert-title "function") + (inspector--insert-label "name") (inspector--insert-value (inspector--princ-to-string object)) (newline) - (inspector--insert-label "Arglist") + (inspector--insert-label "arglist") (inspector--insert-value (elisp-get-fnsym-args-string object))) ((eq (type-of object) 'finalizer) - (inspector--insert-title "Finalizer") + (inspector--insert-title "finalizer") (inspector--insert-value (inspector--princ-to-string object))) (t (error "Cannot inspect object: %s" object)))) @@ -300,8 +300,8 @@ When FUNCTION returns not NIL, adds a [More] button that inserts the next slice (cond ((and inspector-use-specialized-inspectors-for-lists (inspector--plistp cons)) - (inspector--insert-title "Property list") - (inspector--insert-label "Length") + (inspector--insert-title "property list") + (inspector--insert-label "length") (insert (inspector--princ-to-string (length cons))) (newline 2) (let ((plist (cl-copy-list cons))) @@ -314,8 +314,8 @@ When FUNCTION returns not NIL, adds a [More] button that inserts the next slice (newline)))) ((and inspector-use-specialized-inspectors-for-lists (inspector--alistp cons)) - (inspector--insert-title "Association list") - (inspector--insert-label "Length") + (inspector--insert-title "association list") + (inspector--insert-label "length") (insert (inspector--princ-to-string (length cons))) (newline 2) @@ -337,8 +337,8 @@ When FUNCTION returns not NIL, adds a [More] button that inserts the next slice ;; A [more] button is inserted or not depending on the boolean returned here: (< i (length cons)))))) ((inspector--proper-list-p cons) - (inspector--insert-title "Proper list") - (inspector--insert-label "Length") + (inspector--insert-title "proper list") + (inspector--insert-label "length") (insert (inspector--princ-to-string (length cons))) (newline 2) (let ((i 0) @@ -359,23 +359,24 @@ When FUNCTION returns not NIL, adds a [More] button that inserts the next slice (< i (length cons)) )))) (t ;; It is a cons cell - (inspector--insert-title "Cons cell") - (insert "CAR: ") + (inspector--insert-title "cons cell") + (inspector--insert-label "car") (inspector--insert-inspect-button (car cons)) (newline) - (insert "CDR: ") + (inspector--insert-label "cdr") (inspector--insert-inspect-button (cdr cons))))) (cl-defmethod inspect-object ((string string)) "Render inspector buffer for STRING." - (inspector--insert-title "String") + (inspector--insert-title "string") (prin1 string (current-buffer))) (cl-defmethod inspect-object ((array array)) "Render inspector buffer for ARRAY." (inspector--insert-title (inspector--princ-to-string (type-of array))) (let ((length (length array))) - (insert (format "Length: %s" length)) + (inspector--insert-label "length") + (insert (inspector--princ-to-string length)) (newline 2) (let ((i 0)) (inspector--do-with-slicer-and-more-button @@ -397,91 +398,89 @@ When FUNCTION returns not NIL, adds a [More] button that inserts the next slice (cl-defmethod inspect-object ((buffer buffer)) "Render inspector buffer for Emacs BUFFER." (inspector--insert-title (prin1-to-string buffer)) - (inspector--insert-label "Name") + (inspector--insert-label "name") (inspector--insert-inspect-button (buffer-name buffer)) (newline) - (inspector--insert-label "Window") + (inspector--insert-label "window") (inspector--insert-inspect-button (get-buffer-window buffer)) (newline) (let ((buffer-string (with-current-buffer buffer (buffer-string))) (cursor-position (with-current-buffer buffer (what-cursor-position)))) - (inspector--insert-label "Contents") + (inspector--insert-label "contents") (inspector--insert-inspect-button buffer-string) (newline) - (inspector--insert-label "Cursor position") + (inspector--insert-label "cursor position") (inspector--insert-inspect-button cursor-position))) (cl-defmethod inspect-object ((window window)) "Render inspector buffer for Emacs WINDOW." (inspector--insert-title (prin1-to-string window)) - (inspector--insert-label "Parent") + (inspector--insert-label "parent") (inspector--insert-inspect-button (window-parent window)) (newline) - (inspector--insert-label "Buffer") + (inspector--insert-label "buffer") (inspector--insert-inspect-button (window-buffer window)) (newline) - (inspector--insert-label "Parameters") + (inspector--insert-label "parameters") (inspector--insert-inspect-button (window-parameters window)) (newline) - (inspector--insert-label "Frame") + (inspector--insert-label "frame") (inspector--insert-inspect-button (window-frame window))) (cl-defmethod inspect-object ((frame frame)) "Render inspector buffer for Emacs FRAME." (inspector--insert-title (prin1-to-string frame)) - (inspector--insert-label "First window") + (inspector--insert-label "first window") (inspector--insert-inspect-button (frame-first-window frame)) (newline) - (inspector--insert-label "Parameters") + (inspector--insert-label "parameters") (inspector--insert-inspect-button (frame-parameters frame))) (cl-defmethod inspect-object ((overlay overlay)) "Render inspector buffer for Emacs OVERLAY." (inspector--insert-title (prin1-to-string overlay)) - (inspector--insert-label "Buffer") + (inspector--insert-label "buffer") (inspector--insert-inspect-button (overlay-buffer overlay)) (newline) - (inspector--insert-label "Start") + (inspector--insert-label "start") (inspector--insert-inspect-button (overlay-start overlay)) (newline) (inspector--insert-label "end") (inspector--insert-inspect-button (overlay-end overlay)) (newline) - (inspector--insert-label "Properties") + (inspector--insert-label "properties") (inspector--insert-inspect-button (overlay-properties overlay))) (cl-defmethod inspect-object ((number number)) "Render inspector buffer for NUMBER." (inspector--insert-title (inspector--princ-to-string (type-of number))) - (inspector--insert-label "Value") + (inspector--insert-label "value") (insert (inspector--princ-to-string number))) (cl-defmethod inspect-object ((integer integer)) "Render inspector buffer for INTEGER." (inspector--insert-title (inspector--princ-to-string (type-of integer))) - (insert "Integer: ") - (princ integer (current-buffer)) + (inspector--insert-label "integer") + (insert (inspector--princ-to-string integer)) (newline) - (insert "Char: ") - (princ (char-to-string integer) (current-buffer))) + (inspector--insert-label "char") + (insert (inspector--princ-to-string (char-to-string integer)))) (cl-defmethod inspect-object ((hash-table hash-table)) "Render inspector buffer for HASH-TABLEs." - (inspector--insert-title "Hash table") - (insert (inspector--print-truncated hash-table)) - (newline) - (inspector--insert-label "Size") + (inspector--insert-title (inspector--print-truncated hash-table)) + (inspector--insert-label "size") (insert (inspector--princ-to-string (hash-table-size hash-table))) (newline) - (inspector--insert-label "Count") + (inspector--insert-label "count") (insert (inspector--princ-to-string (hash-table-count hash-table))) (newline 2) (if (zerop (hash-table-count hash-table)) (insert "The hash table is empty.") (progn - (inspector--insert-label "Values") + (inspector--insert-label "values") (newline) (let ((i 0) (keys (hash-table-keys hash-table)))