[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/inspector 30d739e108 53/93: Slice arrays
From: |
ELPA Syncer |
Subject: |
[elpa] externals/inspector 30d739e108 53/93: Slice arrays |
Date: |
Tue, 24 May 2022 18:57:59 -0400 (EDT) |
branch: externals/inspector
commit 30d739e10856dc3e0c7a9814220b13215def81bf
Author: Mariano Montone <marianomontone@gmail.com>
Commit: Mariano Montone <marianomontone@gmail.com>
Slice arrays
---
inspector.el | 70 +++++++++++++++++++++++++++++++++++++-----------------------
1 file changed, 43 insertions(+), 27 deletions(-)
diff --git a/inspector.el b/inspector.el
index ac65e192d7..4ebba96db3 100644
--- a/inspector.el
+++ b/inspector.el
@@ -178,15 +178,15 @@ If LABEL has a value, then it is used as button label.
Otherwise, button label
(lambda (slice cont)
(funcall function slice cont)
(insert-button "[More]"
- 'action (let ((pos (point)))
- (lambda (btn)
- (ignore btn)
- (setq buffer-read-only nil)
- (goto-char pos)
- (delete-char (length "[More]"))
- (funcall cont)
- (setq buffer-read-only nil)))
- 'follow-link t))))
+ 'action (let ((pos (point)))
+ (lambda (btn)
+ (ignore btn)
+ (setq buffer-read-only nil)
+ (goto-char pos)
+ (delete-char (length "[More]"))
+ (funcall cont)
+ (setq buffer-read-only nil)))
+ 'follow-link t))))
(cl-defgeneric inspect-object (object)
"Main generic interface for filling inspector buffers for the different
types of OBJECT.")
@@ -299,26 +299,33 @@ If LABEL has a value, then it is used as button label.
Otherwise, button label
((and inspector-use-specialized-inspectors-for-lists
(inspector--alistp cons))
(inspector--insert-title "Association list")
- (dolist (cons cons)
- (insert "(")
- (inspector--insert-inspect-button (car cons))
- (insert " . ")
- (inspector--insert-inspect-button (cdr cons))
- (insert ")")
- (newline)))
+ (let ((i 0))
+ (inspector--do-with-slicer-and-more-button
+ (lambda ()
+ (when (< i (length cons))
+ (subseq cons i (min (incf i inspector-slice-size)
+ (length cons)))))
+ (lambda (slice cont)
+ (dolist (cons slice)
+ (insert "(")
+ (inspector--insert-inspect-button (car cons))
+ (insert " . ")
+ (inspector--insert-inspect-button (cdr cons))
+ (insert ")")
+ (newline))))))
((inspector--proper-list-p cons)
(inspector--insert-title "Proper list")
(let ((i 0)
- (j 0))
+ (j 0))
(inspector--do-with-slicer-and-more-button
(lambda ()
- (when (< i (length cons))
- (subseq cons i (min (incf i inspector-slice-size)
- (length cons)))))
+ (when (< i (length cons))
+ (subseq cons i (min (incf i inspector-slice-size)
+ (length cons)))))
(lambda (slice cont)
- (dolist (elem slice)
+ (dolist (elem slice)
(insert (format "%d: " j))
- (incf j)
+ (incf j)
(inspector--insert-inspect-button elem)
(newline))))))
(t ;; It is a cons cell
@@ -335,13 +342,22 @@ If LABEL has a value, then it is used as button label.
Otherwise, button label
(cl-defmethod inspect-object ((array array))
(inspector--insert-title (inspector--princ-to-string (type-of array)))
- (let ((length (length array)))
+ (let ((length (length array))
+ (i 0))
(insert (format "Length: %s" length))
(newline 2)
- (dotimes (i length)
- (insert (format "%d: " i))
- (inspector--insert-inspect-button (aref array i))
- (newline))))
+ (let ((i 0))
+ (inspector--do-with-slicer-and-more-button
+ (lambda ()
+ (when (< i length)
+ (cons i (1- (min (incf i inspector-slice-size)
+ length)))))
+ (lambda (slice cont)
+ (cl-loop for k from (car slice) to (cdr slice)
+ do
+ (insert (format "%d: " k))
+ (inspector--insert-inspect-button (aref array k))
+ (newline)))))))
(cl-defmethod inspect-object ((buffer buffer))
(inspector--insert-title (prin1-to-string buffer))
- [elpa] externals/inspector 51257fb9b5 55/93: tests: overlays, (continued)
- [elpa] externals/inspector 51257fb9b5 55/93: tests: overlays, ELPA Syncer, 2022/05/24
- [elpa] externals/inspector 060da36d6f 58/93: Better quit behaviour, ELPA Syncer, 2022/05/24
- [elpa] externals/inspector 6c071c67b3 60/93: Housekeeping, ELPA Syncer, 2022/05/24
- [elpa] externals/inspector e7f2f13ff4 75/93: Start writing ert tests, ELPA Syncer, 2022/05/24
- [elpa] externals/inspector b1d60310da 73/93: Patch by Stefan Monnier, ELPA Syncer, 2022/05/24
- [elpa] externals/inspector 739890b5d6 70/93: Autoloads?, ELPA Syncer, 2022/05/24
- [elpa] externals/inspector 477e363962 82/93: tests: no more side-effects, ELPA Syncer, 2022/05/24
- [elpa] externals/inspector b10f60c20d 89/93: Fontification for each type of object, ELPA Syncer, 2022/05/24
- [elpa] externals/inspector 6fadd6df9f 93/93: Create LICENSE, ELPA Syncer, 2022/05/24
- [elpa] externals/inspector d5d286c5de 10/93: inspect-last-sexp command, ELPA Syncer, 2022/05/24
- [elpa] externals/inspector 30d739e108 53/93: Slice arrays,
ELPA Syncer <=
- [elpa] externals/inspector a9e41424fa 66/93: Update README.md, ELPA Syncer, 2022/05/24
- [elpa] externals/inspector 4b193ba6d0 69/93: Don't add [more] button when not needed, ELPA Syncer, 2022/05/24
- [elpa] externals/inspector 2af90a4c82 83/93: tests: fixes, ELPA Syncer, 2022/05/24
- [elpa] externals/inspector 57105aef34 72/93: Update README.md, ELPA Syncer, 2022/05/24
- [elpa] externals/inspector 023ae9ca51 92/93: Use value face instead of button face, ELPA Syncer, 2022/05/24
- [elpa] externals/inspector d88d248eef 19/93: Presentation improvements, ELPA Syncer, 2022/05/24
- [elpa] externals/inspector 57b46a3079 38/93: Bug fix, ELPA Syncer, 2022/05/24
- [elpa] externals/inspector 22869bffb4 47/93: Indentation, ELPA Syncer, 2022/05/24
- [elpa] externals/inspector f534e87d1d 54/93: Slice tests, ELPA Syncer, 2022/05/24
- [elpa] externals/inspector 5f7ab9bfb7 06/93: Housekeeping, ELPA Syncer, 2022/05/24