emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/inspector edbd5c1318 37/93: Association list inspector


From: ELPA Syncer
Subject: [elpa] externals/inspector edbd5c1318 37/93: Association list inspector and custom var to toggle specialized
Date: Tue, 24 May 2022 18:57:57 -0400 (EDT)

branch: externals/inspector
commit edbd5c13182a33c7d626e314cc7e227fbdc339bf
Author: Mariano Montone <marianomontone@gmail.com>
Commit: Mariano Montone <marianomontone@gmail.com>

    Association list inspector and custom var to toggle specialized
    inspectors for lists
---
 inspector.el | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/inspector.el b/inspector.el
index da31c6716e..f38d67e989 100644
--- a/inspector.el
+++ b/inspector.el
@@ -110,6 +110,11 @@
   :type 'boolean
   :group 'inspector)
 
+(defcustom inspector-use-specialized-inspectors-for-lists t
+  "Whether to use specialized inspectors for plists and alists."
+  :type 'boolean
+  :group 'inspector)
+
 ;;-------- Inspector code -------------------
 
 (defvar-local inspector-history nil
@@ -238,7 +243,8 @@ If LABEL has a value, then it is used as button label.  
Otherwise, button label
 
 (cl-defmethod inspect-object ((cons cons))
   (cond
-   ((and (inspector--proper-list-p cons) (inspector--plistp cons))
+   ((and inspector-use-specialized-inspectors-for-lists
+        (inspector--plistp cons))
     (inspector--insert-title "Property list")
     (let ((plist (cl-copy-list cons)))
       (while plist
@@ -248,6 +254,16 @@ If LABEL has a value, then it is used as button label.  
Otherwise, button label
         (let ((value (pop plist)))
           (inspector--insert-inspect-button value))
         (newline))))
+   ((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)))
    ((inspector--proper-list-p cons)
     (inspector--insert-title "Proper list")
     (let ((i 0))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]