Here are two test cases for exposing the bugs:
;; In ~/.swank.lisp: (setq SWANK::*SLIME-INSPECT-CONTENTS-LIMIT* 10)
;; ;; CASE I ;; (defvar *ht* (make-hash-table :test #'eql)) (loop for i below 20 do (setf (gethash i *ht*) (princ i)))
Then M-x slime-inspect *ht* (C-c I *ht*) :
The inspector window show: |Contents: |10 elements shown. Prompt for how many to inspect... |Inspect all 20 elements.
Choosing either of these two (bigger pieces action and entering the value in the REPL) or inspect whole pieces action, does not change the contents displayed in the inspector window, i.e. the number of items displayed does not change.
;; ;; CASE II ;; (defvar *array* (make-array 100 :initial-element nil)) Then M-x slime-inspect *array* (C-c I *array*)
The variable SWANK::*SLIME-INSPECT-CONTENTS-LIMIT* is not respected and the whole contents of the array is printed.
I'm guessing the following Changelog entry may apply, but haven't checked or fixed the problem against HEAD.
|2007-04-19 Tobias C. Rittweiler tcr@freebits.de | | * swank-backend.lisp (label-value-line): Add :newline as &key | argument; if true (the default) inserts a newline. | | * swank.lisp (inspect-for-emacs-list): Don't add a newline after | the last value of the list. |
-- Madhu
* Madhu m3odjgs9zc.fsf@robolove.meer.net : | Here are two test cases for exposing the bugs: | | ;; In ~/.swank.lisp: | (setq SWANK::*SLIME-INSPECT-CONTENTS-LIMIT* 10) | | ;; | ;; CASE I | ;; | (defvar *ht* (make-hash-table :test #'eql)) | (loop for i below 20 do (setf (gethash i *ht*) (princ i))) | | Then M-x slime-inspect *ht* (C-c I *ht*) : | | The inspector window show: | |Contents: | |10 elements shown. Prompt for how many to inspect... | |Inspect all 20 elements. | | Choosing either of these two (bigger pieces action and entering the | value in the REPL) or inspect whole pieces action, does not change the | contents displayed in the inspector window, i.e. the number of items | displayed does not change. | | ;; | ;; CASE II | ;; | (defvar *array* (make-array 100 :initial-element nil)) | Then M-x slime-inspect *array* (C-c I *array*) | | The variable SWANK::*SLIME-INSPECT-CONTENTS-LIMIT* is not respected | and the whole contents of the array is printed.
The CASE II problem CMUCL specific and a result of a method (METHOD INSPECT-FOR-EMACS (SIMPLE-VECTOR SWANK-BACKEND::CMUCL-INSPECTOR)) in slime/swank-cmucl.lisp which does not honour *SLIME-INSPECT-CONTENTS-LIMIT*. I'll retract CASE II from my report.
| I'm guessing the following Changelog entry may apply, but haven't checked | or fixed the problem against HEAD. | <snip>
The Changelog entry reported as relevant is incorrect. I believe the correct entry is
2007-04-09 Marco Baringer mb@bese.it
- swank.lisp (inspector-content-for-emacs): Look for refresh
keyword argument in :action links. (inspect-whole-thing-action, inspect-show-more-action): Update for new :action argument handling. (inspect-for-emacs stream, inspect-for-emacs stream-error): Pass :refresh nil on :action links. (action-part-for-emacs): Set both lambda and refresh in the *inspectee-actions* array. (inspector-call-nth-action): *inspectee-actions* now holds both the function and the boolean specifying whether to refresh or not.
swank-backend.lisp (inspect-for-emacs): Docstring update.
slime.el (slime-inspector-operate-on-point): Allow the action
calls to return nil.
I confess not understanding the new protocol. However I Attach a quick fix which reverts the earlier hack for inspecting arrays and hashtables using the :replace keyword. (It also includes 2 minor cleanups)
Please find attached the patches from [1-3] for the Inspector against current sources. This fixes problems in inspecting 1) 2D arrays 2) bigger-pieces-action.
[1] http://permalink.gmane.org/gmane.lisp.slime.devel/6332 [2] http://permalink.gmane.org/gmane.lisp.slime.devel/6333 [3] http://permalink.gmane.org/gmane.lisp.slime.devel/6392