New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can sly-inspector set object values at point? #377
Comments
I'm not in love or married to that interface, but it isn't terribly easy to refactor. Not impossible either. I'd think an interface where |
I'm personally very interested in this feature, mostly because it's
extremely handy when editing manually
- database entries
- file metadata
- music metadata
and so on.
I checked SLIME: it has the same interface, so nothing we can borrow here.
For a first iteration, I would do the following:
- Add a command to edit the value of the slot at point.
- Make value edition use a separate buffer like `sly-edit-value` does.
This is much better for long strings or long lists. Having a separate
buffer allows us to leverage all of Emacs editing capabilities
(search, copy-paste, macros, paredit...) unlike the minibuffer.
- Change the behaviour of `[set value]` to set a single value to all selected
slots.
While on the topic, I was thinking a bit ahead and maybe in a second
iteration we could go one step further with an interface to edit the
values of _multiple_ slots!
We could display them in a table with slots as column and objects as
rows. The cells would be writable.
- This way we can easily leverage rectangular editing to change a given
slot of all objects at once.
- We can add object and slot filtering.
For instance, if we inspect a whole list of objects, some objects may
not be interesting. Conversely, we might not be interested in all
slots when editing.
I don't know if tabulated-list-mode has support for cell editing.
Otherwise I'd need to find a suitable mode, or maybe extend tabulated-list-mode.
|
On a related note, it'd be nice to be able to edit any symbol value, not just class instances. In particular, this could be very helpful to edit lists. (defvar foo '((a 10) (b 12) (c 19))) it'd be nice if the inspector would let do stuff like changing the At first glance we could simply open an "edit" buffer and drop the value of |
What if foo's value references unreadable objects? |
Is it possible to refer to arbitrary objects in SLY?
I recall a feature of SLIME called `presentation` if I'm not mistaken,
and I think it allows the user to copy-paste unreadable objects anywhere
in s-expressions and evaluate the result.
|
SLY obviously has presentations, in the inspector, debugger, REPL, trace dialog, etc. But not in the minibuffer or arbitrary buffer. SLIME's presentation don't work "anywhere", as far as I know. Only the REPL. So a new contrib is needed. |
The inspection of an object looks like this:
To change the value of name, I select the slot with
[X]
then click on[set value]
.In some cases it can be a bit annoying, say if you forget to select a slot, then you must unselect all slots, then select the one you forgot.
What about adding a command to set the slot at point? It's probably a more familiar behaviour to many users.
By the way, is there a way to "select all slots" or "unselect all slots"?
Finally, it'd be nice to have a way to set one value to multiple slots.
If we implement the command I suggested previously to set the slot at point, then we could change the behaviour of
[set value]
to set 1 value to all selected slots.Thoughts?
The text was updated successfully, but these errors were encountered: