Skip to content
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

"[sly-elided string of length 11]" is annoying as heck #334

Closed
joaotavora opened this issue Jul 13, 2020 · 12 comments
Closed

"[sly-elided string of length 11]" is annoying as heck #334

joaotavora opened this issue Jul 13, 2020 · 12 comments
Labels

Comments

@joaotavora
Copy link
Owner

Since I implemented this, these cases keep popping up. This is meant for very long strings, not for such short strings. Have to investigate.

@joaotavora joaotavora added the bug label Jul 13, 2020
@gefjon
Copy link

gefjon commented Jul 17, 2020

Is there any way to disable string elision even for very long strings as a user preference?

@joaotavora
Copy link
Owner Author

Don't remember anymore :-(, have to check the code.

@joaotavora
Copy link
Owner Author

If you can do that for me, I'm fine. It's all Common Lisp anyway.

@joaotavora
Copy link
Owner Author

Fixed. See the variable SLYNK:*STRING-ELISION-LEGNTH* and how it's used to control this. You should be able to

(setf (cdr (assoc 'slynk:*string-elision-length* slynk:*slynk-pprint-bindings*)) nil)

in your ~/.slynkrc to completely turn off string elision

@rudolf-adamkovic
Copy link

+1 Super-annoying.

(This should be opt-in.)

@joaotavora
Copy link
Owner Author

As far as I no understand, the new variable controlling this is set to 100 by default, which means you really don't get many elided strings that would have been entirely visible anyway unless you use very small fonts

@rudolf-adamkovic
Copy link

As far as I no understand, the new variable controlling this is set to 100 by default, which means you really don't get many elided strings that would have been entirely visible anyway unless you use very small fonts

FYI, I hit the problem with literate programming, in this case:

queens

SLY elided the output but not SLIME.

P.S. I do not want the Org file to depend on ~/.slynkrc configuration.

@joaotavora
Copy link
Owner Author

joaotavora commented Mar 1, 2023 via email

@rudolf-adamkovic
Copy link

@joaotavora

Thank you for the reply, and I apologize for not being clear.

I don't know exactly what you're showing me. The screenshot looks fine. Is it from SLIME?

Yes, from SLIME. (SLY elided the output.) I just wanted to show you a simple, real-world example where one stumbles upon this feature/bug.

I know that an Org interface to SLY exists, but it's not a part of SLY and I didn't write that code. So if you're bumping into problems there, ...

Org works great with both SLIME and SLY, and SLIME works great out of the box when doing literate programming. However, SLY does not (by default), hence my original comment "This should be opt-in."

@joaotavora
Copy link
Owner Author

What I'm trying to explain is that it's not that the "elided" feature fault. It's the fault of that Org code, which is misusing SLY's interfaces. It's using something meant to display information in the SLY UI to do literate programming things.

I didn't write that Org code, someone else did. If you give me a way to test this, I can probably fix the Org code.

It makes no sense to turn off by default an useful feature to appease some malfunctioning third party code.

@joaotavora
Copy link
Owner Author

yup. ob-lisp.el is mixing up string return values and stream output. Arguably, even for SLIME it is wrong.

If you want to output a large amount of data, you should use

#+begin_src lisp :results output
(princ (make-string 400 :initial-element #\A))
#+end_src

This will elide the string indeed

#+begin_src lisp :results output
(make-string 400 :initial-element #\A)
#+end_src

But this is wrong anyway, because in good Lisp REPL tradition, it should return the string braced with quotes, so it is READ able, and this doesn't work for multiple values anyway.

#+begin_src lisp
(values 1 2 3)
#+end_src

#+RESULTS:
: 1

I recommend you use :results :output if you want to output long text. That's what you would do at a REPL anyway.

Anyway, if ob-lisp.el wanted to keep this way of working and not present its users with elided strings, it could use *SLYNK-PPRINT-BINDINGS* easily.

@yantar92
Copy link

yantar92 commented Mar 8, 2023

Anyway, if ob-lisp.el wanted to keep this way of working and not present its users with elided strings, it could use SLYNK-PPRINT-BINDINGS easily.

If you can, please let us know what exactly can be improved in ob-lisp.el. That file currently has no maintainer, unfortunately. So, we have to rely upon user patches from people more familiar with Common Lisp and SLY.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants